Math2mat
|
00001 00019 package m2m.frontend.actions; 00020 00021 import java.io.File; 00022 00023 import m2m.frontend.GUIProperties; 00024 import m2m.frontend.threads.ValidateProjectsThread; 00025 00026 import org.eclipse.swt.widgets.DirectoryDialog; 00027 import org.eclipse.ui.IWorkbenchWindow; 00028 00033 public class ValidateProjectsAction extends M2MAction { 00034 00035 public ValidateProjectsAction(IWorkbenchWindow window, String label) 00036 { 00037 super(window,label); 00038 00039 // The id is used to refer to the action in a menu or toolbar 00040 setId(ICommandIds.CMD_VALIDATEPROJECTS); 00041 00042 // Associate the action with a pre-defined command, to allow key bindings. 00043 setActionDefinitionId(ICommandIds.CMD_VALIDATEPROJECTS); 00044 } 00045 00049 public synchronized void run() 00050 { 00051 DirectoryDialog dlg=new DirectoryDialog(window.getShell()); 00052 00053 dlg.setFilterPath(GUIProperties.getReference().getValidateDir()); 00054 String path=dlg.open(); 00055 File file=new File(path); 00056 if (!file.isDirectory()) 00057 return; 00058 00059 GUIProperties.getReference().setValidateDir(path); 00060 GUIProperties.getReference().writeSettings(); 00061 00062 activateConsole(); 00063 00064 /* Launch the thread */ 00065 ValidateProjectsThread thread = new ValidateProjectsThread(path); 00066 thread.start(); 00067 } 00068 }