Skip to content

Commit c22c323

Browse files
committed
make search dialog modeless
1 parent c1cf342 commit c22c323

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
*******************************************************************************/
1414
package org.eclipse.search.internal.ui;
1515

16+
import org.eclipse.swt.widgets.Shell;
17+
1618
import org.eclipse.jface.action.Action;
1719
import org.eclipse.jface.action.IAction;
1820
import org.eclipse.jface.viewers.ISelection;
@@ -27,7 +29,7 @@ public class OpenSearchDialogAction extends Action implements IWorkbenchWindowAc
2729

2830
private IWorkbenchWindow fWindow;
2931
private String fPageId;
30-
32+
private static SearchDialog dialog;
3133
public OpenSearchDialogAction() {
3234
super(SearchMessages.OpenSearchDialogAction_label);
3335
SearchPluginImages.setImageDescriptors(this, SearchPluginImages.T_TOOL, SearchPluginImages.IMG_TOOL_SEARCH);
@@ -56,7 +58,15 @@ public void run() {
5658
SearchPlugin.beep();
5759
return;
5860
}
59-
SearchDialog dialog= new SearchDialog(getWorkbenchWindow(), fPageId);
61+
if (dialog != null) {
62+
Shell shell = dialog.getShell();
63+
if (shell != null) {
64+
shell.setFocus();
65+
shell.getDisplay().beep();
66+
return;
67+
}
68+
}
69+
dialog = new SearchDialog(getWorkbenchWindow(), fPageId);
6070
dialog.open();
6171
}
6272

bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ public SearchDialog(IWorkbenchWindow window, String pageId) {
174174

175175
fPageChangeListeners= null;
176176
setUseEmbeddedProgressMonitorPart(false);
177+
setShellStyle(getShellStyle() ^ SWT.APPLICATION_MODAL | SWT.MODELESS);
178+
setBlockOnOpen(false);
177179
}
178180

179181
public static String evaluateEnclosingProject(IAdaptable adaptable) {

0 commit comments

Comments
 (0)