diff --git a/bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java b/bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java index 2b8a9e34a37..bc056516ff2 100644 --- a/bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java +++ b/bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java @@ -13,6 +13,8 @@ *******************************************************************************/ package org.eclipse.search.internal.ui; +import org.eclipse.swt.widgets.Shell; + import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; @@ -27,7 +29,7 @@ public class OpenSearchDialogAction extends Action implements IWorkbenchWindowAc private IWorkbenchWindow fWindow; private String fPageId; - + private static SearchDialog dialog; public OpenSearchDialogAction() { super(SearchMessages.OpenSearchDialogAction_label); SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_TOOL, SearchPluginImages.IMG_TOOL_SEARCH); @@ -56,7 +58,15 @@ public void run() { SearchPlugin.beep(); return; } - SearchDialog dialog= new SearchDialog(getWorkbenchWindow(), fPageId); + if (dialog != null) { + Shell shell = dialog.getShell(); + if (shell != null) { + shell.setFocus(); + shell.getDisplay().beep(); + return; + } + } + dialog = new SearchDialog(getWorkbenchWindow(), fPageId); dialog.open(); } diff --git a/bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java b/bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java index f00afb61d4b..937c29f0339 100644 --- a/bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java +++ b/bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java @@ -174,6 +174,8 @@ public SearchDialog(IWorkbenchWindow window, String pageId) { fPageChangeListeners= null; setUseEmbeddedProgressMonitorPart(false); + setShellStyle(getShellStyle() ^ SWT.APPLICATION_MODAL | SWT.MODELESS); + setBlockOnOpen(false); } public static String evaluateEnclosingProject(IAdaptable adaptable) {