|
||||||||||
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<T,V>
T
- the type of the value ownerV
- the type of the valuepublic abstract class AbstractValueLink<T,V>
An abstract base class for linking a UI component to a model 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 | |
---|---|
AbstractValueLink(T valueOwner,
EventObserver modelValueChangeEvent,
LinkType linkType)
Instantiates a new AbstractValueLink |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
LinkType |
getLinkType()
|
abstract V |
getModelValue()
|
protected abstract V |
getUIValue()
|
T |
getValueOwner()
|
abstract void |
setModelValue(V value)
Sets the value in the model |
protected abstract void |
setUIValue(V value)
Sets the value in the UI |
void |
updateModel()
Updates the model according to the UI. |
void |
updateUI()
Updates the UI according to the model. |
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 AbstractValueLink(T valueOwner, EventObserver modelValueChangeEvent, LinkType linkType)
valueOwner
- the owner of the property valuemodelValueChangeEvent
- an Event on which the UI should be updated to reflect changes in the modellinkType
- the link TypeMethod Detail |
---|
public final void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
actionPerformed
in class Control
public final T getValueOwner()
public final LinkType getLinkType()
public final void updateModel()
public final void updateUI()
public abstract V getModelValue()
public abstract void setModelValue(V value)
value
- the value to set for propertyprotected abstract V getUIValue()
protected abstract void setUIValue(V value)
value
- the value to represent in the UI
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |