Class ContentOutlinePage
- All Implemented Interfaces:
- ISelectionChangedListener,- ISelectionProvider,- IPage,- IPageBookViewPage,- IContentOutlinePage
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.
 
Subclasses may provide a hint for constructing the tree viewer
 using getTreeStyle().
 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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a listener for selection changes in this selection provider.voidcreateControl(Composite parent) TheContentOutlinePageimplementation of thisIContentOutlinePagemethod creates a tree viewer.protected voidfireSelectionChanged(ISelection selection) Fires a selection changed event.ThePageimplementation of thisIPagemethod returnsnull.Returns the current selection for this provider.protected intA hint for the styles to use while constructing the TreeViewer.protected TreeViewerReturns this page's tree viewer.voidThePageimplementation of thisIPageBookViewPagemethod stores a reference to the supplied site (the site which contains this page).voidRemoves the given selection change listener from this selection provider.voidNotifies that the selection has changed.voidsetFocus()Sets focus to a part in the page.voidsetSelection(ISelection selection) Sets the current selection for this selection provider.Methods inherited from class org.eclipse.ui.part.Pagedispose, getSite, makeContributions, setActionBarsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.part.IPagedispose, setActionBars
- 
Constructor Details- 
ContentOutlinePageprotected ContentOutlinePage()Create a new content outline page.
 
- 
- 
Method Details- 
addSelectionChangedListenerDescription 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 interface- ISelectionProvider
- Parameters:
- listener- a selection changed listener
 
- 
createControlTheContentOutlinePageimplementation of thisIContentOutlinePagemethod creates a tree viewer. Subclasses must extend this method configure the tree viewer with a proper content provider, label provider, and input element.- Specified by:
- createControlin interface- IPage
- Specified by:
- createControlin class- Page
- Parameters:
- parent- the parent composite
 
- 
getTreeStyleprotected int getTreeStyle()A hint for the styles to use while constructing the TreeViewer.Subclasses may override. - Returns:
- the tree styles to use. By default, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL
- Since:
- 3.6
 
- 
fireSelectionChangedFires a selection changed event.- Parameters:
- selection- the new selection
 
- 
getControlDescription copied from class:PageThePageimplementation of thisIPagemethod returnsnull. Subclasses must reimplement.- Specified by:
- getControlin interface- IPage
- Specified by:
- getControlin class- Page
- Returns:
- the SWT control for this page, or nullif this page does not have a control
 
- 
getSelectionDescription copied from interface:ISelectionProviderReturns the current selection for this provider.- Specified by:
- getSelectionin interface- ISelectionProvider
- Returns:
- the current selection
 
- 
getTreeViewerReturns this page's tree viewer.- Returns:
- this page's tree viewer, or nullifcreateControlhas not been called yet
 
- 
initDescription copied from class:PageThePageimplementation of thisIPageBookViewPagemethod stores a reference to the supplied site (the site which contains this page).Subclasses may extend. - Specified by:
- initin interface- IPageBookViewPage
- Overrides:
- initin class- Page
- Parameters:
- pageSite- the page site
 
- 
removeSelectionChangedListenerDescription 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 interface- ISelectionProvider
- Parameters:
- listener- a selection changed listener
 
- 
selectionChangedDescription copied from interface:ISelectionChangedListenerNotifies that the selection has changed.- Specified by:
- selectionChangedin interface- ISelectionChangedListener
- Parameters:
- event- event object describing the change
 
- 
setFocuspublic void setFocus()Sets focus to a part in the page.
- 
setSelectionDescription copied from interface:ISelectionProviderSets the current selection for this selection provider.- Specified by:
- setSelectionin interface- ISelectionProvider
- Parameters:
- selection- the new selection
 
 
-