org.jminor.common.ui.valuemap
Class IntValueLink<K>
java.lang.Object
javax.swing.AbstractAction
org.jminor.common.ui.control.Control
org.jminor.common.ui.control.AbstractValueLink<ValueChangeMapEditModel<K,V>,V>
org.jminor.common.ui.valuemap.AbstractValueMapLink<K,Object>
org.jminor.common.ui.valuemap.TextValueLink<K>
org.jminor.common.ui.valuemap.IntValueLink<K>
- All Implemented Interfaces:
- ActionListener, Serializable, Cloneable, EventListener, Action
public final class IntValueLink<K>
- extends TextValueLink<K>
A class for linking a IntField to a ValueChangeMapEditor int key value.
- See Also:
- Serialized Form
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Method Summary |
protected Object |
getValueFromText(String text)
Returns a property value based on the given text, if the text can not
be parsed into a valid value, null is returned |
Methods inherited from class org.jminor.common.ui.control.Control |
getDescription, getEnabledState, getIcon, getMnemonic, getName, isEnabled, setDescription, setEnabled, setIcon, setKeyStroke, setMnemonic, setName |
IntValueLink
public IntValueLink(IntField textField,
ValueChangeMapEditModel<K,Object> editModel,
K key,
boolean immediateUpdate,
LinkType linkType)
- Instantiates a new IntValueLink.
- Parameters:
textField
- the int field to linkeditModel
- the edit modelkey
- the key of the property to linkimmediateUpdate
- if true the model value is update on each keystrokelinkType
- the link type
getValueFromText
protected Object getValueFromText(String text)
- Returns a property value based on the given text, if the text can not
be parsed into a valid value, null is returned
- Overrides:
getValueFromText
in class TextValueLink<K>
- Parameters:
text
- the text from which to parse a value
- Returns:
- a value, null if the input text has zero length or if it does not yield a valid value