Class ContentOutline
- All Implemented Interfaces:
IAdaptable,IExecutableExtension,ISelectionChangedListener,ISelectionProvider,IPartListener,IPersistable,IViewPart,IWorkbenchPart,IWorkbenchPart2,IWorkbenchPart3,IWorkbenchPartOrientation
This standard view has id "org.eclipse.ui.views.ContentOutline".
getAdapter:
IEditorPart editor = ...;
IContentOutlinePage outlinePage = (IContentOutlinePage) editor.getAdapter(IContentOutlinePage.class);
if (outlinePage != null) {
// editor wishes to contribute outlinePage to content outline view
}
If the editor supports a content outline page, the editor instantiates and configures the page, and returns it. This page is then added to the content outline view (a pagebook which presents one page at a time) and immediately made the current page (the content outline view need not be visible). If the editor does not support a content outline page, the content outline view shows a special default page which makes it clear to the user that the content outline view is disengaged. A content outline page is free to report selection events; the content outline view forwards these events along to interested parties. When the content outline view notices a different editor being activated, it flips to the editor's corresponding content outline page. When the content outline view notices an editor being closed, it destroys the editor's corresponding content outline page.
The workbench will automatically instantiate this class when a Content Outline view is needed for a workbench window. This class was not intended to be instantiated or subclassed by clients.
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.ui.part.PageBookView
PageBookView.PageRec, PageBookView.SelectionProvider -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringHelp context id used for the content outline view (value"org.eclipse.ui.content_outline_context").static final StringThe plugin prefix.Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a content outline view with no content outline pages. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener for selection changes in this selection provider.protected IPagecreateDefaultPage(PageBook book) Creates and returns the default page for this view.voidcreatePartControl(Composite parent) ThePageBookViewimplementation of thisIWorkbenchPartmethod creates aPageBookcontrol with its default page showing.protected PageBookView.PageRecdoCreatePage(IWorkbenchPart part) Creates a new page in the pagebook for a particular part.protected voiddoDestroyPage(IWorkbenchPart part, PageBookView.PageRec rec) Destroys a page in the pagebook for a particular part.<T> TgetAdapter(Class<T> key) ThePageBookViewimplementation of thisIAdaptablemethod delegates to the current page, if it implementsIAdaptable.protected IWorkbenchPartReturns the active, important workbench part for this view.Returns the current selection for this provider.protected booleanisImportant(IWorkbenchPart part) Returns whether the given part should be added to this view.voidThePageBookViewimplementation of thisIPartListenermethod does nothing.voidRemoves the given selection change listener from this selection provider.voidNotifies that the selection has changed.voidsetSelection(ISelection selection) Sets the current selection for this selection provider.protected voidshowPageRec(PageBookView.PageRec pageRec) TheContentOutlineimplementation of thisPageBookViewmethod extends the behavior of its parent to use the current page as a selection provider.Methods inherited from class org.eclipse.ui.part.PageBookView
dispose, doesPageExist, getCurrentContributingPart, getCurrentPage, getDefaultPage, getPageBook, getPageRec, getPageRec, getPageSite, getSelectionProvider, getViewAdapter, init, initPage, partActivated, partClosed, partDeactivated, partHidden, partOpened, partVisible, setFocusMethods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, saveState, setContentDescription, setInitializationData, setPartNameMethods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
-
Field Details
-
PREFIX
The plugin prefix.- See Also:
-
CONTENT_OUTLINE_VIEW_HELP_CONTEXT_ID
Help context id used for the content outline view (value"org.eclipse.ui.content_outline_context").- See Also:
-
-
Constructor Details
-
ContentOutline
public ContentOutline()Creates a content outline view with no content outline pages.
-
-
Method Details
-
addSelectionChangedListener
Description copied from interface:ISelectionProviderAdds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.- Specified by:
addSelectionChangedListenerin interfaceISelectionProvider- Parameters:
listener- a selection changed listener
-
createDefaultPage
Description copied from class:PageBookViewCreates and returns the default page for this view.Subclasses must implement this method.
Subclasses must call initPage with the new page (if it is an
IPageBookViewPage) before calling createControl on the page.- Specified by:
createDefaultPagein classPageBookView- Parameters:
book- the pagebook control- Returns:
- the default page
-
createPartControl
ThePageBookViewimplementation of thisIWorkbenchPartmethod creates aPageBookcontrol with its default page showing.- Specified by:
createPartControlin interfaceIWorkbenchPart- Overrides:
createPartControlin classPageBookView- Parameters:
parent- the parent control
-
doCreatePage
Description copied from class:PageBookViewCreates a new page in the pagebook for a particular part. This page will be made visible whenever the part is active, and will be destroyed with a call todoDestroyPage.Subclasses must implement this method.
Subclasses must call initPage with the new page (if it is an
IPageBookViewPage) before calling createControl on the page.- Specified by:
doCreatePagein classPageBookView- Parameters:
part- the input part- Returns:
- the record describing a new page for this view
- See Also:
-
doDestroyPage
Description copied from class:PageBookViewDestroys a page in the pagebook for a particular part. This page was returned as a result fromdoCreatePage.Subclasses must implement this method.
- Specified by:
doDestroyPagein classPageBookView- Parameters:
part- the input partrec- a page record for the part- See Also:
-
getAdapter
Description copied from class:PageBookViewThePageBookViewimplementation of thisIAdaptablemethod delegates to the current page, if it implementsIAdaptable.- Specified by:
getAdapterin interfaceIAdaptable- Overrides:
getAdapterin classPageBookView- Type Parameters:
T- the class type- Parameters:
key- the adapter class to look up- Returns:
- a object of the given class, or
nullif this object does not have an adapter for the given class
-
getBootstrapPart
Description copied from class:PageBookViewReturns the active, important workbench part for this view.When the page book view is created it has no idea which part within the workbook should be used to generate the first page. Therefore, it delegates the choice to subclasses of
PageBookView.Implementors of this method should return an active, important part in the workbench or
nullif none found.Subclasses must implement this method.
- Specified by:
getBootstrapPartin classPageBookView- Returns:
- the active important part, or
nullif none
-
getSelection
Description copied from interface:ISelectionProviderReturns the current selection for this provider.- Specified by:
getSelectionin interfaceISelectionProvider- Returns:
- the current selection
-
isImportant
Description copied from class:PageBookViewReturns whether the given part should be added to this view.Subclasses must implement this method.
- Specified by:
isImportantin classPageBookView- Parameters:
part- the input part- Returns:
trueif the part is relevant, andfalseotherwise
-
partBroughtToTop
Description copied from class:PageBookViewThePageBookViewimplementation of thisIPartListenermethod does nothing. Subclasses may extend.- Specified by:
partBroughtToTopin interfaceIPartListener- Overrides:
partBroughtToTopin classPageBookView- Parameters:
part- the part that was surfaced- See Also:
-
removeSelectionChangedListener
Description copied from interface:ISelectionProviderRemoves the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.- Specified by:
removeSelectionChangedListenerin interfaceISelectionProvider- Parameters:
listener- a selection changed listener
-
selectionChanged
Description copied from interface:ISelectionChangedListenerNotifies that the selection has changed.- Specified by:
selectionChangedin interfaceISelectionChangedListener- Parameters:
event- event object describing the change
-
setSelection
Description copied from interface:ISelectionProviderSets the current selection for this selection provider.- Specified by:
setSelectionin interfaceISelectionProvider- Parameters:
selection- the new selection
-
showPageRec
TheContentOutlineimplementation of thisPageBookViewmethod extends the behavior of its parent to use the current page as a selection provider.- Overrides:
showPageRecin classPageBookView- Parameters:
pageRec- the page record containing the page to show
-