]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/action/vtkAction.java
Disable DB level undo, when model modifying actions are active
[simantics/3d.git] / org.simantics.g3d.vtk / src / org / simantics / g3d / vtk / action / vtkAction.java
1 package org.simantics.g3d.vtk.action;
2
3 import org.eclipse.core.commands.Command;
4 import org.eclipse.core.commands.State;
5 import org.eclipse.jface.action.Action;
6 import org.eclipse.ui.PlatformUI;
7 import org.eclipse.ui.commands.ICommandService;
8 import org.simantics.ui.states.TrackedTextState;
9
10 public abstract class vtkAction extends Action{
11
12         public abstract void attach();
13         public abstract void deattach();
14         
15         
16         protected void setDBUndo(boolean enabled) {
17             ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
18         Command command = service.getCommand( TrackedTextState.COMMAND_ID );
19         State state = command.getState( TrackedTextState.STATE_ID );
20         state.setValue(enabled);
21         }
22  }