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.AbstractTextSearchViewPageA subclass ofAbstractTextSearchViewPagethat extends the base implementation with a bit more functionality. Uses aSearchEditorOpenerto 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 theelementsChanged()andclear()methods by delegating to anISearchContentProvider.
-
-
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 voidclear()protected SearchEditorOpenercreateEditorOpener()Creates the editor opener to be used in this page.protected org.eclipse.jface.action.IActioncreateSearchPreferencesAction()Creates the action that opens the search preferences dialog.protected voidelementsChanged(java.lang.Object[] objects)protected org.eclipse.jface.viewers.IStructuredContentProvidergetContentProvider()Returns the content provider currently used in this page.protected intgetDisplayedMatchCount()Returns the number of matches that are currently displayed for the viewer elements.protected SearchEditorOpenergetEditorOpener()Returns the editor opener currently used in this page.java.lang.StringgetLabel()protected org.eclipse.jface.viewers.StructuredViewergetViewer()voidinit(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, showMatch
-
-
-
-
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:
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
public java.lang.String 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
protected void elementsChanged(java.lang.Object[] objects)
- 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
protected final SearchEditorOpener getEditorOpener()
Returns the editor opener currently used in this page.- Returns:
- the currently used editor opener, or
nullif 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 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:
AbstractTextSearchViewPage.getDisplayedMatchCount(Object)
-
-