Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » how to access the commandstack
how to access the commandstack [message #202516] Thu, 10 November 2005 16:44 Go to next message
Jens Bartelheimer is currently offline Jens BartelheimerFriend
Messages: 44
Registered: July 2009
Member
Hi,

I like to modify my model with an own formular. To use undo and redo I
write my own command.

My question is how I can access the commandstack of my GEF Editor? I
know that my Editor class obtain the stack but is this the right way to
access the stack? Currently I use this code with the help of a static
method getMyCommandStack():

Command c = new AlterClassFeatures(part.getClazz(), data);
myEditor.getMyCommandStack().execute(c);

Thanks,
Jens
Re: how to access the commandstack [message #202541 is a reply to message #202516] Thu, 10 November 2005 20:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Jens wrote:
> Hi,
>
> I like to modify my model with an own formular. To use undo and redo I
> write my own command.
>
> My question is how I can access the commandstack of my GEF Editor? I
> know that my Editor class obtain the stack but is this the right way to
> access the stack? Currently I use this code with the help of a static
> method getMyCommandStack():
>
> Command c = new AlterClassFeatures(part.getClazz(), data);
> myEditor.getMyCommandStack().execute(c);
>
> Thanks,
> Jens


Usually your command will be invoked by an Action. The action will have
access to the command stack. The action will have been registered with
the editor when it was created. Its one of the editor's actions in fact
as it works on the editor and is probably responding to a retarget
action from the editor's contributor.

CL
Re: how to access the commandstack [message #202549 is a reply to message #202516] Thu, 10 November 2005 20:50 Go to previous message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Jens wrote:
> Hi,
>
> I like to modify my model with an own formular. To use undo and redo I
> write my own command.
>
> My question is how I can access the commandstack of my GEF Editor? I
> know that my Editor class obtain the stack but is this the right way to
> access the stack? Currently I use this code with the help of a static
> method getMyCommandStack():
>
> Command c = new AlterClassFeatures(part.getClazz(), data);
> myEditor.getMyCommandStack().execute(c);
>
> Thanks,
> Jens


be sure to look at the logic designer example. edit parts also can use
commands and they also have access to the command stack. Try to follow
the techniques used in the logic designer. It will take you a while to
get to grips with it, but its pretty solid.

CL
Previous Topic:Assertion failed, Property View with a ComboBoxDescriptor
Next Topic:How can I employ Print Action?
Goto Forum:
  


Current Time: Tue Nov 12 17:31:41 GMT 2024

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

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

Back to the top