Math2mat

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

Go to the documentation of this file.
00001 
00019 package m2m.frontend.actions;
00020 
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.UbiduleThread;
00027 
00028 public class LaunchUbiduleVerification extends M2MAction 
00029 {
00030 
00031 
00037         public LaunchUbiduleVerification(IWorkbenchWindow window, String label) 
00038         {
00039                 super(window,label);
00040                 setEnabled(true);
00041                 this.window = window;
00042                 setText(label);
00043                 
00044         // The id is used to refer to the action in a menu or toolbar
00045                 setId(ICommandIds.CMD_VERIFUBIDULE);
00046                 
00047         // Associate the action with a pre-defined command, to allow key bindings.
00048                 setActionDefinitionId(ICommandIds.CMD_VERIFUBIDULE);
00049         }
00050 
00051         
00055         public synchronized void run() 
00056         {       
00057                 if (!getEditor("Error","Select the tab with the code you want to transform in VHDL"))
00058                         return;
00059                 
00060 
00061                 boolean ubiduleOK=editor.getM2MProject().isUbiduleFilesUpToDate();
00062                 boolean octaveOK=editor.getM2MProject().isOctaveUpToDate();
00063                 boolean vhdlOK=editor.getM2MProject().isVHDLUpToDate();
00064                 if (!(octaveOK && vhdlOK && ubiduleOK)) {
00065                         MessageDialog.openError(window.getShell(), "Error", "Please generate VHDL, octave and ubidule files before launching the verification");
00066                         return;
00067                 }
00068                 if (!vhdlOK) {
00069                         MessageDialog.openError(window.getShell(), "Error", "Please generate VHDL files before launching the verification");
00070                         return;
00071                 }
00072                 if (!octaveOK) {
00073                         MessageDialog.openError(window.getShell(), "Error", "Please generate Octave files before launching the verification");
00074                         return;
00075                 }
00076                 if (!ubiduleOK) {
00077                         MessageDialog.openError(window.getShell(), "Error", "Please generate ubidules files before launching the verification");
00078                         return;
00079                 }
00080                 
00081                 activateConsole();
00082 
00083                 UbiduleThread thread = new UbiduleThread(editor);
00084                 thread.start();
00085         }
00086 }
 All Classes Namespaces Files Functions Variables Enumerations