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