Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I don't know what effect this call will have. I tested with true and false but didn't see any visible difference (I largely derived this logic from FindReplaceDialog). I thought I will ask here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "blockOnOpen" property sets whether the method that opens the dialog expects the dialog to block execution until the dialog was closed or whether the opening method does not expect that

http://www.java2s.com/example/java-api/org/eclipse/jface/dialogs/dialog/setblockonopen-1-0.html

}

public static String evaluateEnclosingProject(IAdaptable adaptable) {
Expand Down