Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » accessing domainmodel objects during command execution
accessing domainmodel objects during command execution [message #210331] Tue, 04 November 2008 15:56 Go to next message
hagane is currently offline haganeFriend
Messages: 8
Registered: July 2009
Junior Member
Hi,

During "doDefaultElementCreation()" I would like to create an extra
modelobject witch is referenced by my editelement but contained in another
object (the modelroot). Is it possible to access my emf model root during
createommand?

Any help is appreciated.

Best wishes,
Robert
Re: accessing domainmodel objects during command execution [message #210349 is a reply to message #210331] Tue, 04 November 2008 16:28 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello hagane,

Newly created EMF object will be assigned to it's container by the create
command, so new element container should be available there. Using thie reference
you can traverse existing EMF model up to the model root, so it should be
possible.
-----------------
Alex Shatalin
Re: accessing domainmodel objects during command execution [message #210357 is a reply to message #210349] Tue, 04 November 2008 17:05 Go to previous messageGo to next message
hagane is currently offline haganeFriend
Messages: 8
Registered: July 2009
Junior Member
Alex Shatalin wrote:

> Hello hagane,

> Newly created EMF object will be assigned to it's container by the create
> command, so new element container should be available there. Using thie
reference
> you can traverse existing EMF model up to the model root, so it should be
> possible.
> -----------------
> Alex Shatalin

Hi,

thank you for replying to my post.
could you give me an exmaple on how to traverse?
For example I have an "EObject element" below the root in my domain
model...
I would expect something like element.getParent() but could't find a
method like this.

Best wishes,
Robert
Re: accessing domainmodel objects during command execution [message #210365 is a reply to message #210357] Tue, 04 November 2008 17:21 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello hagane,

try element.eContainer()

-----------------
Alex Shatalin
Previous Topic:Connection Creation problems via ModelingAssistantProvider
Next Topic:Image height change gives white space..
Goto Forum:
  


Current Time: Mon Jan 18 17:55:00 GMT 2021

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

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

Back to the top