Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Multiple Deletes Issue
Multiple Deletes Issue [message #199366] Tue, 29 July 2008 12:28 Go to next message
Eclipse UserFriend
Originally posted by: awm_abu.yahoo.com

Hello all,

I want to show the user a dialog which allows them to cancel a delete when
deleting objects from a GMF diagram.
I return a command from the EdtiAdviceHelper.getBeforeDestroyElementCommand
This command asks the user if they want to continue and then either cancels
or runs.

My issue is when I try to delete multiple objects at once.
The getBeforeDestoryElementCommand is called for each element so I end up
with a dialog for each element that is going to be deleted.
What I am wondering is how can I group the elements to be deleted together
and show all in one dialog ?

thanks a lot,
Alan.
Re: Multiple Deletes Issue [message #199417 is a reply to message #199366] Tue, 29 July 2008 17:44 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Alan,

You can take advantage of the fact that the edit-helper constructs its
edit command in the context of a read-only transaction. You can use the
InternalTransactionalEditingDomain::getActiveTransaction() API to get
the current transaction and, in a map of some kind, cache your prompting
command with the transaction as the key.

Subsequent invocations of your advice can find the cached prompt command
and append elements to it instead of returning new advice commands.

Just be sure to purge the transaction from the cache when your prompting
command is dispose()d.

HTH,

Christian


Alan wrote:
> Hello all,
>
> I want to show the user a dialog which allows them to cancel a delete when
> deleting objects from a GMF diagram.
> I return a command from the EdtiAdviceHelper.getBeforeDestroyElementCommand
> This command asks the user if they want to continue and then either cancels
> or runs.
>
> My issue is when I try to delete multiple objects at once.
> The getBeforeDestoryElementCommand is called for each element so I end up
> with a dialog for each element that is going to be deleted.
> What I am wondering is how can I group the elements to be deleted together
> and show all in one dialog ?
>
> thanks a lot,
> Alan.
>
>
Previous Topic:feature realizable or not
Next Topic:Feature Value Spec (OCL Expression)
Goto Forum:
  


Current Time: Mon May 25 06:12:28 GMT 2020

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

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

Back to the top