public class SearchPredicate extends Object implements HighlightPredicate
Note: this differs from PatternPredicate in that it is focused on the current cell (highlight coordinates == test coordinates) while the PatternPredicate can have separate test and highlight coordinates.
HighlightPredicate.AndHighlightPredicate, HighlightPredicate.ColumnHighlightPredicate, HighlightPredicate.ColumnTypeHighlightPredicate, HighlightPredicate.DepthHighlightPredicate, HighlightPredicate.EqualsHighlightPredicate, HighlightPredicate.IdentifierHighlightPredicate, HighlightPredicate.NotHighlightPredicate, HighlightPredicate.OrHighlightPredicate, HighlightPredicate.RowGroupHighlightPredicate, HighlightPredicate.TypeHighlightPredicate
Modifier and Type | Field and Description |
---|---|
static int |
ALL |
private int |
highlightColumn |
private int |
highlightRow |
static String |
MATCH_ALL |
private Pattern |
pattern |
ALWAYS, BIG_DECIMAL_NEGATIVE, EDITABLE, EMPTY_INTEGER_ARRAY, EMPTY_OBJECT_ARRAY, EMPTY_PREDICATE_ARRAY, EVEN, HAS_FOCUS, INTEGER_NEGATIVE, IS_FOLDER, IS_LEAF, IS_SELECTED, IS_TEXT_TRUNCATED, NEVER, ODD, READ_ONLY, ROLLOVER_CELL, ROLLOVER_COLUMN, ROLLOVER_ROW
Constructor and Description |
---|
SearchPredicate(Pattern pattern)
Instantiates a Predicate with the given Pattern.
|
SearchPredicate(Pattern pattern,
int column)
Instantiates a Predicate with the given Pattern.
|
SearchPredicate(Pattern pattern,
int row,
int column)
Instantiates a Predicate with the given Pattern.
|
SearchPredicate(String regex)
Instantiates a Predicate with a Pattern compiled from the given
regular expression.
|
SearchPredicate(String regex,
int column)
Instantiates a Predicate with a Pattern compiled from the given
regular expression.
|
SearchPredicate(String regex,
int row,
int column)
Instantiates a Predicate with a Pattern compiled from the given
regular expression.
|
Modifier and Type | Method and Description |
---|---|
int |
getHighlightColumn() |
int |
getHighlightRow() |
Pattern |
getPattern() |
private boolean |
isEnabled() |
private boolean |
isHighlightCandidate(Component renderer,
ComponentAdapter adapter)
A quick pre-check.
|
boolean |
isHighlighted(Component renderer,
ComponentAdapter adapter)
Returns a boolean to indicate whether the component should be
highlighted.
|
private boolean |
test(Component renderer,
ComponentAdapter adapter)
Test the value.
|
public static final int ALL
public static final String MATCH_ALL
private int highlightColumn
private int highlightRow
public SearchPredicate(Pattern pattern)
pattern
- the Pattern to test the cell value againstpublic SearchPredicate(Pattern pattern, int column)
pattern
- the Pattern to test the cell value againstcolumn
- the column to limit the highlight topublic SearchPredicate(Pattern pattern, int row, int column)
Note: the coordinates are asymmetric - 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(String regex)
regex
- the regular expression to test the cell value againstpublic SearchPredicate(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(String regex, int row, int column)
Note: the coordinates are asymmetric - 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?
regex
- 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 Pattern getPattern()
public boolean isHighlighted(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 nullprivate boolean test(Component renderer, ComponentAdapter adapter)
renderer
- adapter
- private boolean isHighlightCandidate(Component renderer, ComponentAdapter adapter)
renderer
- adapter
- private boolean isEnabled()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses