Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Reveal children of non-model nodes in EMF editor
Reveal children of non-model nodes in EMF editor [message #421862] Fri, 15 August 2008 06:49 Go to next message
Marc Moser is currently offline Marc MoserFriend
Messages: 66
Registered: July 2009
Member
Hi,

I could use TreeViewer.reveal(...) to reveal any node in the EMF
editor, as long as all nodes had corresponding model elements. Now I
introduced some "grouping nodes" in the Editor to improve readability
and revealing of nodes doesn't work anymore if the node to be revealed
is "below" some grouping node.

As an example, let's consider the following: 3 classes A, B and C, and
A has children of type B as well as children of type C (two
containment features). Without customization, the editor would look
somehow like this:

Element A1
Element B1
Element B2
Element C1
Element C2

After some small customization, it looks like this:

Element A1
All B-Elements
Element B1
Element B2
All C-Elements
Element C1
Element C2

In both cases, the editor works fine. I can add and remove children at
the correct place (the grouping nodes) and there don't seem to be any
problems (I followed the code samples from the EMF Book first
edition). However, in the second case, if e.g. everything is collapsed
and I use TreeViewer.reveal(..) to reveal Element B1, the outcome
would incorrectly look like this:

Element A1
All B-Elements
All C-Elements

Does anyone have an idea what could be the problem and how I could fix
it?

Many thanks,
Best,
Marc
Re: Reveal children of non-model nodes in EMF editor [message #421867 is a reply to message #421862] Fri, 15 August 2008 11:01 Go to previous message
Ed Merks is currently online Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Marc,

Comments below.

Marc Moser wrote:
> Hi,
>
> I could use TreeViewer.reveal(...) to reveal any node in the EMF
> editor, as long as all nodes had corresponding model elements. Now I
> introduced some "grouping nodes" in the Editor to improve readability
> and revealing of nodes doesn't work anymore if the node to be revealed
> is "below" some grouping node.
>
Very view things rely on having the proper implementation of getParent
in the item providers, but revealing a node in the tree does. It has to
be able to figure out the right path the root so that Eclipse will know
the right path of things to expand in order to reach that node...
> As an example, let's consider the following: 3 classes A, B and C, and
> A has children of type B as well as children of type C (two
> containment features). Without customization, the editor would look
> somehow like this:
>
> Element A1
> Element B1
> Element B2
> Element C1
> Element C2
>
> After some small customization, it looks like this:
>
> Element A1
> All B-Elements
> Element B1
> Element B2
> All C-Elements
> Element C1
> Element C2
>
> In both cases, the editor works fine. I can add and remove children at
> the correct place (the grouping nodes) and there don't seem to be any
> problems (I followed the code samples from the EMF Book first
> edition). However, in the second case, if e.g. everything is collapsed
> and I use TreeViewer.reveal(..) to reveal Element B1, the outcome
> would incorrectly look like this:
>
> Element A1
> All B-Elements
> All C-Elements
>
So does getParent for B1 return "All B-Elements"?
> Does anyone have an idea what could be the problem and how I could fix
> it?
>
> Many thanks,
> Best,
> Marc
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Teneo ENumUserType error during datastore initialization
Next Topic:xmi:version attribute for an EMF resource
Goto Forum:
  


Current Time: Tue Apr 23 08:10:00 GMT 2024

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

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

Back to the top