org.simantics.g3d.ontology;bundle-version="1.0.0",
vtk;bundle-version="5.10.0",
org.simantics.utils.ui;bundle-version="1.1.0",
+ org.simantics.ui;bundle-version="1.0.0",
vtk.rendering;bundle-version="8.2.0",
org.simantics.utils.thread.swt;bundle-version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
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);
+ }
+ }
if (toolComposite != null) {
createTools(toolComposite);
}
-
+ setDBUndo(false);
super.attach();
ThreadUtils.asyncExec(panel.getThreadQueue(), new Runnable() {
public void run() {
toolComposite.clear();
axisCombo = null;
}
-
+ setDBUndo(true);
node = null;
nodeMap.commit("Translate");
deattachUI();
public void deattach() {
deactivate();
+ setDBUndo(true);
if (toolComposite != null) {
toolComposite.clear();
axisCombo = null;
if (toolComposite != null) {
createTools(toolComposite);
}
+ setDBUndo(false);
super.attach();
ThreadUtils.asyncExec(panel.getThreadQueue(), new Runnable() {
public void run() {