X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d.vtk%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fvtk%2Faction%2FvtkAction.java;h=da9088049bcefd98f2a80458136b1efe4172e2f8;hb=b6de12aa6ceb6d0a77264ee7a1b2e01f3138411c;hp=01327c519cc577fdbb533992a13585c1bd959144;hpb=84132a1d750c45f9161afbd58b78572964e50d26;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); + } + }