I am working with Graphical Editor and i have multiple modelobjects/editpart/figures.
I want to create a command which should be activated on specific model object selction. When i make any selection then selection says it has Editpart as selection which is connected to desired object. Why i get EditPart in selection instead of model object?
You can get a model object from an edit part by calling EditPart#getModel()
On 04/23/2012 05:01 PM, ModelGeek Mising name wrote:
> Hi,
>
> I am working with Graphical Editor and i have multiple
> modelobjects/editpart/figures.
> I want to create a command which should be activated on specific model
> object selction. When i make any selection then selection says it has
> Editpart as selection which is connected to desired object. Why i get
> EditPart in selection instead of model object?
>
> thanks!
>
> Cheers,
>
yes i can but i want to define few declartive commands and i want to activate them when specific model object is selected.
Actually i want to have some generic functionality. Currently, i am working on one
editor but in future there can be multiple editors working with same model objects and showing them in different ways. I want to create a generic delete command so it
is activated when specific model object is selected regardless of editor and editorpart representing the object.
Jan Krakora Messages: 402 Registered: December 2009 Location: Prague
Senior Member
What are you trying to do? Do you want to create a handler with declarative enableWhen expression? If you do, then you can crate a property tester for the selected editPart.