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 ofAbstractTextSearchViewPage
that extends the base implementation with a bit more functionality. Uses aSearchEditorOpener
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 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 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
-
-
-
-
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 interfaceorg.eclipse.ui.part.IPageBookViewPage
- Overrides:
init
in classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
restoreState
public void restoreState(org.eclipse.ui.IMemento memento)
- Specified by:
restoreState
in interfaceorg.eclipse.search.ui.ISearchResultPage
- Overrides:
restoreState
in classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
saveState
public void saveState(org.eclipse.ui.IMemento memento)
- Specified by:
saveState
in interfaceorg.eclipse.search.ui.ISearchResultPage
- Overrides:
saveState
in classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
getLabel
public java.lang.String getLabel()
- Specified by:
getLabel
in interfaceorg.eclipse.search.ui.ISearchResultPage
- Overrides:
getLabel
in 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:
showMatch
in classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
- Throws:
org.eclipse.ui.PartInitException
-
elementsChanged
protected void elementsChanged(java.lang.Object[] objects)
- Specified by:
elementsChanged
in classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
clear
protected void clear()
- Specified by:
clear
in classorg.eclipse.search.ui.text.AbstractTextSearchViewPage
-
getViewer
protected org.eclipse.jface.viewers.StructuredViewer getViewer()
- Overrides:
getViewer
in 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
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 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
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)
-
-