Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java13
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java2
2 files changed, 11 insertions, 4 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java
index dd2dc2c21e0..ae89b6700e8 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java
@@ -264,9 +264,16 @@ public class ScopePart {
if (fWorkingSet != null)
dialog.setInitialSelections(new IWorkingSet[] {fWorkingSet});
if (dialog.open() == dialog.OK) {
- IWorkingSet workingSet= (IWorkingSet)dialog.getResult()[0];
- setSelectedWorkingSet(workingSet);
- return true;
+ Object[] result= dialog.getResult();
+ if (result.length == 1) {
+ setSelectedWorkingSet((IWorkingSet)result[0]);
+ return true;
+ }
+ fWorkingSetText.setText(""); //$NON-NLS-1$
+ fWorkingSet= null;
+ if (fScope == WORKING_SET_SCOPE)
+ setSelectedScope(WORKSPACE_SCOPE);
+ return false;
} else {
// test if selected working set has been removed
if (!Arrays.asList(SearchUI.getWorkingSets()).contains(fWorkingSet)) {
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java
index 5ae4432729c..a78728dced0 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/workingsets/WorkingSetSelectionDialog.java
@@ -224,7 +224,7 @@ public class WorkingSetSelectionDialog extends SelectionDialog {
if (hasSelection && selection instanceof IStructuredSelection)
hasSingleSelection= ((IStructuredSelection)selection).size() == 1;
fDetailsButton.setEnabled(hasSingleSelection);
- getOkButton().setEnabled(hasSingleSelection);
+ getOkButton().setEnabled(hasSingleSelection || !hasSelection);
}
private void removeSelectedWorkingSets() {

Back to the top