Accessing attributes in generated code for editor [message #431203] |
Thu, 02 July 2009 09:30  |
Eclipse User |
|
|
|
Hi,
I'm working on a project using an ecore model.
With this ecore model I have generated a genmodel file and an
editorconfigurator and diagramconfigurator.
All works fine !!
But,
In my ecore model (Channel.ecore) I have a class (Configuration)
containing an attribute (name) and a reference to an other class
(Assignments). Assignments contains a reference to an other class
(Method), method contains attributes.
When I create my diagram, I fill the name of the configuration and I
create the assignments. In the assignments I create the Method. I would
like to set automatically the method attributes with the value
i_[Configuration.name].
I have found in the generated java code the Method constructor. I have
overrided it to create an other one taking a string as parameter to pass
the Configuration.name value.
Here is my problem: I can't get the Configuration.name value !!
I have tried to use the getters (ChannelPackage.getConfiguration()) but
all the objects I get contains the attribute but not the value of the
attribute.
A solution ?
Thanks
Arnaud
|
|
|
|
|
Re: Accessing attributes in generated code for editor [message #431215 is a reply to message #431213] |
Thu, 02 July 2009 11:10  |
Eclipse User |
|
|
|
Arnaud,
GMF uses different stuff for creating new objects in a model. I'm not
familiar with the details, but it seems to me that's what you should
specialized, not the model code itself. Of course you can figure out
where this is happening setting a breakpoint in the constructor and
seeing how it's being created by GMF...
Arnaud Dieumegard wrote:
> Ed,
>
> Yes it's not a plain EMF because I have generated a graphical editor
> so if i'm not mistaking it's more GMF, but what I want to do can be
> done with a plain EMf model I think.
> But I don't know what you mean with collectNewChildDescriptor, I need
> to use the itemProvider to get my objects ?
>
> Arnaud
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03604 seconds