Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Undo Redo retagets never activate for my EditorPart
Undo Redo retagets never activate for my EditorPart [message #249096] Mon, 01 June 2009 12:37 Go to next message
drew frantz is currently offline drew frantz
Messages: 340
Registered: July 2009
Senior Member
I have built a basic EditorPart and I am using a GEF DefaultEditDomain and
CommandStack to execute commands, but the global undo/redo retaget actions
never get activated (this are visible but disabled). What is the trick to
getting the action bars to work.


Here is my actionBarContributor.

public class ConfigBarContributor

extends ActionBarContributor

{


protected void buildActions() {

addRetargetAction(new UndoRetargetAction());

addRetargetAction(new RedoRetargetAction());





}


protected void declareGlobalActionKeys() {

// TODO Auto-generated method stub


}


public void contributeToToolBar(IToolBarManager toolBarManager) {

super.contributeToToolBar(toolBarManager);

toolBarManager.add(ActionFactory.UNDO.create(PlatformUI.getW orkbench().getActiveWorkbenchWindow()));

toolBarManager.add(ActionFactory.REDO.create(PlatformUI.getW orkbench().getActiveWorkbenchWindow()));



}
Re: Undo Redo retagets never activate for my EditorPart [message #249101 is a reply to message #249096] Mon, 01 June 2009 14:21 Go to previous message
drew frantz is currently offline drew frantz
Messages: 340
Registered: July 2009
Senior Member
I grafted in what I needed from GraphicalEditor that pertained to actions.

"drew" <drew@acm.org> wrote in message
news:h0103o$9cl$1@build.eclipse.org...
>I have built a basic EditorPart and I am using a GEF DefaultEditDomain and
>CommandStack to execute commands, but the global undo/redo retaget actions
>never get activated (this are visible but disabled). What is the trick to
>getting the action bars to work.
>
>
> Here is my actionBarContributor.
>
> public class ConfigBarContributor
>
> extends ActionBarContributor
>
> {
>
>
> protected void buildActions() {
>
> addRetargetAction(new UndoRetargetAction());
>
> addRetargetAction(new RedoRetargetAction());
>
>
>
>
>
> }
>
>
> protected void declareGlobalActionKeys() {
>
> // TODO Auto-generated method stub
>
>
> }
>
>
> public void contributeToToolBar(IToolBarManager toolBarManager) {
>
> super.contributeToToolBar(toolBarManager);
>
> toolBarManager.add(ActionFactory.UNDO.create(PlatformUI.getW orkbench().getActiveWorkbenchWindow()));
>
> toolBarManager.add(ActionFactory.REDO.create(PlatformUI.getW orkbench().getActiveWorkbenchWindow()));
>
>
>
> }
>
>
Previous Topic:[zest] Set Text For Ellipse
Next Topic:[Announce] GEF 3.5.0RC3 is available
Goto Forum:
  


Current Time: Thu Jul 24 16:13:06 EDT 2014

Powered by FUDForum. Page generated in 0.01667 seconds