Package org.eclipse.handly.ui.outline
Class OutlineSorterContribution
- java.lang.Object
-
- org.eclipse.handly.ui.outline.OutlineContribution
-
- org.eclipse.handly.ui.outline.OutlineSorterContribution
-
- All Implemented Interfaces:
IOutlineContribution
- Direct Known Subclasses:
LexicalSortContribution
public abstract class OutlineSorterContribution extends OutlineContribution
An abstract base class for outline sorter contributions. The activation of the sorter is governed by a user preference.
-
-
Constructor Summary
Constructors Constructor Description OutlineSorterContribution()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
dispose()
Disposes of this contribution.protected abstract org.eclipse.jface.viewers.ViewerComparator
getComparator()
Returns a comparator that will be used when the sorter is active.protected org.eclipse.jface.viewers.ViewerComparator
getDefaultComparator()
Returns a comparator that will be used when the sorter is inactive, ornull
if no sorting needs to take place then.protected abstract IBooleanPreference
getPreference()
Returns a boolean-valued preference that will control the activation of the sorter.void
init(ICommonOutlinePage outlinePage)
Initializes this contribution.-
Methods inherited from class org.eclipse.handly.ui.outline.OutlineContribution
getOutlinePage
-
-
-
-
Method Detail
-
init
public void init(ICommonOutlinePage outlinePage)
Description copied from class:OutlineContribution
Initializes this contribution. This method is called after the outline page's tree viewer has been created.This method may be extended by subclasses. Subclasses must call the superclass implementation.
- Specified by:
init
in interfaceIOutlineContribution
- Overrides:
init
in classOutlineContribution
- Parameters:
outlinePage
- the contribution's outline page (nevernull
)
-
dispose
public void dispose()
Description copied from class:OutlineContribution
Disposes of this contribution. Implementors should clean up any resources associated with this contribution. Note that there is no guarantee thatinit()
has been called. This method has no effect if this contribution has already been disposed.This method may be extended by subclasses. Subclasses must call the superclass implementation.
- Specified by:
dispose
in interfaceIOutlineContribution
- Overrides:
dispose
in classOutlineContribution
-
getPreference
protected abstract IBooleanPreference getPreference()
Returns a boolean-valued preference that will control the activation of the sorter. May returnnull
, in which case this contribution will be effectively disabled. This method is called once, when this contribution is initializing.- Returns:
- the sorter preference, or
null
-
getComparator
protected abstract org.eclipse.jface.viewers.ViewerComparator getComparator()
Returns a comparator that will be used when the sorter is active. This method is called once, when this contribution is initializing.- Returns:
- the comparator to use when the sorter is active
(not
null
)
-
getDefaultComparator
protected org.eclipse.jface.viewers.ViewerComparator getDefaultComparator()
Returns a comparator that will be used when the sorter is inactive, ornull
if no sorting needs to take place then. This method is called once, when this contribution is initializing.Default implementation returns
null
. Subclasses may override.- Returns:
- the comparator to use when the sorter is inactive,
or
null
if none
-
-