public class ContentOutline extends PageBookView implements ISelectionProvider, ISelectionChangedListener
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.
PageBookView.PageRec, PageBookView.SelectionProvider
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_OUTLINE_VIEW_HELP_CONTEXT_ID
Help context id used for the content outline view
(value
"org.eclipse.ui.content_outline_context" ). |
static String |
PREFIX
The plugin prefix.
|
PROP_TITLE
Constructor and Description |
---|
ContentOutline()
Creates a content outline view with no content outline pages.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionChangedListener(ISelectionChangedListener listener)
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)
The
PageBookView implementation of this IWorkbenchPart
method creates a PageBook 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)
The
PageBookView implementation of this
IAdaptable method delegates to the current page, if it
implements IAdaptable . |
protected IWorkbenchPart |
getBootstrapPart()
Returns the active, important workbench part for this view.
|
ISelection |
getSelection()
Returns the current selection for this provider.
|
protected boolean |
isImportant(IWorkbenchPart part)
Returns whether the given part should be added to this view.
|
void |
partBroughtToTop(IWorkbenchPart part)
The
PageBookView implementation of this
IPartListener method does nothing. |
void |
removeSelectionChangedListener(ISelectionChangedListener listener)
Removes the given selection change listener from this selection provider.
|
void |
selectionChanged(SelectionChangedEvent event)
Notifies that the selection has changed.
|
void |
setSelection(ISelection selection)
Sets the current selection for this selection provider.
|
protected void |
showPageRec(PageBookView.PageRec pageRec)
The
ContentOutline implementation of this PageBookView method
extends the behavior of its parent to use the current page as a selection provider. |
dispose, doesPageExist, getCurrentContributingPart, getCurrentPage, getDefaultPage, getPageBook, getPageRec, getPageRec, getPageSite, getSelectionProvider, getViewAdapter, init, initPage, partActivated, partClosed, partDeactivated, partHidden, partOpened, partVisible, setFocus
checkSite, getViewSite, init, saveState, setContentDescription, setInitializationData, setPartName
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
public static final String PREFIX
public static final String CONTENT_OUTLINE_VIEW_HELP_CONTEXT_ID
"org.eclipse.ui.content_outline_context"
).public ContentOutline()
public void addSelectionChangedListener(ISelectionChangedListener listener)
ISelectionProvider
addSelectionChangedListener
in interface ISelectionProvider
listener
- a selection changed listenerprotected IPage createDefaultPage(PageBook book)
PageBookView
Subclasses must implement this method.
Subclasses must call initPage with the new page (if it is an
IPageBookViewPage
) before calling createControl on the
page.
createDefaultPage
in class PageBookView
book
- the pagebook controlpublic void createPartControl(Composite parent)
PageBookView
implementation of this IWorkbenchPart
method creates a PageBook
control with its default page showing.createPartControl
in interface IWorkbenchPart
createPartControl
in class PageBookView
parent
- the parent controlprotected PageBookView.PageRec doCreatePage(IWorkbenchPart part)
PageBookView
doDestroyPage
.
Subclasses must implement this method.
Subclasses must call initPage with the new page (if it is an
IPageBookViewPage
) before calling createControl on the
page.
doCreatePage
in class PageBookView
part
- the input partPageBookView.doDestroyPage(org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.part.PageBookView.PageRec)
protected void doDestroyPage(IWorkbenchPart part, PageBookView.PageRec rec)
PageBookView
doCreatePage
.
Subclasses must implement this method.
doDestroyPage
in class PageBookView
part
- the input partrec
- a page record for the partPageBookView.doCreatePage(org.eclipse.ui.IWorkbenchPart)
public <T> T getAdapter(Class<T> key)
PageBookView
PageBookView
implementation of this
IAdaptable
method delegates to the current page, if it
implements IAdaptable
.getAdapter
in interface IAdaptable
getAdapter
in class PageBookView
key
- the adapter class to look upnull
if this object does not
have an adapter for the given classprotected IWorkbenchPart getBootstrapPart()
PageBookView
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.
getBootstrapPart
in class PageBookView
null
if nonepublic ISelection getSelection()
ISelectionProvider
getSelection
in interface ISelectionProvider
protected boolean isImportant(IWorkbenchPart part)
PageBookView
Subclasses must implement this method.
isImportant
in class PageBookView
part
- the input parttrue
if the part is relevant, and
false
otherwisepublic void partBroughtToTop(IWorkbenchPart part)
PageBookView
PageBookView
implementation of this
IPartListener
method does nothing. Subclasses may extend.partBroughtToTop
in interface IPartListener
partBroughtToTop
in class PageBookView
part
- the part that was surfacedIWorkbenchPage.bringToTop(org.eclipse.ui.IWorkbenchPart)
public void removeSelectionChangedListener(ISelectionChangedListener listener)
ISelectionProvider
removeSelectionChangedListener
in interface ISelectionProvider
listener
- a selection changed listenerpublic void selectionChanged(SelectionChangedEvent event)
ISelectionChangedListener
selectionChanged
in interface ISelectionChangedListener
event
- event object describing the changepublic void setSelection(ISelection selection)
ISelectionProvider
setSelection
in interface ISelectionProvider
selection
- the new selectionprotected void showPageRec(PageBookView.PageRec pageRec)
ContentOutline
implementation of this PageBookView
method
extends the behavior of its parent to use the current page as a selection provider.showPageRec
in class PageBookView
pageRec
- the page record containing the page to show
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.