01: /*
02: * Created on Jun 19, 2004
03: */
04: package net.charabia.jsmoothgen.application.swtgui;
05:
06: import org.eclipse.swt.SWT;
07: import org.eclipse.swt.widgets.FileDialog;
08:
09: public class OpenAction extends JSmoothAction {
10:
11: public OpenAction(JSmoothApplication js) {
12: super (js);
13: }
14:
15: public boolean run() {
16: FileDialog dialog = new FileDialog(getApplication().getShell(),
17: SWT.OPEN);
18: dialog.setText("Open Project");
19: String file = dialog.open();
20: if (file != null) {
21: boolean ok = getApplication().openProject(file);
22: if (ok)
23: getApplication().consoleMessage(
24: "Opened the project file " + file);
25: return ok;
26: } else {
27: return false;
28: }
29: }
30: }
|