org.jminor.common.ui.valuemap
Class ValueLinkValidators

java.lang.Object
  extended by org.jminor.common.ui.valuemap.ValueLinkValidators

public final class ValueLinkValidators
extends Object

A factory class for adding validators to components.


Method Summary
static
<K> void
addValidator(TextValueLink<K> valueLink, JTextComponent textComponent, ValueChangeMapEditModel<K,Object> editModel)
          Adds a validator to the given text component, based on the given value link and edit model
static
<K> void
addValidator(TextValueLink<K> valueLink, JTextComponent textComponent, ValueChangeMapEditModel<K,Object> editModel, Color validBackgroundColor, Color invalidBackgroundColor, String defaultToolTip)
          Adds a validator to the given text component, based on the given value link and edit model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addValidator

public static <K> void addValidator(TextValueLink<K> valueLink,
                                    JTextComponent textComponent,
                                    ValueChangeMapEditModel<K,Object> editModel)
Adds a validator to the given text component, based on the given value link and edit model

Type Parameters:
K - the type of the edit model value keys
Parameters:
valueLink - the value link
textComponent - the text component
editModel - the edit model

addValidator

public static <K> void addValidator(TextValueLink<K> valueLink,
                                    JTextComponent textComponent,
                                    ValueChangeMapEditModel<K,Object> editModel,
                                    Color validBackgroundColor,
                                    Color invalidBackgroundColor,
                                    String defaultToolTip)
Adds a validator to the given text component, based on the given value link and edit model

Type Parameters:
K - the type of the edit model value keys
Parameters:
valueLink - the value link
textComponent - the text component
editModel - the edit model
validBackgroundColor - the background color indicating a valid value
invalidBackgroundColor - the background color indicating in invalid value
defaultToolTip - the tooltip to use while the value is valid