org.jdesktop.swingx.decorator
Class PatternPredicate

java.lang.Object
  extended by org.jdesktop.swingx.decorator.PatternPredicate
All Implemented Interfaces:
HighlightPredicate

public class PatternPredicate
extends Object
implements HighlightPredicate

Pattern based HighlightPredicate.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jdesktop.swingx.decorator.HighlightPredicate
HighlightPredicate.AndHighlightPredicate, HighlightPredicate.ColumnHighlightPredicate, HighlightPredicate.DepthHighlightPredicate, HighlightPredicate.EqualsHighlightPredicate, HighlightPredicate.NotHighlightPredicate, HighlightPredicate.OrHighlightPredicate, HighlightPredicate.RowGroupHighlightPredicate
 
Field Summary
static int ALL
           
 
Fields inherited from interface org.jdesktop.swingx.decorator.HighlightPredicate
ALWAYS, EDITABLE, EVEN, NEVER, ODD, ROLLOVER_ROW
 
Constructor Summary
PatternPredicate(Pattern pattern, int testColumn)
          Instantiates a Predicate with the given Pattern and testColumn index (in model coordinates) highlighting all columns.
PatternPredicate(Pattern pattern, int testColumn, int decorateColumn)
          Instantiates a Predicate with the given Pattern and test-/decorate column index in model coordinates.
 
Method Summary
 int getHighlightColumn()
           
 Pattern getPattern()
           
 int getTestColumn()
           
 boolean isHighlighted(Component renderer, ComponentAdapter adapter)
          Returns a boolean to indicate whether the component should be highlighted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
See Also:
Constant Field Values
Constructor Detail

PatternPredicate

public PatternPredicate(Pattern pattern,
                        int testColumn)
Instantiates a Predicate with the given Pattern and testColumn index (in model coordinates) highlighting all columns. A column index of -1 is interpreted as "all". (PENDING: search forum for the exact definition, legacy base pattern and search behave differently?)

Parameters:
pattern - the Pattern to test the cell value against
testColumn - the column index of the cell which contains the value to test against the pattern

PatternPredicate

public PatternPredicate(Pattern pattern,
                        int testColumn,
                        int decorateColumn)
Instantiates a Predicate with the given Pattern and test-/decorate column index in model coordinates. A column index of -1 is interpreted as "all". (PENDING: search forum for the exact definition, legacy base pattern and search behave differently?)

Parameters:
pattern - the Pattern to test the cell value against
testColumn - the column index of the cell which contains the value to test against the pattern
highlightColumn - the column index of the cell which should be decorated if the test against the value succeeds.
Method Detail

isHighlighted

public boolean isHighlighted(Component renderer,
                             ComponentAdapter adapter)
Description copied from interface: HighlightPredicate
Returns a boolean to indicate whether the component should be highlighted.

Specified by:
isHighlighted in interface HighlightPredicate
Parameters:
renderer - the cell renderer component that is to be decorated
adapter - the ComponentAdapter for this decorate operation
Returns:
a boolean to indicate whether the component should be highlighted.

getHighlightColumn

public int getHighlightColumn()
Returns:
returns the column index to decorate (in model coordinates)

getPattern

public Pattern getPattern()
Returns:
returns the Pattern to test the cell value against

getTestColumn

public int getTestColumn()
Returns:
the column to use for testing (in model coordinates)