Math2mat
|
00001 00020 package m2m.frontend.actions; 00021 00022 import org.eclipse.ui.IWorkbenchWindow; 00023 00024 public class SaveFileAction extends M2MAction { 00025 00026 public SaveFileAction(IWorkbenchWindow window, String label) { 00027 super(window,label); 00028 setImageDescriptor(m2m.frontend.Activator.getImageDescriptor("/icons/save.gif")); 00029 00030 // The id is used to refer to the action in a menu or toolbar 00031 setId(ICommandIds.CMD_SAVE); 00032 00033 // Associate the action with a pre-defined command, to allow key bindings. 00034 setActionDefinitionId(ICommandIds.CMD_SAVE); 00035 } 00036 00040 public void run() { 00041 if (!getEditor("Error","Select a correct M2M editor")) 00042 return; 00043 editor.doSave(); 00044 } 00045 }