package org.simantics.g3d.vtk.action;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.State;
import org.eclipse.jface.action.Action;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.simantics.ui.states.TrackedTextState;
public abstract class vtkAction extends Action{
public abstract void attach();
public abstract void deattach();
-}
+
+
+ protected void setDBUndo(boolean enabled) {
+ ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
+ Command command = service.getCommand( TrackedTextState.COMMAND_ID );
+ State state = command.getState( TrackedTextState.STATE_ID );
+ state.setValue(enabled);
+ }
+ }