org.jminor.common.ui.control
Class ToggleBeanValueLink

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.jminor.common.ui.control.Control
          extended by org.jminor.common.ui.control.AbstractValueLink<Object,Object>
              extended by org.jminor.common.ui.control.AbstractBeanValueLink
                  extended by org.jminor.common.ui.control.ToggleBeanValueLink
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public final class ToggleBeanValueLink
extends AbstractBeanValueLink

Binds a ButtonModel to a boolean based bean property.

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
ToggleBeanValueLink(ButtonModel buttonModel, Object owner, String propertyName, EventObserver valueChangeEvent)
          Instantiates a new ToggleBeanValueLink.
ToggleBeanValueLink(ButtonModel buttonModel, Object owner, String propertyName, EventObserver valueChangeEvent, String caption)
          Instantiates a new ToggleBeanValueLink.
ToggleBeanValueLink(ButtonModel buttonModel, Object owner, String propertyName, EventObserver valueChangeEvent, String caption, LinkType linkType)
          Instantiates a new ToggleBeanValueLink.
ToggleBeanValueLink(Object owner, String propertyName, EventObserver valueChangeEvent)
          Instantiates a new ToggleBeanValueLink.
ToggleBeanValueLink(Object owner, String propertyName, EventObserver valueChangeEvent, String caption)
          Instantiates a new ToggleBeanValueLink.
ToggleBeanValueLink(Object owner, String propertyName, EventObserver valueChangeEvent, String caption, LinkType linkType)
          Instantiates a new ToggleBeanValueLink.
 
Method Summary
 ButtonModel getButtonModel()
           
protected  Object getUIValue()
          
protected  void setUIValue(Object value)
          Sets the value in the UI
 
Methods inherited from class org.jminor.common.ui.control.AbstractBeanValueLink
getModelValue, getPropertyName, 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

ToggleBeanValueLink

public ToggleBeanValueLink(Object owner,
                           String propertyName,
                           EventObserver valueChangeEvent)
Instantiates a new ToggleBeanValueLink.

Parameters:
owner - the value owner
propertyName - the property name
valueChangeEvent - an EventObserver notified each time the value changes

ToggleBeanValueLink

public ToggleBeanValueLink(Object owner,
                           String propertyName,
                           EventObserver valueChangeEvent,
                           String caption)
Instantiates a new ToggleBeanValueLink.

Parameters:
owner - the value owner
propertyName - the property name
valueChangeEvent - an EventObserver notified each time the value changes
caption - the check box caption, if any

ToggleBeanValueLink

public ToggleBeanValueLink(Object owner,
                           String propertyName,
                           EventObserver valueChangeEvent,
                           String caption,
                           LinkType linkType)
Instantiates a new ToggleBeanValueLink.

Parameters:
owner - the value owner
propertyName - the property name
valueChangeEvent - an EventObserver notified each time the value changes
caption - the check box caption, if any
linkType - the link type

ToggleBeanValueLink

public ToggleBeanValueLink(ButtonModel buttonModel,
                           Object owner,
                           String propertyName,
                           EventObserver valueChangeEvent)
Instantiates a new ToggleBeanValueLink.

Parameters:
buttonModel - the button model to link with the value
owner - the value owner
propertyName - the property name
valueChangeEvent - an EventObserver notified each time the value changes

ToggleBeanValueLink

public ToggleBeanValueLink(ButtonModel buttonModel,
                           Object owner,
                           String propertyName,
                           EventObserver valueChangeEvent,
                           String caption)
Instantiates a new ToggleBeanValueLink.

Parameters:
buttonModel - the button model to link with the value
owner - the value owner
propertyName - the property name
valueChangeEvent - an EventObserver notified each time the value changes
caption - the check box caption, if any

ToggleBeanValueLink

public ToggleBeanValueLink(ButtonModel buttonModel,
                           Object owner,
                           String propertyName,
                           EventObserver valueChangeEvent,
                           String caption,
                           LinkType linkType)
Instantiates a new ToggleBeanValueLink.

Parameters:
buttonModel - the button model to link with the value
owner - the value owner
propertyName - the property name
valueChangeEvent - an EventObserver notified each time the value changes
caption - the check box caption, if any
linkType - the link type
Method Detail

getButtonModel

public ButtonModel getButtonModel()
Returns:
the button model

getUIValue

protected Object getUIValue()

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

setUIValue

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

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