Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2016-11-15 15:49:18 -0500
committerLars Vogel2016-11-15 15:51:14 -0500
commit472c98851d01b36a7c0d02726019bf98849fc522 (patch)
treebd3dac6f8328e9c636a13237bc53c6531b1bb9fb
parentb6b48fbb1efc77cea2fb11a8db30a87849965a8a (diff)
downloadeclipse.platform.text-472c98851d01b36a7c0d02726019bf98849fc522.tar.gz
eclipse.platform.text-472c98851d01b36a7c0d02726019bf98849fc522.tar.xz
eclipse.platform.text-472c98851d01b36a7c0d02726019bf98849fc522.zip
Bug 507400 - Search dialog should not be modalY20161117-1000I20161117-2000I20161116-2000
This make the search dialog non-blocking anymore, so that the user can still select text from the editor, even if the dialog is open. Opening multiple times the dialog is not possible due to a check in the related action. Change-Id: Ic4ae870a3097e8f16aba708f138c2e05fe1d8cc2 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java14
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java2
2 files changed, 16 insertions, 0 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java
index bc93e11ef..90aa71ded 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.search.internal.ui;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
@@ -53,6 +56,17 @@ public class OpenSearchDialogAction extends Action implements IWorkbenchWindowAc
SearchPlugin.beep();
return;
}
+ // search dialog already open?
+ Shell[] shells = Display.getCurrent().getShells();
+ for (Shell shell : shells) {
+ Object data = shell.getData();
+ if (data instanceof SearchDialog) {
+ shell.setActive();
+ shell.setFocus();
+ return;
+ }
+ }
+
SearchDialog dialog= new SearchDialog(getWorkbenchWindow(), fPageId);
dialog.open();
}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java
index fcd9e9756..c01c02831 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java
@@ -160,6 +160,8 @@ public class SearchDialog extends ExtendedDialogWindow implements ISearchPageCon
public SearchDialog(IWorkbenchWindow window, String pageId) {
super(window.getShell());
+ setShellStyle(SWT.RESIZE | SWT.CLOSE | SWT.MODELESS | SWT.BORDER | SWT.TITLE);
+ setBlockOnOpen(false);
fWorkbenchWindow= window;
fCurrentSelection= window.getSelectionService().getSelection();
fCurrentEnclosingProject= evaluateEnclosingProject(fCurrentSelection, getActiveEditor());

Back to the top