org.jminor.common.ui.valuemap
Class ComboBoxValueLink<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.ComboBoxValueLink<K>
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
EntityUiUtil.EntityComboBoxValueLink

public class ComboBoxValueLink<K>
extends AbstractValueMapLink<K,Object>

A class for linking a ComboBox to a ValueChangeMapEditModel 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
ComboBoxValueLink(JComboBox comboBox, ValueChangeMapEditModel<K,Object> editModel, K property)
          Instantiate a new ComboBoxValueLink
ComboBoxValueLink(JComboBox comboBox, ValueChangeMapEditModel<K,Object> editModel, K property, LinkType linkType, boolean isString)
          Instantiate a new ComboBoxValueLink
 
Method Summary
protected  ComboBoxModel getModel()
           
protected  Object getUIValue()
          
protected  void setUIValue(Object value)
          Sets the value in the UI
 
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

ComboBoxValueLink

public ComboBoxValueLink(JComboBox comboBox,
                         ValueChangeMapEditModel<K,Object> editModel,
                         K property)
Instantiate a new ComboBoxValueLink

Parameters:
comboBox - the combo box to link
editModel - the ValueChangeMapEditModel instance
property - the property to link to

ComboBoxValueLink

public ComboBoxValueLink(JComboBox comboBox,
                         ValueChangeMapEditModel<K,Object> editModel,
                         K property,
                         LinkType linkType,
                         boolean isString)
Instantiate a new ComboBoxValueLink

Parameters:
comboBox - the combo box to link
editModel - the ValueChangeMapEditModel instance
property - the property to link to
linkType - the link type
isString - true if the underlying value is string based
Method Detail

getUIValue

protected final Object getUIValue()

Specified by:
getUIValue in class AbstractValueLink<ValueChangeMapEditModel<K,Object>,Object>
Returns:
the value according to the UI

setUIValue

protected final void setUIValue(Object value)
Sets the value in the UI

Specified by:
setUIValue in class AbstractValueLink<ValueChangeMapEditModel<K,Object>,Object>
Parameters:
value - the value to represent in the UI

getModel

protected final ComboBoxModel getModel()
Returns:
the underlying combo box model