|
||||||||||
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 coordiates) while the PatternPredicate can have separate test and highlight coordiates.
Nested Class Summary |
---|
Field Summary | |
---|---|
static int |
ALL
|
static 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, NEVER, ODD, READ_ONLY, ROLLOVER_ROW |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
int |
getHighlightColumn()
|
int |
getHighlightRow()
|
Pattern |
getPattern()
|
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 |
---|
public static final int ALL
public static final String MATCH_ALL
Constructor Detail |
---|
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 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(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 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?
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 toMethod Detail |
---|
public 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 null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |