Custom deletion behaviour [message #173034] |
Tue, 19 February 2008 17:16  |
Eclipse User |
|
|
|
Originally posted by: mlooise.planet.nl
Hello All,
I'm a relative newcomer to the GMF community, and I'm currently using GMF to
build some editors for a meta-model which I designed as a part of my
graduation project at the university. Now I'm struggling with a bit of a
problem; Adding custom deletion behaviour.
I want to change the behaviour of the 'delete-element' context-menu action.
I basically want to add some extra custom checks before an element is
actually deleted. (I'm building a requirements-traceability tool, and
requirement-elements should only be deleted if no design is attached to it
;-) ) . and no I cant do it using constraints .. design is located in
another editor and I have to do some addition checks). The problem is
however that the generator does not generate any DestroyElementCommand or
something for me to override with my own behaviour. Or maybe I'm not looking
good enough.
My question is; is it possible to add my own behaviour on pushing the
'delete element' button, and if so, where do I have to look.
Another option would be to remove the delete button (I've seen it in
(http://wiki.eclipse.org/GMF_Tutorial_Part_3), and then adding my own
actions to do the deletion. But how to go about this last step then? How do
I declare extra context-menu-items with my behaviour and also call the
original deletion action from this, after my checks are done.
If anyone could create some clarity into this puzzling question, that would
be great! Any help is appreciated.
Regards,
Martin Looise
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 1.03693 seconds