public abstract class CommonOutlinePage extends org.eclipse.ui.part.Page implements ICommonOutlinePage
ICommonOutlinePage
.Modifier and Type | Class and Description |
---|---|
protected class |
CommonOutlinePage.OutlineTreeViewer
A tree viewer for the
CommonOutlinePage . |
Constructor and Description |
---|
CommonOutlinePage() |
Modifier and Type | Method and Description |
---|---|
void |
addInputChangeListener(IOutlineInputChangeListener listener)
Adds the given input change listener.
|
void |
addOutlineContribution(IOutlineContribution contribution)
Adds the given outline contribution.
|
void |
addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener) |
protected abstract java.lang.Object |
computeInput()
Computes the input element for the outline page's tree viewer.
|
void |
createControl(org.eclipse.swt.widgets.Composite parent) |
protected CommonOutlinePage.OutlineTreeViewer |
createTreeViewer(org.eclipse.swt.widgets.Composite parent)
Creates a tree viewer for this outline page.
|
void |
dispose() |
protected void |
editorInputChanged()
Notifies that the outline page's editor input has changed.
|
protected abstract org.eclipse.jface.viewers.ITreeContentProvider |
getContentProvider()
Returns the content provider that is to be used by the outline page's
tree viewer.
|
org.eclipse.swt.widgets.Control |
getControl() |
org.eclipse.ui.IEditorPart |
getEditor()
Returns the editor which created this outline page.
|
protected abstract org.eclipse.jface.viewers.IBaseLabelProvider |
getLabelProvider()
Returns the label provider that is to be used by the outline page's
tree viewer.
|
org.eclipse.jface.viewers.ISelection |
getSelection() |
org.eclipse.jface.viewers.TreeViewer |
getTreeViewer()
Returns the tree viewer of this outline page.
|
void |
init(org.eclipse.ui.IEditorPart editor)
Initializes this outline page with its corresponding editor.
|
void |
init(org.eclipse.ui.part.IPageSite pageSite) |
protected void |
initDecorationContext(org.eclipse.jface.viewers.DecorationContext context)
Hook to initialize decoration context.
|
protected boolean |
isAutoExpandable(org.eclipse.swt.widgets.TreeItem item)
Returns whether the given tree item is auto-expandable.
|
void |
refresh()
Completely refreshes this outline page's tree viewer,
preserving expanded tree paths where possible.
|
protected void |
registerGlobalActions()
Hook to register global action handlers.
|
void |
removeInputChangeListener(IOutlineInputChangeListener listener)
Removes the given input change listener.
|
void |
removeOutlineContribution(IOutlineContribution contribution)
Removes the given outline contribution.
|
void |
removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener) |
void |
setFocus() |
void |
setSelection(org.eclipse.jface.viewers.ISelection selection) |
protected boolean |
shouldUseHashlookup()
Returns whether the outline page's tree viewer should use hash lookup.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLexicalSortPreference, getLinkWithEditorPreference
public final org.eclipse.jface.viewers.TreeViewer getTreeViewer()
ICommonOutlinePage
getTreeViewer
in interface ICommonOutlinePage
null
if it has not been created yetpublic void init(org.eclipse.ui.IEditorPart editor)
ICommonOutlinePage
init
in interface ICommonOutlinePage
editor
- the editor which created this outline page
(not null
)public final org.eclipse.ui.IEditorPart getEditor()
ICommonOutlinePage
getEditor
in interface ICommonOutlinePage
null
if it has not been set yetpublic void addOutlineContribution(IOutlineContribution contribution)
ICommonOutlinePage
addOutlineContribution
in interface ICommonOutlinePage
contribution
- not null
public void removeOutlineContribution(IOutlineContribution contribution)
ICommonOutlinePage
removeOutlineContribution
in interface ICommonOutlinePage
contribution
- not null
public void addInputChangeListener(IOutlineInputChangeListener listener)
ICommonOutlinePage
addInputChangeListener
in interface ICommonOutlinePage
listener
- not null
public void removeInputChangeListener(IOutlineInputChangeListener listener)
ICommonOutlinePage
removeInputChangeListener
in interface ICommonOutlinePage
listener
- not null
public void init(org.eclipse.ui.part.IPageSite pageSite)
init
in interface org.eclipse.ui.part.IPageBookViewPage
init
in class org.eclipse.ui.part.Page
public final org.eclipse.swt.widgets.Control getControl()
getControl
in interface org.eclipse.ui.part.IPage
getControl
in class org.eclipse.ui.part.Page
public void createControl(org.eclipse.swt.widgets.Composite parent)
createControl
in interface org.eclipse.ui.part.IPage
createControl
in class org.eclipse.ui.part.Page
public void setFocus()
setFocus
in interface org.eclipse.ui.part.IPage
setFocus
in class org.eclipse.ui.part.Page
public void dispose()
dispose
in interface org.eclipse.ui.part.IPage
dispose
in class org.eclipse.ui.part.Page
public org.eclipse.jface.viewers.ISelection getSelection()
getSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
public void setSelection(org.eclipse.jface.viewers.ISelection selection)
setSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
addSelectionChangedListener
in interface org.eclipse.jface.viewers.ISelectionProvider
public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
removeSelectionChangedListener
in interface org.eclipse.jface.viewers.ISelectionProvider
public void refresh()
protected boolean shouldUseHashlookup()
Default implementation returns true
.
Subclasses may override.
StructuredViewer.setUseHashlookup(boolean)
protected abstract org.eclipse.jface.viewers.ITreeContentProvider getContentProvider()
null
)protected abstract org.eclipse.jface.viewers.IBaseLabelProvider getLabelProvider()
null
)protected abstract java.lang.Object computeInput()
null
)protected CommonOutlinePage.OutlineTreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent)
parent
- the parent composite (never null
)null
)protected void editorInputChanged()
Default implementation computes
and sets the
new input for the outline page's tree viewer. Subclasses may extend.
protected boolean isAutoExpandable(org.eclipse.swt.widgets.TreeItem item)
expandXXX
methods.
If it returns false
, the item is to be collapsed,
rather than expanded.
Default implementation returns true
for the root item
and false
for all other items. Subclasses may override.
item
- the tree item (never null
)true
if the given item is auto-expandable;
false
otherwiseprotected void registerGlobalActions()
If the editor which created this outline page is a text editor,
default implementation registers global action handlers for the
following text editor actions:
UNDO
,
REDO
,
NEXT
,
PREVIOUS
.
protected void initDecorationContext(org.eclipse.jface.viewers.DecorationContext context)
If this outline page implements IContentAdapterProvider
,
default implementation registers this outline page in the given context
under the name IContentAdapterProvider.class.getName()
.
context
- the decoration context (never null
)Copyright (c) 2014, 2018 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0