|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.decorator.Highlighter
org.jdesktop.swingx.decorator.ConditionalHighlighter
org.jdesktop.swingx.decorator.PatternHighlighter
public class PatternHighlighter
PatternHighlighter
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jdesktop.swingx.decorator.Highlighter |
---|
Highlighter.UIHighlighter |
Field Summary | |
---|---|
protected Pattern |
pattern
|
Fields inherited from class org.jdesktop.swingx.decorator.ConditionalHighlighter |
---|
highlightColumn, mask, testColumn |
Fields inherited from class org.jdesktop.swingx.decorator.Highlighter |
---|
changeEvent, immutable, ledgerBackground, listenerList, notePadBackground |
Constructor Summary | |
---|---|
PatternHighlighter()
Constructs a PatternHighlighter instance with no
background or foreground color and no pattern |
|
PatternHighlighter(Color background,
Color foreground,
String regExString,
int matchFlags,
int testColumn)
Constructs a PatternHighlighter instance with the
specified background and foreground colors that will be used to decorate
the renderer component for all cell in a row if and only if the specified
regExString defines a valid Pattern , and the
value of the cell in the specified testColumn of that row matches that
pattern. |
|
PatternHighlighter(Color background,
Color foreground,
String regExString,
int matchFlags,
int testColumn,
int decorateColumn)
Constructs a PatternHighlighter instance with the
specified background and foreground colors that will be used to decorate
the renderer component for a cell in the specified decorateColumn of any
row if and only if the specified regExString and matchFlags define a
valid Pattern , and the value of the cell in the
specified testColumn of the same row matches that pattern. |
Method Summary | |
---|---|
Pattern |
getPattern()
Returns the pattern used by this cell decorator for matching against a cell's value to determine if the conditions for cell decoration are met. |
void |
setPattern(Pattern pattern)
Sets the pattern used by this cell decorator to match against a cell's value to determine if the conditions for cell decoration are met. |
void |
setPattern(String regularExpr,
int matchFlags)
|
protected boolean |
test(ComponentAdapter adapter)
Tests whether the string representation of the value of the cell identified by the specified adapter matches the pattern, if any, that is set for this PatternHighlighter , and returns true if the
test succeeds; Otherwise, it returns false. |
Methods inherited from class org.jdesktop.swingx.decorator.ConditionalHighlighter |
---|
computeSelectedForeground, doMask, getHighlightColumnIndex, getMask, getTestColumnIndex, highlight, maskBackground, maskForeground, needsHighlight, setHighlightColumnIndex, setMask, setTestColumnIndex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Pattern pattern
Constructor Detail |
---|
public PatternHighlighter()
PatternHighlighter
instance with no
background or foreground color and no pattern
public PatternHighlighter(Color background, Color foreground, String regExString, int matchFlags, int testColumn) throws PatternSyntaxException
Constructs a PatternHighlighter
instance with the
specified background and foreground colors that will be used to decorate
the renderer component for all cell in a row if and only if the specified
regExString defines a valid Pattern
, and the
value of the cell in the specified testColumn of that row matches that
pattern.
background
- background color for decorated cells, or null, if background
should not be changedforeground
- foreground color for decorated cells, or null, if foreground
should not be changedregExString
- the regular expression string to compile, or null to leave the
pattern undefinedtestColumn
- column to which the pattern matching test is applied; must be
a valid column index in model coordinates
PatternSyntaxException
- if regExString is not null, but it does not define a valid
Pattern
Pattern
public PatternHighlighter(Color background, Color foreground, String regExString, int matchFlags, int testColumn, int decorateColumn) throws PatternSyntaxException
Constructs a PatternHighlighter
instance with the
specified background and foreground colors that will be used to decorate
the renderer component for a cell in the specified decorateColumn of any
row if and only if the specified regExString and matchFlags define a
valid Pattern
, and the value of the cell in the
specified testColumn of the same row matches that pattern.
background
- background color for decorated cells, or null, if background
should not be changedforeground
- foreground color for decorated cells, or null, if foreground
should not be changedregExString
- the regular expression string to compile, or null to leave the
pattern undefinedmatchFlags
- a bit mask that may include
Pattern.CASE_INSENSITIVE
,
Pattern.MULTILINE
,
Pattern.DOTALL
,
Pattern.UNICODE_CASE
, and
Pattern.CANON_EQ
testColumn
- column to which the pattern matching test is applied; must be
a valid column index in model coordinatesdecorateColumn
- column to which decorator attributes will be applied; may be a
valid column index in model coordinates, or -1 to indicate all
columns
PatternSyntaxException
- if regExString is not null, but regExString and matchFlags do
not define a valid Pattern
Pattern
Method Detail |
---|
protected boolean test(ComponentAdapter adapter)
PatternHighlighter
, and returns true if the
test succeeds; Otherwise, it returns false.
test
in class ConditionalHighlighter
adapter
- the current cell rendering adapter
public Pattern getPattern()
getPattern
in interface PatternMatcher
Pattern
public void setPattern(String regularExpr, int matchFlags)
public void setPattern(Pattern pattern)
setPattern
in interface PatternMatcher
pattern
- the pattern used by this cell decorator for matchingPattern
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |