|
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
org.jdesktop.swingx.decorator.SearchHighlighter
public class SearchHighlighter
Convenience Highlighter to test and highlight cells in searching.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jdesktop.swingx.decorator.Highlighter |
---|
Highlighter.UIHighlighter |
Field Summary |
---|
Fields inherited from class org.jdesktop.swingx.decorator.PatternHighlighter |
---|
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 | |
---|---|
SearchHighlighter()
Instantiates a default SearchHighlighter. |
|
SearchHighlighter(Color background,
Color foreground)
Instantiates a default SearchHighlighter with background/foreground colors. |
Method Summary | |
---|---|
protected Color |
computeSelectedBackground(Component renderer,
ComponentAdapter adapter)
Computes a suitable selected background for the renderer component within the specified adapter and returns the computed color. |
protected boolean |
needsHighlight(ComponentAdapter adapter)
Checks if the cell identified by the specified adapter is a potential candidate for highlighting, and returns true if so; otherwise, it returns false. |
void |
setEnabled(boolean enableHighlight)
Toggle to enable/disable - if disabled never hightlights. |
void |
setHighlightAll()
convenience method to test and highlight all rows/columns and enable. |
void |
setHighlightCell(int row,
int modelColumn)
Set's highlightRow to row, test- and highlight column = column |
void |
setHighlightRow(int row)
set the row to match in test |
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.PatternHighlighter |
---|
getPattern, setPattern, setPattern |
Methods inherited from class org.jdesktop.swingx.decorator.ConditionalHighlighter |
---|
computeSelectedForeground, doMask, getHighlightColumnIndex, getMask, getTestColumnIndex, highlight, maskBackground, maskForeground, setHighlightColumnIndex, setMask, setTestColumnIndex |
Methods inherited from class org.jdesktop.swingx.decorator.Highlighter |
---|
addChangeListener, applyBackground, applyForeground, computeBackground, computeForeground, computeSelectedBackground, computeSelectedForeground, computeUnselectedBackground, computeUnselectedForeground, doHighlight, fireStateChanged, getBackground, getChangeListeners, getForeground, getSelectedBackground, getSelectedForeground, isImmutable, removeChangeListener, setBackground, setForeground, setSelectedBackground, setSelectedForeground |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SearchHighlighter()
public SearchHighlighter(Color background, Color foreground)
background
- color of hightlight backgroundforeground
- color of highlight foregroundMethod Detail |
---|
public void setEnabled(boolean enableHighlight)
enableHighlight
- protected boolean needsHighlight(ComponentAdapter adapter)
ConditionalHighlighter
needsHighlight
in class ConditionalHighlighter
protected boolean test(ComponentAdapter adapter)
PatternHighlighter
PatternHighlighter
, and returns true if the
test succeeds; Otherwise, it returns false.
test
in class PatternHighlighter
adapter
- the current cell rendering adapter
protected Color computeSelectedBackground(Component renderer, ComponentAdapter adapter)
Computes a suitable selected background for the renderer component within the specified adapter and returns the computed color. This implementation returns super if != null, otherwise returns computeUnselectedBackground. The reason is to always show a match marker even if no selection specific colors are set. PENDING: move up to ConditionalHighlighter?
computeSelectedBackground
in class Highlighter
renderer
- adapter
-
public void setHighlightRow(int row)
row
- public void setHighlightAll()
public void setHighlightCell(int row, int modelColumn)
row
- modelColumn
-
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |