com.partnersoft.v3x.gui
Class InvalidHighlightingCellRenderer

java.lang.Object
  extended by com.partnersoft.v3x.gui.InvalidHighlightingCellRenderer
All Implemented Interfaces:
javax.swing.table.TableCellRenderer

public class InvalidHighlightingCellRenderer
extends java.lang.Object
implements javax.swing.table.TableCellRenderer

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


Constructor Summary
InvalidHighlightingCellRenderer()
           
InvalidHighlightingCellRenderer(UnaryPredicate invalidTester, UnaryPredicate newTester)
           
 
Method Summary
 UnaryPredicate getInvalidTester()
           
 UnaryPredicate getNewTester()
           
 java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
           
 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

InvalidHighlightingCellRenderer

public InvalidHighlightingCellRenderer()

InvalidHighlightingCellRenderer

public InvalidHighlightingCellRenderer(UnaryPredicate invalidTester,
                                       UnaryPredicate newTester)
Method Detail

getTableCellRendererComponent

public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
                                                        java.lang.Object value,
                                                        boolean isSelected,
                                                        boolean hasFocus,
                                                        int row,
                                                        int column)
Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer

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)