import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext;
import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
config = wc.doSave();
config.launch(ILaunchManager.RUN_MODE, null);
} catch (CoreException e) {
+ alertDialog(executable);
}
}
-}
\ No newline at end of file
+
+ /**
+ * Shows an alert dialog with a warning message
+ *
+ * @param executable external tools command name
+ */
+ private static void alertDialog(String executable) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow();
+ MessageDialog.openWarning(window.getShell(), "Launch Error",
+ "Could not execute external app" + executable);
+ }
+}