Math2mat

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

Go to the documentation of this file.
00001 
00019 package m2m.frontend.actions;
00020 
00021 
00022 import m2m.frontend.threads.RunAllUbiduleThread;
00023 
00024 import org.eclipse.jface.dialogs.MessageDialog;
00025 import org.eclipse.ui.IWorkbenchWindow;
00026 
00031 public class LaunchRunAllUbiduleAction extends M2MAction {
00032 
00033 
00039         public LaunchRunAllUbiduleAction(IWorkbenchWindow window, String label) 
00040         {
00041                 super(window,label);
00042                 setEnabled(true);
00043                 this.window = window;
00044                 setText(label);
00045                 setImageDescriptor(m2m.frontend.Activator.getImageDescriptor("/icons/verif_ubidule.png"));
00046                 
00047         // The id is used to refer to the action in a menu or toolbar
00048                 setId(ICommandIds.CMD_RUNALLUBIDULE);
00049                 
00050         // Associate the action with a pre-defined command, to allow key bindings.
00051                 setActionDefinitionId(ICommandIds.CMD_RUNALLUBIDULE);
00052         }
00053 
00054         
00058         public synchronized void run() 
00059         {       
00060                 if (!getEditor("Error","Select the tab with the code you want to transform in VHDL"))
00061                         return;
00062 
00063                 boolean octaveOK=editor.getM2MProject().isOctaveUpToDate();
00064                 boolean vhdlOK=editor.getM2MProject().isVHDLUpToDate();
00065                 if (!(octaveOK && vhdlOK)) {
00066                         MessageDialog.openError(window.getShell(), "Error", "Please generate VHDL and octave files before launch verification");
00067                         return;
00068                 }
00069                 if (!vhdlOK) {
00070                         MessageDialog.openError(window.getShell(), "Error", "Please generate VHDL files before launch verification");
00071                         return;
00072                 }
00073                 if (!octaveOK) {
00074                         MessageDialog.openError(window.getShell(), "Error", "Please generate Octave files before launch verification");
00075                         return;
00076                 }
00077                 
00078         activateConsole();
00079 
00080 
00081         RunAllUbiduleThread thread = new RunAllUbiduleThread(editor);
00082                 thread.start();
00083                         
00084         }
00085 }
 All Classes Namespaces Files Functions Variables Enumerations