diff options
author | Michael Rennie | 2008-02-11 17:35:57 +0000 |
---|---|---|
committer | Michael Rennie | 2008-02-11 17:35:57 +0000 |
commit | 4b77ceb6051f3f8daa57a8e2056608e22d4f9bd7 (patch) | |
tree | 9a45092975c315aa566b975a1868f0979a38f4f6 /org.eclipse.debug.ui | |
parent | bdea77250e3a2703d7edba5922dbdf337d19bd87 (diff) | |
download | eclipse.platform.debug-4b77ceb6051f3f8daa57a8e2056608e22d4f9bd7.tar.gz eclipse.platform.debug-4b77ceb6051f3f8daa57a8e2056608e22d4f9bd7.tar.xz eclipse.platform.debug-4b77ceb6051f3f8daa57a8e2056608e22d4f9bd7.zip |
Bug 218080
[breakpoints] No warning when using an inavlid path in breakpoint export dialog
Diffstat (limited to 'org.eclipse.debug.ui')
3 files changed, 15 insertions, 7 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties index 36791f95f..5b5e0cc95 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties @@ -20,6 +20,7 @@ WizardExportBreakpoints_0=Export Breakpoints WizardExportBreakpointsPage_0=Please specify a destination file. WizardExportBreakpointsPage_1=Select one or more breakpoints to export. WizardExportBreakpointsPage_2=&Breakpoints: +WizardExportBreakpointsPage_3=The destination directory does not exist. WizardBreakpointsPage_0=Breakpoint Files WizardBreakpointsPage_1=&Select All WizardBreakpointsPage_2=&Deselect All diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java index de307a3c3..fca8a91d8 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java @@ -49,5 +49,6 @@ public class ImportExportMessages extends NLS { public static String WizardExportBreakpointsPage_0; public static String WizardExportBreakpointsPage_1; public static String WizardExportBreakpointsPage_2; + public static String WizardExportBreakpointsPage_3; public static String WizardImportBreakpointsPage_6; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java index 81453c1d9..9f192a651 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 IBM Corporation and others. + * Copyright (c) 2006, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,7 +28,6 @@ import org.eclipse.debug.ui.DebugUITools; import org.eclipse.debug.ui.actions.ExportBreakpointsOperation; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.ICheckStateListener; @@ -190,7 +189,8 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener createDestinationGroup(composite); fOverwriteExistingFilesCheckbox = SWTFactory.createCheckButton(composite, ImportExportMessages.WizardBreakpointsPage_6, null, false, 1); setControl(composite); - setPageComplete(detectPageComplete()); + setPageComplete(false); + setMessage(ImportExportMessages.WizardBreakpointsPage_4); restoreWidgetState(); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.EXPORT_BREAKPOINTS_WIZARD_PAGE); @@ -226,16 +226,22 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener * @return if the prerequisites of the wizard are met to allow the wizard to complete. */ private boolean detectPageComplete() { - boolean emptyFile = fDestinationNameField.getText().trim().equals(IInternalDebugCoreConstants.EMPTY_STRING); - if (emptyFile) { - setMessage(ImportExportMessages.WizardExportBreakpointsPage_0, IMessageProvider.NONE); + String filepath = fDestinationNameField.getText().trim(); + if (filepath.equals(IInternalDebugCoreConstants.EMPTY_STRING)) { + setErrorMessage(ImportExportMessages.WizardExportBreakpointsPage_0); + return false; + } + IPath path = new Path(filepath); + if(!path.removeLastSegments(1).toFile().exists()) { + setErrorMessage(ImportExportMessages.WizardExportBreakpointsPage_3); return false; } int size = fTView.getCheckedElements().size(); if (size == 0) { - setMessage(ImportExportMessages.WizardExportBreakpointsPage_1, IMessageProvider.ERROR); + setErrorMessage(ImportExportMessages.WizardExportBreakpointsPage_1); return false; } + setErrorMessage(null); setMessage(ImportExportMessages.WizardBreakpointsPage_4); return true; } |