Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Showing referenced elements in a Tree
Showing referenced elements in a Tree [message #421030] Tue, 22 July 2008 12:09 Go to next message
Eclipse UserFriend
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 15:38 Go to previous message
David Steinberg is currently offline David SteinbergFriend
Messages: 489
Registered: July 2009
Senior Member
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
Previous Topic:[Teneo] Containment Move
Next Topic:how to add text between tab in emf fom xsd
Goto Forum:
  


Current Time: Thu Apr 25 17:04:49 GMT 2024

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

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

Back to the top