Math2mat
|
00001 00020 package m2m.frontend.actions; 00021 00022 import org.eclipse.jface.dialogs.MessageDialog; 00023 import org.eclipse.ui.IWorkbenchWindow; 00024 00025 import m2m.frontend.actions.M2MAction; 00026 import m2m.frontend.threads.*; 00027 00028 00029 public class LaunchOctaveWithRegeneratedFileAction extends M2MAction { 00030 00031 public LaunchOctaveWithRegeneratedFileAction(IWorkbenchWindow window, String label) 00032 { 00033 super(window,label); 00034 00035 // The id is used to refer to the action in a menu or toolbar 00036 setId(ICommandIds.CMD_OCTAVEREGEN); 00037 00038 // Associate the action with a pre-defined command, to allow key bindings. 00039 setActionDefinitionId(ICommandIds.CMD_OCTAVEREGEN); 00040 } 00041 00045 public void run() 00046 { 00047 00048 if (!getEditor("Error","Select the tab with the code you want to transform in VHDL")) 00049 return; 00050 00051 if (editor.getParseDone()) 00052 { 00053 activateConsole(); 00054 00055 /* Launch the octaveThread */ 00056 OctaveThread octaveThread = new OctaveThread(editor, true); 00057 octaveThread.start(); 00058 00059 00060 } 00061 else 00062 MessageDialog.openError(window.getShell(), "Parsing error", "Parse the file to get inputs and outputs before trying to launch Octave"); 00063 } 00064 }