Math2mat
|
00001 00018 package m2m.frontend.actions; 00019 00020 00021 import org.eclipse.jface.dialogs.MessageDialog; 00022 import org.eclipse.ui.IWorkbenchWindow; 00023 00024 import m2m.frontend.actions.M2MAction; 00025 00026 00027 public class ReOpenFile extends M2MAction 00028 { 00032 private String path; 00033 00034 00039 public ReOpenFile(IWorkbenchWindow window, String value) 00040 { 00041 super(window,value); 00042 setId(ICommandIds.CMD_REOPEN); 00043 setActionDefinitionId(ICommandIds.CMD_REOPEN); 00044 path = value; 00045 } 00046 00050 public void run() 00051 { 00052 if (!OpenFileAction.openFile(path)) 00053 MessageDialog.openError(window.getShell(), "File error", "File project is corrupted\nThe source file path does not refer to a file"); 00054 } 00055 00060 public void setPath(String path) { 00061 this.path = path; 00062 setText(path); 00063 } 00064 00065 00070 public String getPath() { 00071 return path; 00072 } 00073 }