com.partnersoft.v3x.gui
Class InvalidHighlightingListCellRenderer

java.lang.Object
  extended by com.partnersoft.v3x.gui.InvalidHighlightingListCellRenderer
All Implemented Interfaces:
javax.swing.ListCellRenderer

public class InvalidHighlightingListCellRenderer
extends java.lang.Object
implements javax.swing.ListCellRenderer

A cell renderer that renders a text value in red if it fails a configurable test.


Constructor Summary
InvalidHighlightingListCellRenderer()
           
InvalidHighlightingListCellRenderer(UnaryPredicate invalidTester, UnaryPredicate newTester)
           
 
Method Summary
 UnaryPredicate getInvalidTester()
           
 java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean hasFocus)
           
 UnaryPredicate getNewTester()
           
 boolean isNew(java.lang.Object value)
          Feel free to either override this method or supply a UnaryPredicate as the test property.
 void setInvalidTester(UnaryPredicate newInvalidTester)
           
 void setNewTester(UnaryPredicate newNewTester)
           
 boolean validate(java.lang.Object value)
          Feel free to either override this method or supply a UnaryPredicate as the test property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvalidHighlightingListCellRenderer

public InvalidHighlightingListCellRenderer()

InvalidHighlightingListCellRenderer

public InvalidHighlightingListCellRenderer(UnaryPredicate invalidTester,
                                           UnaryPredicate newTester)
Method Detail

getListCellRendererComponent

public java.awt.Component getListCellRendererComponent(javax.swing.JList list,
                                                       java.lang.Object value,
                                                       int index,
                                                       boolean isSelected,
                                                       boolean hasFocus)
Specified by:
getListCellRendererComponent in interface javax.swing.ListCellRenderer

validate

public boolean validate(java.lang.Object value)
Feel free to either override this method or supply a UnaryPredicate as the test property. By default, this method tries to apply the test property, but with inline classes it might be simpler just to override this method.


isNew

public boolean isNew(java.lang.Object value)
Feel free to either override this method or supply a UnaryPredicate as the test property. By default, this method tries to apply the test property, but with inline classes it might be simpler just to override this method.


getInvalidTester

public UnaryPredicate getInvalidTester()

setInvalidTester

public void setInvalidTester(UnaryPredicate newInvalidTester)

getNewTester

public UnaryPredicate getNewTester()

setNewTester

public void setNewTester(UnaryPredicate newNewTester)