Math2mat

/home/ythoma/docs/math2mat/svn/wp1/framework/m2mGUI/src/m2m/frontend/actions/UndoAction.java

Go to the documentation of this file.
00001 
00020 package m2m.frontend.actions;
00021 
00022 import org.eclipse.ui.IWorkbenchWindow;
00023 import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
00024 
00025 public class UndoAction extends M2MAction implements IWorkbenchAction {
00026 
00027         public UndoAction(IWorkbenchWindow window, String label) {
00028                 super(window,label);
00029         // The id is used to refer to the action in a menu or toolbar
00030                 setId(ICommandIds.CMD_UNDO);
00031         // Associate the action with a pre-defined command, to allow key bindings.
00032                 setActionDefinitionId(ICommandIds.CMD_UNDO);
00033                 setImageDescriptor(m2m.frontend.Activator.getImageDescriptor("/icons/Undo.png"));
00034         }
00035 
00039         public void run(){
00040                 if (!getEditor("Error","Select a correct M2M editor"))
00041                         return;
00042                 editor.undo();
00043         }
00044         
00045         public void setEnable(boolean enable) {
00046                 this.setEnable(enable);
00047         }
00048 
00049         @Override
00050         public void dispose() {
00051                 // TODO Auto-generated method stub
00052                 
00053         }
00054 }
 All Classes Namespaces Files Functions Variables Enumerations