Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » silly issue when using ITreeContentProvider
silly issue when using ITreeContentProvider [message #327374] Wed, 16 April 2008 17:58 Go to next message
Eclipse UserFriend
Originally posted by: vcciubot.uwaterloo.ca

My model consists of a hierarchy of nodes. I find it cumbersome to make
a tree viewer display the tree rooted at a model element:

myNode
+ child1
+ child 2
....

It seems the api makes it easy to display only the children:

viewer.setInput(myNode);

shows

+child1
+child2

.....

I'd like the content provider to be able to do the following:

public Object[] getElements(Object inputElement) {

return new Object[] { inputElement };
}

Can I do this without wrapping inputElement into a another class?

thanks
Re: silly issue when using ITreeContentProvider [message #327376 is a reply to message #327374] Wed, 16 April 2008 17:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
There was a recent thread on this (could be on rcp or swt newsgroup
though) and even a bug report. The short answer is no you can't.

Tom

Vlad Ciubotariu schrieb:
> My model consists of a hierarchy of nodes. I find it cumbersome to make
> a tree viewer display the tree rooted at a model element:
>
> myNode
> + child1
> + child 2
> ...
>
> It seems the api makes it easy to display only the children:
>
> viewer.setInput(myNode);
>
> shows
>
> +child1
> +child2
>
> ....
>
> I'd like the content provider to be able to do the following:
>
> public Object[] getElements(Object inputElement) {
>
> return new Object[] { inputElement };
> }
>
> Can I do this without wrapping inputElement into a another class?
>
> thanks


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: silly issue when using ITreeContentProvider [message #327377 is a reply to message #327376] Wed, 16 April 2008 18:09 Go to previous message
Eclipse UserFriend
Originally posted by: vcciubot.uwaterloo.ca

Good to know.

thanks again

On Wed, 16 Apr 2008 19:58:46 +0200, Tom Schindl wrote:

> There was a recent thread on this (could be on rcp or swt newsgroup
> though) and even a bug report. The short answer is no you can't.
>
> Tom
>
> Vlad Ciubotariu schrieb:
>> My model consists of a hierarchy of nodes. I find it cumbersome to make
>> a tree viewer display the tree rooted at a model element:
>>
>> myNode
>> + child1
>> + child 2
>> ...
>>
>> It seems the api makes it easy to display only the children:
>>
>> viewer.setInput(myNode);
>>
>> shows
>>
>> +child1
>> +child2
>>
>> ....
>>
>> I'd like the content provider to be able to do the following:
>>
>> public Object[] getElements(Object inputElement) {
>>
>> return new Object[] { inputElement };
>> }
>>
>> Can I do this without wrapping inputElement into a another class?
>>
>> thanks
Previous Topic:DetailsPart and registered pages
Next Topic:Manage Configuration option in 3.4M6a
Goto Forum:
  


Current Time: Sat Dec 21 18:59:55 GMT 2024

Powered by FUDForum. Page generated in 0.04115 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top