01: /*
02: * Created on Jun 19, 2004
03: */
04: package net.charabia.jsmoothgen.application.swtgui;
05:
06: import java.io.File;
07:
08: import org.eclipse.swt.program.Program;
09:
10: import net.charabia.jsmoothgen.application.JSmoothModelBean;
11:
12: public class RunexeAction extends JSmoothAction {
13:
14: public RunexeAction(JSmoothApplication js) {
15: super (js);
16: }
17:
18: public boolean run() {
19: System.out.println("[DEBUG] Running exe...");
20: JSmoothApplication app = getApplication();
21: if (!app.hasProjectFile()) {
22: app
23: .consoleMessage("Cannot run without a project file. Please save the project or load a new one, then try again.");
24: return false;
25: }
26:
27: JSmoothModelBean jsmodel = app.getModelBean();
28: String basedir = app.getProjectFile().getParent();
29: File exe = new File(basedir, jsmodel.getExecutableName());
30: app.consoleMessage("Running exe " + exe.getAbsolutePath());
31: return Program.launch(exe.getAbsolutePath());
32: }
33: }
|