|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.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>
public class TextValueLink<K>
A class for linking a text component to a ValueChangeMapEditModel text property value.
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 | |
---|---|
TextValueLink(JTextComponent textComponent,
ValueChangeMapEditModel<K,Object> editModel,
K key,
boolean immediateUpdate)
Instantiates a new TextValueLink |
|
TextValueLink(JTextComponent textComponent,
ValueChangeMapEditModel<K,Object> editModel,
K key,
boolean immediateUpdate,
LinkType linkType)
Instantiates a new TextValueLink |
Method Summary | |
---|---|
protected String |
getText()
|
protected Object |
getUIValue()
|
protected String |
getValueAsText(Object value)
Returns a String representation of the given value object, null is returned in case of a null value |
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 |
boolean |
isImmediateUpdate()
|
protected void |
setUIValue(Object value)
Sets the value in the UI |
protected String |
translate(String text)
Provides a hook into the value setting mechanism. |
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 |
---|
public TextValueLink(JTextComponent textComponent, ValueChangeMapEditModel<K,Object> editModel, K key, boolean immediateUpdate)
textComponent
- the text component to linkeditModel
- the ValueChangeMapEditModel instancekey
- the key to linkimmediateUpdate
- if true then the underlying model value is updated on each keystroke,public TextValueLink(JTextComponent textComponent, ValueChangeMapEditModel<K,Object> editModel, K key, boolean immediateUpdate, LinkType linkType)
textComponent
- the text component to linkeditModel
- the ValueChangeMapEditModel instancekey
- the key to linkimmediateUpdate
- if true then the underlying model value is updated on each keystroke,
otherwise it is updated on actionPerformed or focusLostlinkType
- the link typeMethod Detail |
---|
public final boolean isImmediateUpdate()
protected final Object getUIValue()
getUIValue
in class AbstractValueLink<ValueChangeMapEditModel<K,Object>,Object>
protected final void setUIValue(Object value)
setUIValue
in class AbstractValueLink<ValueChangeMapEditModel<K,Object>,Object>
value
- the value to represent in the UIprotected final String getText()
protected String translate(String text)
text
- the value returned from the UI component
protected Object getValueFromText(String text) throws ParseException
text
- the text from which to parse a value
ParseException
- in case the value could not be parsed from the textprotected String getValueAsText(Object value)
value
- the value to return as String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |