Package org.jdesktop.swingx.decorator
Class CompoundHighlighter
java.lang.Object
org.jdesktop.swingx.decorator.AbstractHighlighter
org.jdesktop.swingx.decorator.CompoundHighlighter
- All Implemented Interfaces:
Highlighter
,UIDependent
A class which manages the lists of
Highlighter
s.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Highlighter[]
private ChangeListener
the listener for changes in contained Highlighters.protected List
<Highlighter> Fields inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
listenerList
-
Constructor Summary
ConstructorsConstructorDescriptionCompoundHighlighter
(Highlighter... inList) Instantiates a CompoundHighlighter containing the givenHighlighter
s.CompoundHighlighter
(HighlightPredicate predicate, Highlighter... inList) Instantiates a CompoundHighlighter with the given predicate containing the givenHighlighter
s. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHighlighter
(Highlighter highlighter) Appends a highlighter to the pipeline.void
addHighlighter
(Highlighter highlighter, boolean prepend) Adds a highlighter to the pipeline.private void
addHighlighterSilently
(Highlighter highlighter, boolean prepend) protected ChangeListener
Creates and returns the ChangeListener registered to containedHighlighter
s.protected Component
doHighlight
(Component stamp, ComponentAdapter adapter) Apply the highlights.protected ChangeListener
Returns theChangeListner
to containedHighlighter
s.Returns an array of contained Highlighters.private void
Removes all contained highlighters without firing an event.void
Removes a highlighter from the pipeline.void
setHighlighters
(Highlighter... inList) Sets the givenHighlighter
s.void
updateUI()
Updates all internal visuals after changing a UI-delegate.private void
updateUI
(Highlighter hl) Updates the ui-dependent state of the given Highlighter.Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
addChangeListener, areEqual, canHighlight, fireStateChanged, getChangeListeners, getHighlightPredicate, highlight, removeChangeListener, setHighlightPredicate
-
Field Details
-
EMPTY_HIGHLIGHTERS
-
highlighters
-
highlighterChangeListener
the listener for changes in contained Highlighters.
-
-
Constructor Details
-
CompoundHighlighter
Instantiates a CompoundHighlighter containing the givenHighlighter
s.- Parameters:
inList
- zero or more not-null Highlighters to manage by this CompoundHighlighter.- Throws:
NullPointerException
- if array is null or array contains null values.
-
CompoundHighlighter
Instantiates a CompoundHighlighter with the given predicate containing the givenHighlighter
s.- Parameters:
predicate
- the highlightPredicate to useinList
- zero or more not-null Highlighters to manage by this CompoundHighlighter.- Throws:
NullPointerException
- if array is null or array contains null values.
-
-
Method Details
-
setHighlighters
Sets the givenHighlighter
s.- Parameters:
inList
- zero or more not-null Highlighters to manage by this CompoundHighlighter.- Throws:
NullPointerException
- if array is null or array contains null values.
-
removeAllHighlightersSilently
private void removeAllHighlightersSilently()Removes all contained highlighters without firing an event. Deregisters the listener from all. -
addHighlighter
Appends a highlighter to the pipeline.- Parameters:
highlighter
- highlighter to add- Throws:
NullPointerException
- if highlighter is null.
-
addHighlighter
Adds a highlighter to the pipeline. PENDING: Duplicate inserts?- Parameters:
highlighter
- highlighter to addprepend
- prepend the highlighter if true; false will append- Throws:
NullPointerException
- if highlighter is null.
-
addHighlighterSilently
-
removeHighlighter
Removes a highlighter from the pipeline.- Parameters:
hl
- highlighter to remove
-
getHighlighters
Returns an array of contained Highlighters.- Returns:
- the contained Highlighters, might be empty but never null.
-
updateUI
public void updateUI()Updates all internal visuals after changing a UI-delegate.Implemented to call updateUI on contained Highlighters.
- Specified by:
updateUI
in interfaceUIDependent
- See Also:
-
getHighlighterChangeListener
Returns theChangeListner
to containedHighlighter
s. The listener is lazily created.- Returns:
- the listener for contained highlighters, guaranteed to be not null.
-
createHighlighterChangeListener
Creates and returns the ChangeListener registered to containedHighlighter
s. Here: fires a stateChanged on each notification.- Returns:
- the listener for contained Highlighters.
-
updateUI
Updates the ui-dependent state of the given Highlighter.- Parameters:
hl
- the highlighter to update.
-
doHighlight
Apply the highlights.- Specified by:
doHighlight
in classAbstractHighlighter
- Parameters:
stamp
- the cell renderer component that is to be decoratedadapter
- the ComponentAdapter for this decorate operation- See Also:
-