Package org.eclipse.handly.ui.search
Class AbstractSearchResultPage
java.lang.Object
org.eclipse.ui.part.Page
org.eclipse.search.ui.text.AbstractTextSearchViewPage
org.eclipse.handly.ui.search.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
ConstructorsConstructorDescriptionCreates a new search page with the default layout flags.AbstractSearchResultPage(int supportedLayouts) Creates a new search page with the given layout flags. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclear()protected SearchEditorOpenerCreates the editor opener to be used in this page.protected org.eclipse.jface.action.IActionCreates the action that opens the search preferences dialog.protected voidelementsChanged(Object[] objects) protected final org.eclipse.jface.viewers.IStructuredContentProviderReturns the content provider currently used in this page.protected intReturns the number of matches that are currently displayed for the viewer elements.protected final SearchEditorOpenerReturns the editor opener currently used in this page.getLabel()protected org.eclipse.jface.viewers.StructuredViewervoidinit(org.eclipse.ui.part.IPageSite pageSite) voidrestoreState(org.eclipse.ui.IMemento memento) voidsaveState(org.eclipse.ui.IMemento memento) protected voidshowMatch(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, showMatchMethods inherited from class org.eclipse.ui.part.Page
getSite, makeContributions, setActionBarsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.part.IPage
setActionBarsMethods inherited from interface org.eclipse.ui.part.IPageBookViewPage
getSite
-
Constructor Details
-
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:
-
AbstractSearchResultPage
public AbstractSearchResultPage()Creates a new search page with the default layout flags.
-
-
Method Details
-
init
public void init(org.eclipse.ui.part.IPageSite pageSite) - Specified by:
initin interfaceorg.eclipse.ui.part.IPageBookViewPage- Overrides:
initin classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
restoreState
public void restoreState(org.eclipse.ui.IMemento memento) - Specified by:
restoreStatein interfaceorg.eclipse.search.ui.ISearchResultPage- Overrides:
restoreStatein classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
saveState
public void saveState(org.eclipse.ui.IMemento memento) - Specified by:
saveStatein interfaceorg.eclipse.search.ui.ISearchResultPage- Overrides:
saveStatein classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
getLabel
- Specified by:
getLabelin interfaceorg.eclipse.search.ui.ISearchResultPage- Overrides:
getLabelin classorg.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:
showMatchin classorg.eclipse.search.ui.text.AbstractTextSearchViewPage- Throws:
org.eclipse.ui.PartInitException
-
elementsChanged
- Specified by:
elementsChangedin classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
clear
protected void clear()- Specified by:
clearin classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
getViewer
protected org.eclipse.jface.viewers.StructuredViewer getViewer()- Overrides:
getViewerin classorg.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
nullif this page does not yet have a content provider
-
getEditorOpener
Returns the editor opener currently used in this page.- Returns:
- the currently used editor opener, or
nullif none has been created yet
-
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 returnnull, 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
nullif 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:
-