public abstract class ContentOutlinePage extends Page implements IContentOutlinePage, ISelectionChangedListener
Clients who are defining an editor may elect to provide a corresponding content outline page. This content outline page will be presented to the user via the standard Content Outline View (the user decides whether their workbench window contains this view) whenever that editor is active. This class should be subclassed.
Internally, each content outline page consists of a standard tree viewer;
selections made in the tree viewer are reported as selection change events
by the page (which is a selection provider). The tree viewer is not created
until createPage is called; consequently, subclasses must extend
createControl to configure the tree viewer with a proper content
provider, label provider, and input element.
Note that those wanting to use a control other than internally created
TreeViewer will need to implement
IContentOutlinePage directly rather than subclassing this class.
| Modifier | Constructor and Description |
|---|---|
protected |
ContentOutlinePage()
Create a new content outline page.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSelectionChangedListener(ISelectionChangedListener listener)
Adds a listener for selection changes in this selection provider.
|
void |
createControl(Composite parent)
The
ContentOutlinePage implementation of this
IContentOutlinePage method creates a tree viewer. |
protected void |
fireSelectionChanged(ISelection selection)
Fires a selection changed event.
|
Control |
getControl()
The
Page implementation of this IPage method returns
null. |
ISelection |
getSelection()
Returns the current selection for this provider.
|
protected TreeViewer |
getTreeViewer()
Returns this page's tree viewer.
|
void |
init(IPageSite pageSite)
The
Page implementation of this IPageBookViewPage method
stores a reference to the supplied site (the site which contains this
page). |
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 |
setFocus()
Sets focus to a part in the page.
|
void |
setSelection(ISelection selection)
Sets the current selection for this selection provider.
|
dispose, getSite, makeContributions, setActionBarsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdispose, setActionBarsprotected ContentOutlinePage()
public void addSelectionChangedListener(ISelectionChangedListener listener)
ISelectionProvideraddSelectionChangedListener in interface ISelectionProviderlistener - a selection changed listenerpublic void createControl(Composite parent)
ContentOutlinePage implementation of this
IContentOutlinePage method creates a tree viewer. Subclasses
must extend this method configure the tree viewer with a proper content
provider, label provider, and input element.createControl in interface IPagecreateControl in class Pageparent - protected void fireSelectionChanged(ISelection selection)
selection - the new selectionpublic Control getControl()
PagePage implementation of this IPage method returns
null. Subclasses must reimplement.getControl in interface IPagegetControl in class Pagenull if this
page does not have a controlpublic ISelection getSelection()
ISelectionProvidergetSelection in interface ISelectionProviderprotected TreeViewer getTreeViewer()
null if
createControl has not been called yetpublic void init(IPageSite pageSite)
PagePage implementation of this IPageBookViewPage method
stores a reference to the supplied site (the site which contains this
page).
Subclasses may extend.
init in interface IPageBookViewPageinit in class PagepageSite - the page sitepublic void removeSelectionChangedListener(ISelectionChangedListener listener)
ISelectionProviderremoveSelectionChangedListener in interface ISelectionProviderlistener - a selection changed listenerpublic void selectionChanged(SelectionChangedEvent event)
ISelectionChangedListenerselectionChanged in interface ISelectionChangedListenerevent - event object describing the changepublic void setFocus()
public void setSelection(ISelection selection)
ISelectionProvidersetSelection in interface ISelectionProviderselection - the new selectionGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.