Class AbstractSearchResultPage

  • All Implemented Interfaces:
    org.eclipse.search.ui.ISearchResultPage, org.eclipse.ui.part.IPage, org.eclipse.ui.part.IPageBookViewPage

    public abstract class AbstractSearchResultPage
    extends org.eclipse.search.ui.text.AbstractTextSearchViewPage
    A subclass of AbstractTextSearchViewPage that extends the base implementation with a bit more functionality. Uses a SearchEditorOpener to show matches in an editor. Saves and restores the element limit as part of the page state. Changes in the search result are handled in the elementsChanged() and clear() methods by delegating to an ISearchContentProvider.
    • Field Summary

      • Fields inherited from class org.eclipse.search.ui.text.AbstractTextSearchViewPage

        EMPTY_MATCH_ARRAY, FLAG_LAYOUT_FLAT, FLAG_LAYOUT_TREE
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractSearchResultPage()
      Creates a new search page with the default layout flags.
      AbstractSearchResultPage​(int supportedLayouts)
      Creates a new search page with the given layout flags.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void clear()  
      protected SearchEditorOpener createEditorOpener()
      Creates the editor opener to be used in this page.
      protected org.eclipse.jface.action.IAction createSearchPreferencesAction()
      Creates the action that opens the search preferences dialog.
      protected void elementsChanged​(java.lang.Object[] objects)  
      protected org.eclipse.jface.viewers.IStructuredContentProvider getContentProvider()
      Returns the content provider currently used in this page.
      protected int getDisplayedMatchCount()
      Returns the number of matches that are currently displayed for the viewer elements.
      protected SearchEditorOpener getEditorOpener()
      Returns the editor opener currently used in this page.
      java.lang.String getLabel()  
      protected org.eclipse.jface.viewers.StructuredViewer getViewer()  
      void init​(org.eclipse.ui.part.IPageSite pageSite)  
      void restoreState​(org.eclipse.ui.IMemento memento)  
      void saveState​(org.eclipse.ui.IMemento memento)  
      protected void showMatch​(org.eclipse.search.ui.text.Match match, int currentOffset, int currentLength, boolean activate)  
      • Methods inherited from class org.eclipse.search.ui.text.AbstractTextSearchViewPage

        canRemoveMatchesWith, configureTableViewer, configureTreeViewer, createControl, createTableViewer, createTreeViewer, dispose, evaluateChangedElements, fillContextMenu, fillToolbar, getControl, getCurrentMatch, getCurrentMatchLocation, getDisplayedMatchCount, getDisplayedMatches, getElementLimit, getID, getInput, getLayout, getSettings, getUIState, getViewPart, gotoNextMatch, gotoPreviousMatch, handleOpen, handleSearchResultChanged, internalRemoveSelected, isLayoutSupported, open, openAndSelect, postEnsureSelection, setElementLimit, setFocus, setID, setInput, setLayout, setViewPart, showMatch
      • Methods inherited from class org.eclipse.ui.part.Page

        getSite, makeContributions, setActionBars
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.ui.part.IPage

        setActionBars
      • Methods inherited from interface org.eclipse.ui.part.IPageBookViewPage

        getSite
    • Constructor Detail

      • AbstractSearchResultPage

        public AbstractSearchResultPage​(int supportedLayouts)
        Creates a new search page with the given layout flags. At least one flag must be passed in (i.e., 0 is not a permitted value).
        Parameters:
        supportedLayouts - flags determining which layout options this page supports. Must not be 0
        See Also:
        AbstractTextSearchViewPage.FLAG_LAYOUT_FLAT, AbstractTextSearchViewPage.FLAG_LAYOUT_TREE
      • AbstractSearchResultPage

        public AbstractSearchResultPage()
        Creates a new search page with the default layout flags.
    • Method Detail

      • init

        public void init​(org.eclipse.ui.part.IPageSite pageSite)
        Specified by:
        init in interface org.eclipse.ui.part.IPageBookViewPage
        Overrides:
        init in class org.eclipse.search.ui.text.AbstractTextSearchViewPage
      • restoreState

        public void restoreState​(org.eclipse.ui.IMemento memento)
        Specified by:
        restoreState in interface org.eclipse.search.ui.ISearchResultPage
        Overrides:
        restoreState in class org.eclipse.search.ui.text.AbstractTextSearchViewPage
      • saveState

        public void saveState​(org.eclipse.ui.IMemento memento)
        Specified by:
        saveState in interface org.eclipse.search.ui.ISearchResultPage
        Overrides:
        saveState in class org.eclipse.search.ui.text.AbstractTextSearchViewPage
      • getLabel

        public java.lang.String getLabel()
        Specified by:
        getLabel in interface org.eclipse.search.ui.ISearchResultPage
        Overrides:
        getLabel in class org.eclipse.search.ui.text.AbstractTextSearchViewPage
      • showMatch

        protected void showMatch​(org.eclipse.search.ui.text.Match match,
                                 int currentOffset,
                                 int currentLength,
                                 boolean activate)
                          throws org.eclipse.ui.PartInitException
        Overrides:
        showMatch in class org.eclipse.search.ui.text.AbstractTextSearchViewPage
        Throws:
        org.eclipse.ui.PartInitException
      • elementsChanged

        protected void elementsChanged​(java.lang.Object[] objects)
        Specified by:
        elementsChanged in class org.eclipse.search.ui.text.AbstractTextSearchViewPage
      • clear

        protected void clear()
        Specified by:
        clear in class org.eclipse.search.ui.text.AbstractTextSearchViewPage
      • getViewer

        protected org.eclipse.jface.viewers.StructuredViewer getViewer()
        Overrides:
        getViewer in class org.eclipse.search.ui.text.AbstractTextSearchViewPage
      • getContentProvider

        protected final org.eclipse.jface.viewers.IStructuredContentProvider getContentProvider()
        Returns the content provider currently used in this page.
        Returns:
        the currently used content provider, or null if this page does not yet have a content provider
      • getEditorOpener

        protected final SearchEditorOpener getEditorOpener()
        Returns the editor opener currently used in this page.
        Returns:
        the currently used editor opener, or null if none has been created yet
      • createEditorOpener

        protected SearchEditorOpener createEditorOpener()
        Creates the editor opener to be used in this page.
        Returns:
        a newly created editor opener
      • createSearchPreferencesAction

        protected org.eclipse.jface.action.IAction createSearchPreferencesAction()
        Creates the action that opens the search preferences dialog. May return null, in which case no "Preferences..." action will be added to the view menu.

        Default implementation returns a new OpenSearchPreferencesAction.

        Returns:
        a newly created search preferences action, or null if this page should have no "Preferences..." action
      • getDisplayedMatchCount

        protected int getDisplayedMatchCount()
        Returns the number of matches that are currently displayed for the viewer elements.
        Returns:
        the number of matches displayed for the viewer elements
        See Also:
        AbstractTextSearchViewPage.getDisplayedMatchCount(Object)