Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Howto intercept deletion of figures
Howto intercept deletion of figures [message #223563] Tue, 31 March 2009 10:43 Go to next message
Robert Wloch is currently offline Robert WlochFriend
Messages: 109
Registered: July 2009
Senior Member
Hello everyone,

Already for days I'm trying to find a way to hook into the process of
deleting selected figures when the delete key is pressed.

I digged deep into GMF down to PromptingDeleteAction and its
createCommand(List). Is there any way to subclass that class and hook the
subclass back into my generated GMF editor?

I need to semantically analyze the list of selected objects and optionally
show a dialog to abort the delete command. From what I've seen and
debugged the last week my guess is, there's no better way than subclassing
PromptingDeleteAction and override createCommand(List).

Any idea is appreciated.

Cheers,
Rob
Re: Howto intercept deletion of figures [message #223619 is a reply to message #223563] Tue, 31 March 2009 11:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cayla_sha.gmx.net

there are this EditHelpers where you could overwrite
getDestroyElementCommand, but I think that`s too late in the
deletion-process for you.


Robert Wloch schrieb:
> Hello everyone,
>
> Already for days I'm trying to find a way to hook into the process of
> deleting selected figures when the delete key is pressed.
>
> I digged deep into GMF down to PromptingDeleteAction and its
> createCommand(List). Is there any way to subclass that class and hook
> the subclass back into my generated GMF editor?
>
> I need to semantically analyze the list of selected objects and
> optionally show a dialog to abort the delete command. From what I've
> seen and debugged the last week my guess is, there's no better way than
> subclassing PromptingDeleteAction and override createCommand(List).
>
> Any idea is appreciated.
>
> Cheers,
> Rob
>
Re: Howto intercept deletion of figures [message #223626 is a reply to message #223619] Tue, 31 March 2009 12:18 Go to previous messageGo to next message
Robert Wloch is currently offline Robert WlochFriend
Messages: 109
Registered: July 2009
Senior Member
Yes, that's too late. It was my second try :-(
Right now, I'm trying to put a new delete command to the diagram viewer's
key handler. However, originally the getKeyHandler() method uses an
internal ActionRegistry to store the initially created action. This
probably won't work either.


Cayla Sha wrote:

> there are this EditHelpers where you could overwrite
> getDestroyElementCommand, but I think that`s too late in the
> deletion-process for you.


> Robert Wloch schrieb:
>> Hello everyone,
>>
>> Already for days I'm trying to find a way to hook into the process of
>> deleting selected figures when the delete key is pressed.
>>
>> I digged deep into GMF down to PromptingDeleteAction and its
>> createCommand(List). Is there any way to subclass that class and hook
>> the subclass back into my generated GMF editor?
>>
>> I need to semantically analyze the list of selected objects and
>> optionally show a dialog to abort the delete command. From what I've
>> seen and debugged the last week my guess is, there's no better way than
>> subclassing PromptingDeleteAction and override createCommand(List).
>>
>> Any idea is appreciated.
>>
>> Cheers,
>> Rob
>>
[Solved] Howto intercept deletion of figures [message #223868 is a reply to message #223563] Wed, 01 April 2009 11:49 Go to previous message
Robert Wloch is currently offline Robert WlochFriend
Messages: 109
Registered: July 2009
Senior Member
Please read my blog
( http://blogs.itemis.de/wloch/2009/04/01/gmfintercepting-dele tion-of-figures/)
for a solution.
Previous Topic:TextAlignment Actions never enabled.
Next Topic:Connecting only one Link between nodes
Goto Forum:
  


Current Time: Fri Sep 20 19:07:49 GMT 2024

Powered by FUDForum. Page generated in 0.03127 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top