|
||||||||||
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 |
---|
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
|
static String |
MATCH_ALL
|
Fields inherited from interface org.jdesktop.swingx.decorator.HighlightPredicate |
---|
ALWAYS, EDITABLE, EVEN, NEVER, ODD, 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. |
Method Summary | |
---|---|
int |
getHighlightColumn()
|
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 toMethod Detail |
---|
public boolean isHighlighted(Component renderer, ComponentAdapter adapter)
isHighlighted
in interface HighlightPredicate
renderer
- the cell renderer component that is to be decoratedadapter
- the ComponentAdapter for this decorate operation
public int getHighlightColumn()
public Pattern getPattern()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |