Math2mat
|
00001 00019 package m2m.frontend.actions; 00020 00021 import m2m.frontend.threads.XilinxThread; 00022 00023 import org.eclipse.jface.dialogs.MessageDialog; 00024 import org.eclipse.ui.IWorkbenchWindow; 00025 00030 public class LaunchXilinxUbiduleAction extends M2MAction { 00031 00032 00038 public LaunchXilinxUbiduleAction(IWorkbenchWindow window, String label) 00039 { 00040 super(window,label); 00041 setEnabled(true); 00042 this.window = window; 00043 setText(label); 00044 // setImageDescriptor(m2m.frontend.Activator.getImageDescriptor("/icons/verif_ubidule.png")); 00045 00046 // The id is used to refer to the action in a menu or toolbar 00047 setId(ICommandIds.CMD_XILINXUBIDULE); 00048 00049 // Associate the action with a pre-defined command, to allow key bindings. 00050 setActionDefinitionId(ICommandIds.CMD_XILINXUBIDULE); 00051 } 00052 00053 00057 public synchronized void run() 00058 { 00059 if (!getEditor("Error","Select the tab with the code you want to transform in VHDL")) 00060 return; 00061 00062 00063 boolean vhdlOK=editor.getM2MProject().isVHDLUpToDate(); 00064 if (!vhdlOK) { 00065 MessageDialog.openError(window.getShell(), "Error", "Please generate VHDL files before launching the verification"); 00066 return; 00067 } 00068 00069 activateConsole(); 00070 00071 /* Launch the thread */ 00072 XilinxThread thread = new XilinxThread(editor); 00073 thread.start(); 00074 } 00075 }