@Override public boolean performAction() { try { NewSearchUI.runQueryInBackground(newQuery()); } catch (CoreException e) { ErrorDialog.openError( getShell(), SearchMessages.TextSearchPage_replace_searchproblems_title, SearchMessages.TextSearchPage_replace_searchproblems_message, e.getStatus()); return false; } return true; }
/* @Override */ public boolean performReplace() { try { IStatus status = NewSearchUI.runQueryInForeground(getContainer().getRunnableContext(), newQuery()); if (status.matches(IStatus.CANCEL)) { return false; } if (!status.isOK()) { ErrorDialog.openError( getShell(), SearchMessages.TextSearchPage_replace_searchproblems_title, SearchMessages.TextSearchPage_replace_runproblem_message, status); } Display.getCurrent() .asyncExec( new Runnable() { @Override public void run() { /* ISearchResultViewPart view = */ NewSearchUI.activateSearchResultView(); // refactoring support // if (view != null) { // ISearchResultPage page = view.getActivePage(); // if (page instanceof FileSearchPage) { // FileSearchPage filePage = (FileSearchPage) page; // new ReplaceAction(filePage.getSite().getShell(), // (FileSearchResult) filePage.getInput(), null).run(); // } // } } }); return true; } catch (CoreException e) { ErrorDialog.openError( getShell(), SearchMessages.TextSearchPage_replace_searchproblems_title, SearchMessages.TextSearchPage_replace_querycreationproblem_message, e.getStatus()); return false; } }