silly issue when using ITreeContentProvider [message #327374] |
Wed, 16 April 2008 17:58 |
Eclipse User |
|
|
|
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 #327377 is a reply to message #327376] |
Wed, 16 April 2008 18:09 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04115 seconds