X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.g3d.vtk%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fvtk%2Faction%2FvtkAction.java;fp=org.simantics.g3d.vtk%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fvtk%2Faction%2FvtkAction.java;h=da9088049bcefd98f2a80458136b1efe4172e2f8;hb=0a4af0014e06aa2f295bed0b4ab94c3a2bab37f3;hp=01327c519cc577fdbb533992a13585c1bd959144;hpb=aca223a1616159645710d7c9ee67ed1a6bd47b99;p=simantics%2F3d.git diff --git a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/action/vtkAction.java b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/action/vtkAction.java index 01327c51..da908804 100644 --- a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/action/vtkAction.java +++ b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/action/vtkAction.java @@ -1,9 +1,22 @@ 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); + } + }