Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2004-02-18 19:45:50 +0000
committerDarin Swanson2004-02-18 19:45:50 +0000
commitaa01b61e35d8ee9a6a462eb68f768e40986816fd (patch)
treeff1815068500665eb533db52902924b7a9610aa7 /org.eclipse.ui.externaltools
parent96e187facbff2ed8a32ddef42d992282b046fe99 (diff)
downloadeclipse.platform.debug-aa01b61e35d8ee9a6a462eb68f768e40986816fd.tar.gz
eclipse.platform.debug-aa01b61e35d8ee9a6a462eb68f768e40986816fd.tar.xz
eclipse.platform.debug-aa01b61e35d8ee9a6a462eb68f768e40986816fd.zip
Bug 51101 - [Dialogs] New Builder Dialog should not come up w/ an error message
Diffstat (limited to 'org.eclipse.ui.externaltools')
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java
index eab9f039b..43be48d26 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
@@ -68,10 +68,12 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
protected class WidgetListener extends SelectionAdapter implements ModifyListener {
public void modifyText(ModifyEvent e) {
if (!fInitializing) {
+ setDirty(true);
updateLaunchConfigurationDialog();
}
}
public void widgetSelected(SelectionEvent e) {
+ setDirty(true);
Object source= e.getSource();
if (source == variableButton) {
StringVariableSelectionDialog dialog= new StringVariableSelectionDialog(getShell());
@@ -269,6 +271,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
updateWorkingDirectory(configuration);
updateArgument(configuration);
fInitializing= false;
+ setDirty(false);
}
protected void updateWorkingDirectory(ILaunchConfiguration configuration) {
@@ -340,7 +343,14 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
setMessage(null);
- return validateLocation() && validateWorkDirectory();
+ return canSave();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#canSave()
+ */
+ public boolean canSave() {
+ return validateLocation() && validateWorkDirectory() && isDirty();
}
/**
@@ -348,7 +358,8 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
*/
protected boolean validateLocation() {
String value = locationField.getText().trim();
- if (value.length() < 1) {
+
+ if (value.length() < 1 && isDirty()) {
setErrorMessage(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.External_tool_location_cannot_be_empty_18")); //$NON-NLS-1$
setMessage(null);
return false;
@@ -364,17 +375,19 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
File file = new File(location);
- if (!file.exists()) { // The file does not exist.
+ if (!file.exists() && isDirty()) { // The file does not exist.
setErrorMessage(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.External_tool_location_does_not_exist_19")); //$NON-NLS-1$
return false;
}
- if (!file.isFile()) {
+ if (!file.isFile() && isDirty()) {
setErrorMessage(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.External_tool_location_specified_is_not_a_file_20")); //$NON-NLS-1$
return false;
}
return true;
}
+
+
/**
* Returns the value of the given string with all variables substituted (if any).
*

Back to the top