Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Proggrammaticaly add an element for the "root" model element (access the root element prob
Proggrammaticaly add an element for the "root" model element (access the root element prob [message #123456] Wed, 02 May 2007 10:00 Go to next message
Eclipse UserFriend
Originally posted by: renwart.lippmann.lu

Hi everybody,

I'm new with GMF and I'm facing lots of trouble these times :

I'd like programatically modify my "root" model element. I've already
post this request but I don't find how to proceed really... I'm using
the XXXFactory singleton to create a new instance of the model element I
want to add to my model. The problem is that I don't know the right way
to access the element where to add the freshly created one. Please note
that I don't want to display on the editor the new element : It's only
an internal element which is aimed to stay invisible.

Note that the fact of creating a new element appears in the "Impl" model
classes located in the package "project_name".impl

Could you provide me a piece of code that show me the way to do that ?

Regards,
benren.
Re: Proggrammaticaly add an element for the "root" model element (access the root element [message #123616 is a reply to message #123456] Thu, 03 May 2007 02:13 Go to previous message
Eclipse UserFriend
Originally posted by: khai.n.situvista.com

Is it the case that you have a Diagram opened in an editor then by some
code (an action maybe) you want to add an element to your root model?

Or is it the case that when ever you create a new Diagram you want to
automatically create an element and add it to the root model element?

Or is it the simplest case where you have a root element (as example a
Car) that contains other elements (as example Doors) and you've used the
Factory to create Door but does not know how to add the Door to the Car?


Each of the three above are very different so can you provide some more
detail on which scenario matches what you're trying to do?


-- Khai --




Ben Renwart wrote:
> Hi everybody,
>
> I'm new with GMF and I'm facing lots of trouble these times :
>
> I'd like programatically modify my "root" model element. I've already
> post this request but I don't find how to proceed really... I'm using
> the XXXFactory singleton to create a new instance of the model element I
> want to add to my model. The problem is that I don't know the right way
> to access the element where to add the freshly created one. Please note
> that I don't want to display on the editor the new element : It's only
> an internal element which is aimed to stay invisible.
>
> Note that the fact of creating a new element appears in the "Impl" model
> classes located in the package "project_name".impl
>
> Could you provide me a piece of code that show me the way to do that ?
>
> Regards,
> benren.
Previous Topic:How to get ToolEntry for a tool ?
Next Topic:Drag'n drop between multiple GMF editors
Goto Forum:
  


Current Time: Fri May 09 07:04:02 EDT 2025

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

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

Back to the top