Skip to content

Commit

Permalink
make search dialog modeless
Browse files Browse the repository at this point in the history
  • Loading branch information
elsazac committed Jan 25, 2024
1 parent c1cf342 commit c22c323
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c22c323

Please sign in to comment.