Showing referenced elements in a Tree [message #421030] |
Tue, 22 July 2008 08:09  |
Eclipse User |
|
|
|
Originally posted by: daanstolp.gmail.com
In the Trees section of the Using EMF document [1], the following
comment is made:
"However, make sure that you won't have the same element appearing twice
in the tree as this will cause problems. The tree viewer assumes that
each domain element maps to one tree item. If you need to show
referenced elements in a tree, you will have to wrap them."
I *think* this pretty much describes the problem I am having in a
project I'm working on, but I can't figure out what is meant by
'wrapping' in this example. Can anybody please shed some light on this?
Thanks for any help.
Regards,
Daan
[1] http://www.eclipse.org/articles/Article-Using%20EMF/using-em f.html
|
|
|
Re: Showing referenced elements in a Tree [message #421037 is a reply to message #421030] |
Tue, 22 July 2008 11:38  |
Eclipse User |
|
|
|
Daan wrote:
>
> I *think* this pretty much describes the problem I am having in a
> project I'm working on, but I can't figure out what is meant by
> 'wrapping' in this example. Can anybody please shed some light on this?
Hi Daan,
The JFace tree viewer requires that a single object (i.e. an instance of
java.lang.Object) may appear in only one place in a tree. If you need to
represent the same object multiple times, you can work around this
limitation by using other objects in its place. Generally, you will want
the other object to behave just like the object it is standing in for,
by delegating content provider/label provider/etc. calls to it. The
article describes keeping a reference to and delegating to the original
object as wrapping it.
Hope that helps.
Cheers,
Dave
|
|
|
Powered by
FUDForum. Page generated in 0.08014 seconds