1 11 package org.eclipse.pde.internal.ui.search; 12 13 import org.eclipse.jface.action.IAction; 14 import org.eclipse.jface.viewers.ISelection; 15 import org.eclipse.pde.internal.ui.PDEPlugin; 16 import org.eclipse.search.ui.NewSearchUI; 17 import org.eclipse.swt.widgets.Shell; 18 import org.eclipse.ui.IWorkbenchWindow; 19 import org.eclipse.ui.IWorkbenchWindowActionDelegate; 20 21 public class OpenPluginSearchPageAction implements 22 IWorkbenchWindowActionDelegate { 23 24 private static final String PLUGIN_SEARCH_PAGE_ID = "org.eclipse.pde.internal.ui.search.SearchPage"; private IWorkbenchWindow fWindow; 26 27 public void dispose() { 28 fWindow = null; 29 } 30 31 public void init(IWorkbenchWindow window) { 32 fWindow = window; 33 } 34 35 public void run(IAction action) { 36 if (fWindow == null || fWindow.getActivePage() == null) { 37 beep(); 38 return; 39 } 40 NewSearchUI.openSearchDialog(fWindow, PLUGIN_SEARCH_PAGE_ID); 41 } 42 43 public void selectionChanged(IAction action, ISelection selection) { 44 } 46 47 protected void beep() { 48 Shell shell= PDEPlugin.getActiveWorkbenchShell(); 49 if (shell != null && shell.getDisplay() != null) 50 shell.getDisplay().beep(); 51 } 52 53 } 54 | Popular Tags |