Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » CommandStack(Is there a way to set my own CommandStack?)
CommandStack [message #897942] Wed, 25 July 2012 13:35 Go to next message
tom maxx is currently offline tom maxxFriend
Messages: 20
Registered: July 2012
Junior Member
I have (at least) two different types of commands:

  1. Commands which can be saved
  2. Commands which can't be saved


If I use the GEF org.eclipse.gef.commands.CommandStack I can't distinguish which one of the command-types is set. So I can't figure out If I have to save my application.

Is there a way to set my own CommandStack?

Re: CommandStack [message #897951 is a reply to message #897942] Wed, 25 July 2012 13:47 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Yes you can. Use the EditDomain.setCommandStack(CommandStack stack) method right after you create the edit domain.
Re: CommandStack [message #897971 is a reply to message #897951] Wed, 25 July 2012 14:21 Go to previous messageGo to next message
tom maxx is currently offline tom maxxFriend
Messages: 20
Registered: July 2012
Junior Member
Yes, but CommandStack isn't an interface ... and I have no access to the member saveLocation ... Sad
Re: CommandStack [message #897989 is a reply to message #897971] Wed, 25 July 2012 14:57 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Well, that's a different story.

You will have to do it in another way. Maybe don't get dirty state from the CommandStack.isDirty() but use the CommandStackEventListener somehow.
It will tell you what command is executed/redoed/undoed, so you could copy the CommandStack implementation to your own and use it for returning the dirty state.
Re: CommandStack [message #898500 is a reply to message #897989] Thu, 26 July 2012 13:43 Go to previous messageGo to next message
tom maxx is currently offline tom maxxFriend
Messages: 20
Registered: July 2012
Junior Member
Hey Jan,

thank you for your post! Smile That works ... but for me it sounds more like and hack, because I must distribute the functionality of the CommandStack over my application if I want to extend the functionality of the stack.
Re: CommandStack [message #898517 is a reply to message #898500] Thu, 26 July 2012 14:04 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
It is hack Smile But since the CommandStack is not extendable, what can one do?
Re: CommandStack [message #898525 is a reply to message #898517] Thu, 26 July 2012 14:14 Go to previous message
tom maxx is currently offline tom maxxFriend
Messages: 20
Registered: July 2012
Junior Member
Wink
Previous Topic:Detect figure selection when CTRL key is pressed
Next Topic:ScrollPane and EditParts
Goto Forum:
  


Current Time: Tue Mar 19 05:12:35 GMT 2024

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

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

Back to the top