org.jminor.common.ui.control
Class FormattedTextBeanValueLink
java.lang.Object
javax.swing.AbstractAction
org.jminor.common.ui.control.Control
org.jminor.common.ui.control.AbstractValueLink<Object,Object>
org.jminor.common.ui.control.AbstractBeanValueLink
org.jminor.common.ui.control.TextBeanValueLink
org.jminor.common.ui.control.FormattedTextBeanValueLink
- All Implemented Interfaces:
- ActionListener, Serializable, Cloneable, EventListener, Action, DocumentListener
- Direct Known Subclasses:
- DateBeanValueLink, TimestampBeanValueLink
public class FormattedTextBeanValueLink
- extends TextBeanValueLink
Binds a JFormattedField to a string based bean property.
- 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 |
getUIValue()
This is a very strict implementation, formatted values are considered
invalid until all placeholder characters have been replaced and null is returned |
protected String |
getValueAsString(Object value)
|
protected Object |
translate(Object parsedValue)
Provides a hook into the value setting mechanism. |
Methods inherited from class org.jminor.common.ui.control.Control |
getDescription, getEnabledState, getIcon, getMnemonic, getName, isEnabled, setDescription, setEnabled, setIcon, setKeyStroke, setMnemonic, setName |
FormattedTextBeanValueLink
public FormattedTextBeanValueLink(JFormattedTextField textComponent,
Object owner,
String propertyName,
Class<?> valueClass,
EventObserver valueChangeEvent,
LinkType linkType,
Format format)
- Instantiates a new FormattedTextBeanValueLink.
- Parameters:
textComponent
- the text component to link with the valueowner
- the value ownerpropertyName
- the property namevalueClass
- the value classvalueChangeEvent
- an EventObserver notified each time the value changeslinkType
- the link typeformat
- the format
getValueAsString
protected final String getValueAsString(Object value)
-
- Overrides:
getValueAsString
in class TextBeanValueLink
- Parameters:
value
- the value
- Returns:
- the value as a string
getUIValue
protected final Object getUIValue()
- This is a very strict implementation, formatted values are considered
invalid until all placeholder characters have been replaced and null is returned
- Overrides:
getUIValue
in class TextBeanValueLink
- Returns:
- the value, if a formatter is present, the formatted value is returned
translate
protected Object translate(Object parsedValue)
- Provides a hook into the value setting mechanism.
- Parameters:
parsedValue
- the parsed value returned from the UI component
- Returns:
- the translated value