org.jdesktop.swingx.decorator
Class EnabledHighlighter

java.lang.Object
  extended by org.jdesktop.swingx.decorator.AbstractHighlighter
      extended by org.jdesktop.swingx.decorator.EnabledHighlighter
All Implemented Interfaces:
Highlighter

public class EnabledHighlighter
extends AbstractHighlighter

A Highlighter which sets the enabled property.

Note: the enabled is a mutable property of this Highlighter which defaults to false because we assume that's the most common use case to make a rendering component look disabled when the parent is enabled. It's mutable for symmetry reasons, though the other way round - enabled looking rendering component on a disabled parent - most probably will confuse users.

Author:
Jeanette Winzenburg (slight cleanup), original contributed by swingx member martinm1000

Field Summary
 
Fields inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
listenerList
 
Constructor Summary
EnabledHighlighter()
          Instantiates a EnabledHighlighter with default enabled property (== false).
EnabledHighlighter(boolean enabled)
          Instantiates a EnabledHighlighter with the specified enabled property.
EnabledHighlighter(HighlightPredicate predicate)
          Instantiates a EnabledHighlighter with the specified HighlightPredicate and default enabled property (== false).
EnabledHighlighter(HighlightPredicate predicate, boolean enabled)
          Instantiates a EnabledHighlighter with the specified HighlightPredicate and default enabled property.
 
Method Summary
protected  java.awt.Component doHighlight(java.awt.Component renderer, ComponentAdapter adapter)
          Apply the highlights.
 boolean isEnabled()
          Returns the enabled property.
 void setEnabled(boolean enabled)
          Sets the enabled property.
 
Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
addChangeListener, areEqual, canHighlight, fireStateChanged, getChangeListeners, getHighlightPredicate, highlight, removeChangeListener, setHighlightPredicate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnabledHighlighter

public EnabledHighlighter()
Instantiates a EnabledHighlighter with default enabled property (== false). The Highlighter is applied always.


EnabledHighlighter

public EnabledHighlighter(boolean enabled)
Instantiates a EnabledHighlighter with the specified enabled property. The Highlighter is applied always.

Parameters:
enabled - the enabled property

EnabledHighlighter

public EnabledHighlighter(HighlightPredicate predicate)
Instantiates a EnabledHighlighter with the specified HighlightPredicate and default enabled property (== false).

Parameters:
predicate - the HighlightPredicate to use, may be null to default to ALWAYS.

EnabledHighlighter

public EnabledHighlighter(HighlightPredicate predicate,
                          boolean enabled)
Instantiates a EnabledHighlighter with the specified HighlightPredicate and default enabled property.

Parameters:
predicate - the HighlightPredicate to use, may be null to default to ALWAYS.
enabled - the enabled property
Method Detail

isEnabled

public boolean isEnabled()
Returns the enabled property.

Returns:
the enabled

setEnabled

public void setEnabled(boolean enabled)
Sets the enabled property. The default value is false.

Parameters:
enabled - the enabled to set

doHighlight

protected java.awt.Component doHighlight(java.awt.Component renderer,
                                         ComponentAdapter adapter)
Apply the highlights.

Implemented to set the rendering component's enabled property.

Specified by:
doHighlight in class AbstractHighlighter
Parameters:
renderer - the cell renderer component that is to be decorated
adapter - the ComponentAdapter for this decorate operation
See Also:
AbstractHighlighter.highlight(Component, ComponentAdapter)


Copyright © 2011. All Rights Reserved.