]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SCLEditorBaseUndoHandler.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / componentTypeEditor / SCLEditorBaseUndoHandler.java
1 package org.simantics.modeling.ui.componentTypeEditor;\r
2 \r
3 import org.eclipse.core.commands.AbstractHandler;\r
4 import org.eclipse.core.commands.ExecutionEvent;\r
5 import org.eclipse.core.commands.ExecutionException;\r
6 import org.eclipse.ui.PlatformUI;\r
7 \r
8 public class SCLEditorBaseUndoHandler extends AbstractHandler {\r
9 \r
10     @Override\r
11     public Object execute(ExecutionEvent event) throws ExecutionException {\r
12         String id = event.getCommand().getId();\r
13         SCLEditorBase editor = (SCLEditorBase)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();\r
14         if(id.equals("org.eclipse.ui.edit.undo")) {\r
15             editor.editor.getUndoManager().undo();\r
16         }\r
17         else {\r
18             editor.editor.getUndoManager().redo();\r
19         }\r
20         return null;\r
21     }\r
22 \r
23 }\r