Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjszursze2002-04-04 21:38:22 +0000
committerjszursze2002-04-04 21:38:22 +0000
commita9f4850d3a59d8388e1f29cadf00804019bc9111 (patch)
treefffc6278b88e00fd26152da140271ddb65e5e5ca
parent6ce866e6b1baf1e8b40824c7b7fce6e4f7778a0e (diff)
downloadeclipse.platform.debug-a9f4850d3a59d8388e1f29cadf00804019bc9111.tar.gz
eclipse.platform.debug-a9f4850d3a59d8388e1f29cadf00804019bc9111.tar.xz
eclipse.platform.debug-a9f4850d3a59d8388e1f29cadf00804019bc9111.zip
fix for #12793
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java25
1 files changed, 8 insertions, 17 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
index ee1e06d86..52fc54b7f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
@@ -1068,7 +1068,7 @@ public class LaunchConfigurationDialog extends TitleAreaDialog
// Take care of any unsaved changes. If the user aborts, reset selection
// to whatever it was previously selected
- boolean canReplaceConfig = canReplaceWorkingCopy();
+ boolean canReplaceConfig = confirmWorkingCopyNotDirty();
if (!canReplaceConfig) {
StructuredSelection prevSelection;
Object selectedTreeObject = getSelectedTreeObject();
@@ -1481,9 +1481,10 @@ public class LaunchConfigurationDialog extends TitleAreaDialog
}
/**
- * Return whether the current working copy can be replaced with a new working copy.
+ * Return whether the current working copy exists and isn't dirty. If it is dirty,
+ * ask the user whether to save changes.
*/
- protected boolean canReplaceWorkingCopy() {
+ protected boolean confirmWorkingCopyNotDirty() {
// If there is no working copy, there's no problem, return true
ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfiguration();
@@ -1491,20 +1492,10 @@ public class LaunchConfigurationDialog extends TitleAreaDialog
return true;
}
- // If the working copy doesn't verify, show user dialog asking if they wish
- // to discard their changes. Otherwise, if the working copy is dirty,
- // show a slightly different 'save changes' dialog.
- if (!canLaunch()) {
- StringBuffer buffer = new StringBuffer("The configuration \"");
- buffer.append(getLaunchConfiguration().getName());
- buffer.append("\" CANNOT be saved. Do you wish to discard changes?");
- return MessageDialog.openQuestion(getShell(), "Discard changes?", buffer.toString());
+ if (isWorkingCopyDirty()) {
+ return showSaveChangesDialog();
} else {
- if (isWorkingCopyDirty()) {
- return showSaveChangesDialog();
- } else {
- return true;
- }
+ return true;
}
}
@@ -1544,7 +1535,7 @@ public class LaunchConfigurationDialog extends TitleAreaDialog
protected void handleNewPressed() {
// Take care of any unsaved changes
- if (!canReplaceWorkingCopy()) {
+ if (!confirmWorkingCopyNotDirty()) {
return;
}

Back to the top