Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » aovoid, forbid undo in Commands(aovoid, forbid undo in Commands)
aovoid, forbid undo in Commands [message #632912] Thu, 14 October 2010 15:58 Go to next message
AlexejS Mising name is currently offline AlexejS Mising nameFriend
Messages: 25
Registered: May 2010
Junior Member
Hello Community,
I hope here is someone who can help me.

My aim is to execute a Command such AbstractCommand or other Commnad with no undo possibility.


until now I execute my commands in this way ->
targetEditPart.getEditingDomain().getCommandStack().execute(command);

I tried also simply command.execute() <- but in this case the framework throw an exception at the moment when it want modify the model.

I just don't want to see an Undo-Option in Editmenu.

Thx
Re: aovoid, forbid undo in Commands [message #632928 is a reply to message #632912] Thu, 14 October 2010 16:40 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Your command should override "canUndo" method.

--
Mariot Chauvin @ Obeo

<a href="http://www.obeo.fr">http://www.obeo.fr</a>
<a href="http://mariot-thoughts.blogspot.com">http://mariot-thoughts.blogspot.com</a>
<a href="http://fr.linkedin.com/in/mariotchauvin">http://fr.linkedin.com/in/mariotchauvin</a>



AlexejS a écrit :
> Hello Community, I hope here is someone who can help me.
>
> My aim is to execute a Command such AbstractCommand or other Commnad
> with no undo possibility.
>
>
> until now I execute my commands in this way ->
>
> targetEditPart.getEditingDomain().getCommandStack().execute( command);
>
> I tried also simply command.execute() <- but in this case the
> framework throw an exception at the moment when it want modify the model.
>
> I just don't want to see an Undo-Option in Editmenu.
>
> Thx
Re: aovoid, forbid undo in Commands [message #632929 is a reply to message #632928] Thu, 14 October 2010 17:14 Go to previous message
AlexejS Mising name is currently offline AlexejS Mising nameFriend
Messages: 25
Registered: May 2010
Junior Member
Thx Smile I'm very happy now - that solved my problem! Thx
Previous Topic:Add a tab to palette Tool
Next Topic:GMF-Generator doesn't customize gmfgraph::Figure
Goto Forum:
  


Current Time: Thu Mar 28 13:16:18 GMT 2024

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

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

Back to the top