method creation/deletion inside model [message #235579] |
Tue, 07 July 2009 17:03 |
Eclipse User |
|
|
|
Originally posted by: watertext.hotmail.it
Greetings, i have a diagram editor (extends ecorediagrameditor) that
programmatically needs to add/remove/change the methods inside the classes
on the diagram.
I noticed that inside the EObject (
IGraphicalEditPart.getModel().getElement() ) i could get the methods using
eobject.getEOperations() but i dont know how to replace them inside the
model with a new EList
Its possible to do that and refresh my diagram if needed?
getEOperations() is the right method to do it?
thanks for your time, bye.
|
|
|
|
Re: method creation/deletion inside model [message #235802 is a reply to message #235611] |
Thu, 09 July 2009 13:15 |
Eclipse User |
|
|
|
Originally posted by: watertext.hotmail.it
Hi Alex, yes you were right, it's a method from EClass, i forgot to notice
the cast.
I was interested to modify the name of the Operation, i was able to do so
using the right command:
--------------------
Object newname = new String("myNewMethodName");
EditingDomain editingDomain =
((EcoreDiagramEditor)editor).getDiagramEditPart().getEditing Domain();
EOperation eop = eclass.getEOperations().get(0);
editingDomain.getCommandStack().execute(SetCommand.create(ed itingDomain,
eop, EcorePackage.Literals.ENAMED_ELEMENT__NAME , newname));
----------
Thanks for your help, bye.
"Alex Shatalin" <vano@borland.com> ha scritto nel messaggio
news:3c3172e62e8e48cbcddaa01ca550@news.eclipse.org...
> Hello Max,
>
>> I noticed that inside the EObject (
> You are probably talking about EClass.eOperations() method..
> Then you can modify returned collection and corresponding modifications
> will be propagated to the model/diagram should be updated in accordance.
>
> -----------------
> Alex Shatalin
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05663 seconds