From 8556e240ae1a3941e0af6b0ee7d1a8b118faa40c Mon Sep 17 00:00:00 2001 From: scorphus Date: Fri, 18 Jan 2008 01:39:49 +0000 Subject: [PATCH] ed_mann's fix for ticket #322 --- .../launchConfigurations/ExternalToolsUtil.java | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsUtil.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsUtil.java index 3d4a295..50fd0c0 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsUtil.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsUtil.java @@ -23,6 +23,9 @@ import net.sourceforge.phpdt.externaltools.model.ToolUtil; 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; @@ -427,7 +430,20 @@ public class ExternalToolsUtil { 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); + } +} -- 1.7.1