HighlightPredicate
public class SearchPredicate extends java.lang.Object implements HighlightPredicate
Note: this differs from PatternPredicate in that it is focused on the current cell (highlight coordinates == test coordiates) while the PatternPredicate can have separate test and highlight coordiates.
HighlightPredicate.AndHighlightPredicate, HighlightPredicate.ColumnHighlightPredicate, HighlightPredicate.DepthHighlightPredicate, HighlightPredicate.EqualsHighlightPredicate, HighlightPredicate.IdentifierHighlightPredicate, HighlightPredicate.NotHighlightPredicate, HighlightPredicate.OrHighlightPredicate, HighlightPredicate.RowGroupHighlightPredicate, HighlightPredicate.TypeHighlightPredicate
Modifier and Type | Field | Description |
---|---|---|
static int |
ALL |
|
static java.lang.String |
MATCH_ALL |
ALWAYS, BIG_DECIMAL_NEGATIVE, EDITABLE, EMPTY_INTEGER_ARRAY, EMPTY_OBJECT_ARRAY, EMPTY_PREDICATE_ARRAY, EVEN, HAS_FOCUS, INTEGER_NEGATIVE, IS_FOLDER, IS_LEAF, NEVER, ODD, READ_ONLY, ROLLOVER_ROW
Constructor | Description |
---|---|
SearchPredicate(java.lang.String regex) |
Instantiates a Predicate with a Pattern compiled from the given
regular expression.
|
SearchPredicate(java.lang.String regex,
int column) |
Instantiates a Predicate with a Pattern compiled from the given
regular expression.
|
SearchPredicate(java.lang.String regex,
int row,
int column) |
Instantiates a Predicate with a Pattern compiled from the given
regular expression.
|
SearchPredicate(java.util.regex.Pattern pattern) |
Instantiates a Predicate with the given Pattern.
|
SearchPredicate(java.util.regex.Pattern pattern,
int column) |
Instantiates a Predicate with the given Pattern.
|
SearchPredicate(java.util.regex.Pattern pattern,
int row,
int column) |
Instantiates a Predicate with the given Pattern.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getHighlightColumn() |
|
int |
getHighlightRow() |
|
java.util.regex.Pattern |
getPattern() |
|
boolean |
isHighlighted(java.awt.Component renderer,
ComponentAdapter adapter) |
Returns a boolean to indicate whether the component should be
highlighted.
|
public static final int ALL
public static final java.lang.String MATCH_ALL
public SearchPredicate(java.util.regex.Pattern pattern)
pattern
- the Pattern to test the cell value againstpublic SearchPredicate(java.util.regex.Pattern pattern, int column)
pattern
- the Pattern to test the cell value againstcolumn
- the column to limit the highlight topublic SearchPredicate(java.util.regex.Pattern pattern, int row, int column)
Note: the coordinates are asymetric - rows are in view- and column in model-coordinates - due to corresponding methods in ComponentAdapter. Hmm... no need to? This happens on the current adapter state which is view always, so could use view only?
pattern
- the Pattern to test the cell value againstrow
- the row index in view coordinates to limit the
highlight.column
- the column in model coordinates
to limit the highlight topublic SearchPredicate(java.lang.String regex)
regex
- the regular expression to test the cell value againstpublic SearchPredicate(java.lang.String regex, int column)
regex
- the regular expression to test the cell value againstcolumn
- the column index in model coordinates to limit the highlight topublic SearchPredicate(java.lang.String regex, int row, int column)
Note: the coordinates are asymetric - rows are in view- and column in model-coordinates - due to corresponding methods in ComponentAdapter. Hmm... no need to? This happens on the current adapter state which is view always, so could use view only?
pattern
- the Pattern to test the cell value againstrow
- the row index in view coordinates to limit the
highlight.column
- the column in model coordinates
to limit the highlight topublic int getHighlightColumn()
public int getHighlightRow()
public java.util.regex.Pattern getPattern()
public boolean isHighlighted(java.awt.Component renderer, ComponentAdapter adapter)
Note: both parameters should be considered strictly read-only!
isHighlighted
in interface HighlightPredicate
renderer
- the cell renderer component that is to be decorated,
must not be nulladapter
- the ComponentAdapter for this decorate operation,
most not be null