[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.gmf] Re: Proggrammaticaly add an element for the "root" model element (access the root element problem)
|
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.