Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » remove undo and redo actions ?
remove undo and redo actions ? [message #229896] Fri, 26 January 2007 10:11 Go to next message
Mark Robinson is currently offline Mark RobinsonFriend
Messages: 37
Registered: July 2009
Member
Is it possible to remove the UndoAction and RedoAction from the context
menu of a GEF Diagram editor?

I've tried commenting out the following bit of code in createActions, but
this results in the context menu not being displayed at all:

// action = new UndoAction(this);
// registry.registerAction(action);
// getStackActions().add(action.getId());
//
// action = new RedoAction(this);
// registry.registerAction(action);
// getStackActions().add(action.getId());

I also tried leaving the above code in then using removeAction, but this
has the same effect - no context menu is displayed:

action = registry.getAction ("redo");

if (action != null)
{
registry.removeAction (action);
}

Thanks in advance,
Mark Robinson
Re: remove undo and redo actions ? [message #229905 is a reply to message #229896] Fri, 26 January 2007 11:30 Go to previous message
Mark Robinson is currently offline Mark RobinsonFriend
Messages: 37
Registered: July 2009
Member
Mark Robinson wrote:

> Is it possible to remove the UndoAction and RedoAction from the context
> menu of a GEF Diagram editor?

> I've tried commenting out the following bit of code in createActions, but
> this results in the context menu not being displayed at all:

> // action = new UndoAction(this);
> // registry.registerAction(action);
> // getStackActions().add(action.getId());
> //
> // action = new RedoAction(this);
> // registry.registerAction(action);
> // getStackActions().add(action.getId());

> I also tried leaving the above code in then using removeAction, but this
> has the same effect - no context menu is displayed:

> action = registry.getAction ("redo");

> if (action != null)
> {
> registry.removeAction (action);
> }

> Thanks in advance,
> Mark Robinson
I've sorted this. I was adding the undo/redo menu items myself in a
ContextMenuProvider - oops !
Previous Topic:EllipseFigure
Next Topic:More sophisticated Layouts and Routers
Goto Forum:
  


Current Time: Fri Apr 19 09:35:51 GMT 2024

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

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

Back to the top