|
|
|
|
|
|
|
|
|
|
Re: Disabling Undo [message #1259377 is a reply to message #1258649] |
Fri, 28 February 2014 10:10 |
Surya Kathayat Messages: 44 Registered: July 2012 |
Member |
|
|
Hi Michael,
I need to disable "undo and redo" context menus from diagram editor.
I tried the following two methods, and does not work in my case.
1. As mentioned in this tread, my features implement ICustomUndoableFeature, and canUndo() and canRedo() methods return false. Still, I can see Undo and Redo menus enabled in the diagram context menu!!
public class TaskMoveFeature extends DefaultMoveShapeFeature implements ICustomUndoableFeature {
@Override
public boolean canUndo(IContext context) {
return false;
}
@Override
public boolean canRedo(IContext context) {
return false;
}
2. I also tried to extend DiagramEditorContextMenuProvider and override addDefaultMenuGroupUndo method, which infact does nothing.
public class IdmTaskFlowEditorContextMenuProvider extends DiagramEditorContextMenuProvider {
public IdmTaskFlowEditorContextMenuProvider(EditPartViewer viewer,
ActionRegistry registry,
IConfigurationProvider configurationProvider) {
super(viewer, registry, configurationProvider);
}
@Override
protected void addDefaultMenuGroupUndo(IMenuManager manager) {
// do nothing
}
}
I am not sure if this will work but I tried to set the context menu from configureGraphicalViewer method of IdmDiagramEditor(extends DiagramEditor) as below, but how can I get IConfigurationProvider in parameter 3.
@Override
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
...
getGraphicalViewer().setContextMenu(new IdmTaskFlowEditorContextMenuProvider(getGraphicalViewer(),
getActionRegistry(), ???));
Any workaround will be appreciated.
Regards
Surya
[Updated on: Fri, 28 February 2014 12:55] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05396 seconds