@Override public void dispose() { if (fUndoRedoActionGroup != null) { fUndoRedoActionGroup.dispose(); } InternalSearchUI.getInstance().getSearchViewManager().searchViewClosed(this); InternalSearchUI.getInstance().getSearchManager().removeQueryListener(this); super.dispose(); }
@Override public void partActivated(IWorkbenchPart part) { super.partActivated(part); if (part == this) { InternalSearchUI.getInstance().getSearchViewManager().searchViewActivated(this); } }
@Override public void createPartControl(Composite parent) { createActions(); fPageContent = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; layout.horizontalSpacing = 0; layout.verticalSpacing = 0; fPageContent.setLayout(layout); fDescriptionComposite = null; super.createPartControl(fPageContent); getPageBook().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); fDefaultPartName = getPartName(); initializeToolBar(); InternalSearchUI.getInstance().getSearchManager().addQueryListener(this); initializePageSwitcher(); PlatformUI.getWorkbench() .getHelpSystem() .setHelp(parent, ISearchHelpContextIds.New_SEARCH_VIEW); restorePageFromMemento(); showLatestSearch(); }
@Override public void run() { ISearchResult result = fView.getCurrentSearchResult(); if (result != null) { InternalSearchUI.getInstance().cancelSearch(result.getQuery()); } }
private void updateCancelAction() { ISearchResult result = getCurrentSearchResult(); boolean queryRunning = false; if (result != null) { queryRunning = InternalSearchUI.getInstance().isQueryRunning(result.getQuery()); } fCancelAction.setEnabled(queryRunning); fSearchAgainAction.setEnabled(!queryRunning && result != null && result.getQuery().canRerun()); }
@Override public void queryRemoved(ISearchQuery query) { InternalSearchUI.getInstance().cancelSearch(query); if (query.getSearchResult().equals(fCurrentSearch)) { showSearchResult(null); partActivated(fDefaultPart); } fSearchViewStates.remove(query.getSearchResult()); fSearchesDropDownAction.disposeMenu(); fSearchesDropDownAction.updateEnablement(); }
private void showLatestSearch() { ISearchQuery[] queries = InternalSearchUI.getInstance().getSearchManager().getQueries(); if (queries.length > 0) { showSearchResult(queries[0].getSearchResult()); } }