Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2004-05-14 17:42:19 -0400
committerDarin Wright2004-05-14 17:42:19 -0400
commit975c2db9bf18c03378ef1cd6e74ea1be2985ea2e (patch)
tree472bbe2e06edf6e3bb1cc145102cb1e436044cff
parent31a94b1ddb307efb29f4eb8d1a17ecc95fa4b7a6 (diff)
downloadeclipse.platform.debug-975c2db9bf18c03378ef1cd6e74ea1be2985ea2e.tar.gz
eclipse.platform.debug-975c2db9bf18c03378ef1cd6e74ea1be2985ea2e.tar.xz
eclipse.platform.debug-975c2db9bf18c03378ef1cd6e74ea1be2985ea2e.zip
Bug 61412 - Source lookup tab causes config to need saving
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java
index dc9399da6..d1a953044 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java
@@ -21,8 +21,10 @@ import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
import org.eclipse.debug.core.sourcelookup.ISourceContainer;
import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
+import org.eclipse.debug.core.sourcelookup.containers.DefaultSourceContainer;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.debug.ui.sourcelookup.WorkingSetSourceContainer;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -356,8 +358,13 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
//writing to the file will cause a change event and the listeners will be updated
try{
- workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, fLocator.getMemento());
- workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, fLocator.getId());
+ if (isDefault(workingCopy)) {
+ workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
+ workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
+ } else {
+ workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, fLocator.getMemento());
+ workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, fLocator.getId());
+ }
if(configuration == null)
workingCopy.doSave();
setDirty(false);
@@ -369,6 +376,11 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
}
}
+ protected boolean isDefault(ILaunchConfiguration configuration) {
+ ISourceContainer[] current = getEntries();
+ return current.length == 1 && current[0] instanceof DefaultSourceContainer;
+ }
+
/**
* Returns the entries visible in the viewer
*/

Back to the top