Package org.jdesktop.swingx.decorator
Class ToolTipHighlighter
java.lang.Object
org.jdesktop.swingx.decorator.AbstractHighlighter
org.jdesktop.swingx.decorator.ToolTipHighlighter
- All Implemented Interfaces:
Highlighter
A highlighter for setting a tool tip on the component.
- Author:
- kschaefer
-
Field Summary
Fields inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
listenerList
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a ToolTipHighlighter with null StringValue.ToolTipHighlighter
(HighlightPredicate predicate) Instantiates a ToolTipHighlighter with the specified HighlightPredicate and a null StringValue.ToolTipHighlighter
(HighlightPredicate predicate, StringValue toolTipValue) Instantiates a ToolTipHighlighter with the specified HighlightPredicate and StringValue.ToolTipHighlighter
(StringValue toolTipValue) Instantiates a ToolTipHighlighter with the specified StringValue. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canHighlight
(Component component, ComponentAdapter adapter) Subclasses may override to further limit the highlighting based on Highlighter state, f.i. a PainterHighlighter can only be applied to PainterAware components.protected Component
doHighlight
(Component component, ComponentAdapter adapter) Apply the highlights.Returns the StringValue used for decoration.void
setToolTipValue
(StringValue toolTipValue) Sets the StringValue used for decoration.Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
addChangeListener, areEqual, fireStateChanged, getChangeListeners, getHighlightPredicate, highlight, removeChangeListener, setHighlightPredicate
-
Constructor Details
-
ToolTipHighlighter
public ToolTipHighlighter()Instantiates a ToolTipHighlighter with null StringValue. The Highlighter is applied always. -
ToolTipHighlighter
Instantiates a ToolTipHighlighter with the specified StringValue. The Highlighter is applied always.- Parameters:
toolTipValue
- the StringValue used to create the tool tip
-
ToolTipHighlighter
Instantiates a ToolTipHighlighter with the specified HighlightPredicate and a null StringValue.- Parameters:
predicate
- the HighlightPredicate to use, may be null to default to ALWAYS.
-
ToolTipHighlighter
Instantiates a ToolTipHighlighter with the specified HighlightPredicate and StringValue.- Parameters:
predicate
- the HighlightPredicate to use, may be null to default to ALWAYS.toolTipValue
- the StringValue used to create the tool tip
-
-
Method Details
-
getToolTipValue
Returns the StringValue used for decoration.- Returns:
- the StringValue used for decoration
- See Also:
-
setToolTipValue
Sets the StringValue used for decoration. May be null to use default decoration.- Parameters:
toolTipValue
- StringValue- See Also:
-
canHighlight
Subclasses may override to further limit the highlighting based on Highlighter state, f.i. a PainterHighlighter can only be applied to PainterAware components.This implementation returns true always.
Implemented to return false if the component is not a JComponent.
- Overrides:
canHighlight
in classAbstractHighlighter
- Parameters:
component
- the cell renderer component that is to be decoratedadapter
- a Component Adapter- Returns:
- a boolean indication if the adapter can be highlighted based general state. This implementation returns true always.
-
doHighlight
Apply the highlights.- Specified by:
doHighlight
in classAbstractHighlighter
- Parameters:
component
- the cell renderer component that is to be decoratedadapter
- the ComponentAdapter for this decorate operation- Returns:
- Component
component
- See Also:
-