|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swingx.decorator.SearchPredicate
public class SearchPredicate
Pattern based HighlightPredicate for searching. Highlights the current adapter cell if the value matches the pattern. The highlight scope can be limited to a certain column and row.
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.
| Nested Class Summary |
|---|
| Field Summary | |
|---|---|
static int |
ALL
|
static java.lang.String |
MATCH_ALL
|
| Fields inherited from interface org.jdesktop.swingx.decorator.HighlightPredicate |
|---|
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 Summary | |
|---|---|
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. |
|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ALL
public static final java.lang.String MATCH_ALL
| Constructor Detail |
|---|
public SearchPredicate(java.util.regex.Pattern pattern)
pattern - the Pattern to test the cell value against
public SearchPredicate(java.util.regex.Pattern pattern,
int column)
pattern - the Pattern to test the cell value againstcolumn - the column to limit the highlight to
public SearchPredicate(java.util.regex.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(java.lang.String regex)
regex - the regular expression to test the cell value against
public 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 to
public SearchPredicate(java.lang.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 to| Method Detail |
|---|
public 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 HighlightPredicaterenderer - the cell renderer component that is to be decorated,
must not be nulladapter - the ComponentAdapter for this decorate operation,
most not be null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||