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) {
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()));
>
>
>
> }
>
>