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
Modifier and TypeFieldDescriptionstatic final String
Help context id used for the content outline view (value"org.eclipse.ui.content_outline_context"
).static final String
The plugin prefix.Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
Constructor Summary
ConstructorDescriptionCreates a content outline view with no content outline pages. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener for selection changes in this selection provider.protected IPage
createDefaultPage
(PageBook book) Creates and returns the default page for this view.void
createPartControl
(Composite parent) ThePageBookView
implementation of thisIWorkbenchPart
method creates aPageBook
control with its default page showing.protected PageBookView.PageRec
doCreatePage
(IWorkbenchPart part) Creates a new page in the pagebook for a particular part.protected void
doDestroyPage
(IWorkbenchPart part, PageBookView.PageRec rec) Destroys a page in the pagebook for a particular part.<T> T
getAdapter
(Class<T> key) ThePageBookView
implementation of thisIAdaptable
method delegates to the current page, if it implementsIAdaptable
.protected IWorkbenchPart
Returns the active, important workbench part for this view.Returns the current selection for this provider.protected boolean
isImportant
(IWorkbenchPart part) Returns whether the given part should be added to this view.void
ThePageBookView
implementation of thisIPartListener
method does nothing.void
Removes the given selection change listener from this selection provider.void
Notifies that the selection has changed.void
setSelection
(ISelection selection) Sets the current selection for this selection provider.protected void
showPageRec
(PageBookView.PageRec pageRec) TheContentOutline
implementation of thisPageBookView
method 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, setFocus
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, saveState, setContentDescription, setInitializationData, setPartName
Methods 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, showBusy
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
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.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:ISelectionProvider
Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.- Specified by:
addSelectionChangedListener
in interfaceISelectionProvider
- Parameters:
listener
- a selection changed listener
-
createDefaultPage
Description copied from class:PageBookView
Creates 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:
createDefaultPage
in classPageBookView
- Parameters:
book
- the pagebook control- Returns:
- the default page
-
createPartControl
ThePageBookView
implementation of thisIWorkbenchPart
method creates aPageBook
control with its default page showing.- Specified by:
createPartControl
in interfaceIWorkbenchPart
- Overrides:
createPartControl
in classPageBookView
- Parameters:
parent
- the parent control
-
doCreatePage
Description copied from class:PageBookView
Creates 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:
doCreatePage
in classPageBookView
- Parameters:
part
- the input part- Returns:
- the record describing a new page for this view
- See Also:
-
doDestroyPage
Description copied from class:PageBookView
Destroys a page in the pagebook for a particular part. This page was returned as a result fromdoCreatePage
.Subclasses must implement this method.
- Specified by:
doDestroyPage
in classPageBookView
- Parameters:
part
- the input partrec
- a page record for the part- See Also:
-
getAdapter
Description copied from class:PageBookView
ThePageBookView
implementation of thisIAdaptable
method delegates to the current page, if it implementsIAdaptable
.- Specified by:
getAdapter
in interfaceIAdaptable
- Overrides:
getAdapter
in classPageBookView
- Type Parameters:
T
- the class type- Parameters:
key
- the adapter class to look up- Returns:
- a object of the given class, or
null
if this object does not have an adapter for the given class
-
getBootstrapPart
Description copied from class:PageBookView
Returns 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
null
if none found.Subclasses must implement this method.
- Specified by:
getBootstrapPart
in classPageBookView
- Returns:
- the active important part, or
null
if none
-
getSelection
Description copied from interface:ISelectionProvider
Returns the current selection for this provider.- Specified by:
getSelection
in interfaceISelectionProvider
- Returns:
- the current selection
-
isImportant
Description copied from class:PageBookView
Returns whether the given part should be added to this view.Subclasses must implement this method.
- Specified by:
isImportant
in classPageBookView
- Parameters:
part
- the input part- Returns:
true
if the part is relevant, andfalse
otherwise
-
partBroughtToTop
Description copied from class:PageBookView
ThePageBookView
implementation of thisIPartListener
method does nothing. Subclasses may extend.- Specified by:
partBroughtToTop
in interfaceIPartListener
- Overrides:
partBroughtToTop
in classPageBookView
- Parameters:
part
- the part that was surfaced- See Also:
-
removeSelectionChangedListener
Description copied from interface:ISelectionProvider
Removes the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.- Specified by:
removeSelectionChangedListener
in interfaceISelectionProvider
- Parameters:
listener
- a selection changed listener
-
selectionChanged
Description copied from interface:ISelectionChangedListener
Notifies that the selection has changed.- Specified by:
selectionChanged
in interfaceISelectionChangedListener
- Parameters:
event
- event object describing the change
-
setSelection
Description copied from interface:ISelectionProvider
Sets the current selection for this selection provider.- Specified by:
setSelection
in interfaceISelectionProvider
- Parameters:
selection
- the new selection
-
showPageRec
TheContentOutline
implementation of thisPageBookView
method extends the behavior of its parent to use the current page as a selection provider.- Overrides:
showPageRec
in classPageBookView
- Parameters:
pageRec
- the page record containing the page to show
-