org.jdesktop.swingx.decorator
Class SearchHighlighter

java.lang.Object
  extended by org.jdesktop.swingx.decorator.AbstractHighlighter
      extended by org.jdesktop.swingx.decorator.LegacyHighlighter
          extended by org.jdesktop.swingx.decorator.ConditionalHighlighter
              extended by org.jdesktop.swingx.decorator.PatternHighlighter
                  extended by org.jdesktop.swingx.decorator.SearchHighlighter
All Implemented Interfaces:
Highlighter, PatternMatcher

Deprecated. use AbstractHighligther with SearchPredicate

public class SearchHighlighter
extends PatternHighlighter

Convenience LegacyHighlighter to test and highlight cells in searching.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jdesktop.swingx.decorator.LegacyHighlighter
LegacyHighlighter.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.LegacyHighlighter
immutable, ledgerBackground, notePadBackground
 
Fields inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
listenerList
 
Constructor Summary
SearchHighlighter()
          Deprecated. Instantiates a default SearchHighlighter.
SearchHighlighter(Color background, Color foreground)
          Deprecated. Instantiates a default SearchHighlighter with background/foreground colors.
 
Method Summary
protected  Color computeSelectedBackground(Component renderer, ComponentAdapter adapter)
          Deprecated. Computes a suitable selected background for the renderer component within the specified adapter and returns the computed color.
protected  boolean needsHighlight(ComponentAdapter adapter)
          Deprecated. 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)
          Deprecated. Toggle to enable/disable - if disabled never hightlights.
 void setHighlightAll()
          Deprecated. convenience method to test and highlight all rows/columns and enable.
 void setHighlightCell(int row, int modelColumn)
          Deprecated. Set's highlightRow to row, test- and highlight column = column.
 void setHighlightRow(int row)
          Deprecated. set the row to match in test.
protected  boolean test(ComponentAdapter adapter)
          Deprecated. 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.LegacyHighlighter
addChangeListener, applyBackground, applyForeground, computeBackground, computeForeground, computeSelectedBackground, computeSelectedForeground, computeUnselectedBackground, computeUnselectedForeground, doHighlight, getBackground, getForeground, getSelectedBackground, getSelectedForeground, isImmutable, setBackground, setForeground, setSelectedBackground, setSelectedForeground
 
Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
fireStateChanged, getChangeListeners, getHighlightPredicate, removeChangeListener, setHighlightPredicate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchHighlighter

public SearchHighlighter()
Deprecated. 
Instantiates a default SearchHighlighter. The default colors are Yellow background and null foreground. The default matching state is Pattern == null, flags = 0, tests all columns and all rows.


SearchHighlighter

public SearchHighlighter(Color background,
                         Color foreground)
Deprecated. 
Instantiates a default SearchHighlighter with background/foreground colors. The default matching state is Pattern == null, flags = 0, tests all columns and all rows.

Parameters:
background - color of hightlight background
foreground - color of highlight foreground
Method Detail

setEnabled

public void setEnabled(boolean enableHighlight)
Deprecated. 
Toggle to enable/disable - if disabled never hightlights.

Parameters:
enableHighlight - flag to indicate highlight enablement

needsHighlight

protected boolean needsHighlight(ComponentAdapter adapter)
Deprecated. 
Checks if the cell identified by the specified adapter is a potential candidate for highlighting, and returns true if so; otherwise, it returns false.

Overrides:
needsHighlight in class ConditionalHighlighter
Returns:
true if the cell identified by the specified adapter needs highlight; false otherwise

test

protected boolean test(ComponentAdapter adapter)
Deprecated. 
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.

Overrides:
test in class PatternHighlighter
Parameters:
adapter - the current cell rendering adapter
Returns:
true if the test succeeds; false otherwise

computeSelectedBackground

protected Color computeSelectedBackground(Component renderer,
                                          ComponentAdapter adapter)
Deprecated. 

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?

Overrides:
computeSelectedBackground in class LegacyHighlighter
Parameters:
renderer - the component to highlight
adapter - the componentAdapter using the component as renderer
Returns:
the background color to use for selected adapter state

setHighlightRow

public void setHighlightRow(int row)
Deprecated. 
set the row to match in test.

Parameters:
row - the row to highlight if match is true, - 1 means all.

setHighlightAll

public void setHighlightAll()
Deprecated. 
convenience method to test and highlight all rows/columns and enable.


setHighlightCell

public void setHighlightCell(int row,
                             int modelColumn)
Deprecated. 
Set's highlightRow to row, test- and highlight column = column. As a side-effect the highlight is enabled.

Parameters:
row - the row to highlight if match is true, - 1 means all rows.
modelColumn - the column to use for both test and highlight, -1 means all columns