From 36c39970b99f3d0b0c88e93f71f9d4732aec6f6d Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Thu, 1 Mar 2007 13:30:35 +0000 Subject: [PATCH] Report problems when adding the executable to the project. --- .../AbstractImportExecutableWizard.java | 10 ++++++++-- .../cdt/debug/ui/importexecutable/Messages.java | 2 ++ .../cdt/debug/ui/importexecutable/messages.properties | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/AbstractImportExecutableWizard.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/AbstractImportExecutableWizard.java index 46fbe6580a8..f7401b62333 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/AbstractImportExecutableWizard.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/AbstractImportExecutableWizard.java @@ -107,7 +107,7 @@ public abstract class AbstractImportExecutableWizard extends Wizard implements I * project receiving the executables * @throws CoreException */ - private void addExecutables(ICProject project) throws CoreException { + private void addExecutables(ICProject project) { String[] executables = pageOne.getSelectedExecutables(); @@ -116,7 +116,13 @@ public abstract class AbstractImportExecutableWizard extends Wizard implements I String executableName = location.toFile().getName(); IFile exeFile = project.getProject().getFile(executableName); if (!exeFile.exists()) - exeFile.createLink(location, 0, null); + { + try { + exeFile.createLink(location, 0, null); + } catch (Exception e) { + this.getImportExecutablePage2().setErrorMessage("Error importing: " + executables[i]); + } + } } } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/Messages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/Messages.java index 4140b156359..8ee88278f08 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/Messages.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/Messages.java @@ -24,6 +24,8 @@ public class Messages extends NLS { NLS.initializeMessages(BUNDLE_NAME, Messages.class); } + public static String AbstractImportExecutableWizard_ErrorImporting; + public static String ImportExecutableWizard_pageOneTitle; public static String ImportExecutableWizard_pageOneDescription; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/messages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/messages.properties index 042ee663fb3..f4bfbf28baf 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/messages.properties +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/importexecutable/messages.properties @@ -41,4 +41,5 @@ ImportExecutablePageOne_NoteAnEXE=Not an executable file. ImportExecutablePageOne_SelectAll=Select All ImportExecutablePageOne_Searching=Searching: AbstractImportExecutableWizard_windowTitle=Import Executable +AbstractImportExecutableWizard_ErrorImporting=Error importing: AbstractImportExecutableWizard_CreateLaunchConfiguration=Create Launch Configuration