Math2mat
|
00001 00020 package m2m.frontend.actions; 00021 00022 import org.eclipse.ui.IWorkbenchWindow; 00023 00024 import m2m.frontend.ErrorProcessing; 00025 import m2m.frontend.actions.M2MAction; 00026 00027 public class GenerateVHDL extends M2MAction { 00028 00029 public GenerateVHDL(IWorkbenchWindow window, String label) { 00030 super(window,label); 00031 // The id is used to refer to the action in a menu or toolbar 00032 setId(ICommandIds.CMD_VHDLGEN); 00033 // Associate the action with a pre-defined command, to allow key bindings. 00034 setActionDefinitionId(ICommandIds.CMD_VHDLGEN); 00035 setImageDescriptor(m2m.frontend.Activator.getImageDescriptor("/icons/VHDL.gif")); 00036 } 00037 00041 public void run() { 00042 00043 if (!getEditor("Error","Select the tab with the code you want to transform in VHDL")) 00044 return; 00045 activateConsole(); 00046 00047 editor.getM2MProject().checkFolders(); 00048 00049 if (!editor.getM2MProject().generateVHDL()) { 00050 ErrorProcessing.displayError(window.getShell().getDisplay(),"VHDL files could not be created. Please check the Math2mat library location with the menu Configure...External tools."); 00051 } 00052 } 00053 }