Search in sources :

Example 1 with PageSwitcher

use of org.eclipse.ui.part.PageSwitcher in project eclipse.platform.text by eclipse.

the class SearchView method initializePageSwitcher.

private void initializePageSwitcher() {
    new PageSwitcher(this) {

        @Override
        public void activatePage(Object page) {
            ISearchResult searchResult = ((ISearchQuery) page).getSearchResult();
            InternalSearchUI.getInstance().showSearchResult(SearchView.this, searchResult, false);
        }

        @Override
        public ImageDescriptor getImageDescriptor(Object page) {
            ISearchResult searchResult = ((ISearchQuery) page).getSearchResult();
            return searchResult.getImageDescriptor();
        }

        @Override
        public String getName(Object page) {
            ISearchResult searchResult = ((ISearchQuery) page).getSearchResult();
            return searchResult.getLabel();
        }

        @Override
        public Object[] getPages() {
            return NewSearchUI.getQueries();
        }
    };
}
Also used : ISearchResult(org.eclipse.search.ui.ISearchResult) PageSwitcher(org.eclipse.ui.part.PageSwitcher) ISearchQuery(org.eclipse.search.ui.ISearchQuery)

Aggregations

ISearchQuery (org.eclipse.search.ui.ISearchQuery)1 ISearchResult (org.eclipse.search.ui.ISearchResult)1 PageSwitcher (org.eclipse.ui.part.PageSwitcher)1