|
Re: how to access the commandstack [message #202541 is a reply to message #202516] |
Thu, 10 November 2005 20:48 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03929 seconds