org.jminor.common.ui.valuemap
Class DoubleValueLink<K>

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.jminor.common.ui.control.Control
          extended by org.jminor.common.ui.control.AbstractValueLink<ValueChangeMapEditModel<K,V>,V>
              extended by org.jminor.common.ui.valuemap.AbstractValueMapLink<K,Object>
                  extended by org.jminor.common.ui.valuemap.TextValueLink<K>
                      extended by org.jminor.common.ui.valuemap.DoubleValueLink<K>
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public final class DoubleValueLink<K>
extends TextValueLink<K>

A class for linking a DoubleField to a ValueChangeMapEditModel double property value.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
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
 
Constructor Summary
DoubleValueLink(DoubleField textField, ValueChangeMapEditModel<K,Object> editModel, K key, boolean immediateUpdate, LinkType linkType)
          Instantiates a new DoubleValueLink.
 
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.valuemap.TextValueLink
getText, getUIValue, getValueAsText, isImmediateUpdate, setUIValue, translate
 
Methods inherited from class org.jminor.common.ui.valuemap.AbstractValueMapLink
getEditModel, getKey, getModelValue, getValidationMessage, isModelValueNull, isNullable, setModelValue
 
Methods inherited from class org.jminor.common.ui.control.AbstractValueLink
actionPerformed, getLinkType, getValueOwner, updateModel, updateUI
 
Methods inherited from class org.jminor.common.ui.control.Control
getDescription, getEnabledState, getIcon, getMnemonic, getName, isEnabled, setDescription, setEnabled, setIcon, setKeyStroke, setMnemonic, setName
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleValueLink

public DoubleValueLink(DoubleField textField,
                       ValueChangeMapEditModel<K,Object> editModel,
                       K key,
                       boolean immediateUpdate,
                       LinkType linkType)
Instantiates a new DoubleValueLink.

Parameters:
textField - the double field to link
editModel - the edit model
key - the key of the property to link
immediateUpdate - if true the model value is update on each keystroke
linkType - the link type
Method Detail

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