|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.ui.part.Page | +--org.eclipse.ui.views.contentoutline.ContentOutlinePage
An abstract base class for content outline pages.
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.
Constructor Summary | |
protected |
ContentOutlinePage()
Create a new content outline page. |
Method Summary | |
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()
Returns the SWT control for this page. |
ISelection |
getSelection()
Returns the current selection for this provider. |
protected TreeViewer |
getTreeViewer()
Returns this page's tree viewer. |
void |
init(IPageSite pageSite)
The ContentOutlinePage implementation of this
IPageBookViewPage method registers itself as a selection
provider with the site. |
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. |
Methods inherited from class org.eclipse.ui.part.Page |
dispose, getSite, makeContributions, setActionBars |
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.part.IPage |
dispose, setActionBars |
Constructor Detail |
protected ContentOutlinePage()
Method Detail |
public void addSelectionChangedListener(ISelectionChangedListener listener)
ISelectionProvider
addSelectionChangedListener
in interface ISelectionProvider
listener
- 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 IPage
createControl
in class Page
parent
- the parent controlprotected void fireSelectionChanged(ISelection selection)
public Control getControl()
IPage
getControl
in interface IPage
getControl
in class Page
null
if this
page does not have a controlpublic ISelection getSelection()
ISelectionProvider
getSelection
in interface ISelectionProvider
protected TreeViewer getTreeViewer()
null
if
createControl
has not been called yetpublic void init(IPageSite pageSite)
ContentOutlinePage
implementation of this
IPageBookViewPage
method registers itself as a selection
provider with the site.
init
in interface IPageBookViewPage
init
in class Page
pageSite
- the page sitepublic 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 setFocus()
setFocus
in interface IPage
setFocus
in class Page
public void setSelection(ISelection selection)
ISelectionProvider
setSelection
in interface ISelectionProvider
selection
- the new selection
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |