net.sf.jzeno.echo.databinding
Class DynaRadioButtonList

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by net.sf.jzeno.echo.components.CustomComponent
          extended by net.sf.jzeno.echo.databinding.DynaRadioButtonList
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, BindingTarget, PropertyComponent, RebindableComponent, EventSink, EventSource, Precreation, Component, ActionListener, ItemListener, FastComponent, FastComponentContainer

public class DynaRadioButtonList
extends CustomComponent
implements ItemListener, FastComponent, ActionListener, Precreation

Displays a list of radio buttons, with labels, from which the user can select one option.

A list of possible java beans to select from can be set using the setList(List) method. These java beans will be represented on the screen with a label. This label is determined using the setLabelProperty(String) method.

See Also:
Serialized Form

Nested Class Summary
 class DynaRadioButtonList.DefaultValidator
           
 
Field Summary
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
DynaRadioButtonList()
           
DynaRadioButtonList(java.lang.Class beanClass, java.lang.String propertyName, java.lang.String constructionHints)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
          Invoked when an action occurs.
 void applyContext()
           
 int getColumns()
           
 java.util.Comparator getComparator()
           
 Decorator getDecorator()
           Gets the Decorator instance that is used to decorate the labels on the radio buttons.
 Font getFont()
          Returns the font.
 java.lang.String getInvalidMessage()
           Gets the message key that is added to the screen, when the component is marked as invalid.
 java.lang.String getLabelProperty()
           Gets the property (path) that determines what label is shown for the individual java beans in the list of possible java beans.
 java.util.List getList()
           Gets the list of java beans the user can select from.
 boolean isReadOnly()
           
 void itemStateChanged(ItemEvent event)
           Used internally.
 void rebind()
           This operation causes the component to reset it's content to that of the domain model.
 void setActionCommand(java.lang.String actionCommand)
           
 void setColumns(int columns)
           Sets the number of radio buttons that are displayed in a single row.
 void setComparator(java.util.Comparator comparator)
           
 void setDecorator(Decorator decorator)
           Sets the Decorator instance that is used to decorate the labels on the radio buttons.
 void setFocused(boolean newValue)
          Sets whether the component is focused.
 void setFocused(java.lang.Object key, boolean newValue)
           
 void setFont(Font font)
          Sets the font of the component.
 void setInvalidMessage(java.lang.String invalidMessageKey)
           Sets the message key that is shown when the component is marked as invalid.
 void setLabelProperty(java.lang.String labelProperty)
           Sets the property (path) that determines what label is shown for the individual java beans in the list of possible java beans.
 void setList(java.util.List list)
           Sets the list of java beans the user can select from.
 void setNoTabStop(boolean noTabStop)
           
 void setReadOnly(boolean readOnly)
           Mark this component as read-only.
 
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isRequired, isValid, markInvalid, markValid, preRender, removeValidator, setBean, setBeanClass, setNullObject, setProperty, setRequired, setValue, traceValue, validate
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, applyStyle, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getForeground, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setClientId, setEnabled, setForeground, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynaRadioButtonList

public DynaRadioButtonList()

DynaRadioButtonList

public DynaRadioButtonList(java.lang.Class beanClass,
                           java.lang.String propertyName,
                           java.lang.String constructionHints)
Method Detail

rebind

public void rebind()
Description copied from interface: RebindableComponent

This operation causes the component to reset it's content to that of the domain model.

Specified by:
rebind in interface RebindableComponent
Overrides:
rebind in class CustomComponent

getList

public java.util.List getList()

Gets the list of java beans the user can select from.


setList

public void setList(java.util.List list)

Sets the list of java beans the user can select from.


getLabelProperty

public java.lang.String getLabelProperty()

Gets the property (path) that determines what label is shown for the individual java beans in the list of possible java beans.


setLabelProperty

public void setLabelProperty(java.lang.String labelProperty)

Sets the property (path) that determines what label is shown for the individual java beans in the list of possible java beans.


getDecorator

public Decorator getDecorator()

Gets the Decorator instance that is used to decorate the labels on the radio buttons.

Specified by:
getDecorator in interface PropertyComponent
Overrides:
getDecorator in class CustomComponent

setDecorator

public void setDecorator(Decorator decorator)

Sets the Decorator instance that is used to decorate the labels on the radio buttons.

Specified by:
setDecorator in interface PropertyComponent
Overrides:
setDecorator in class CustomComponent

getInvalidMessage

public java.lang.String getInvalidMessage()

Gets the message key that is added to the screen, when the component is marked as invalid. Also see setInvalidMessage(String).


setInvalidMessage

public void setInvalidMessage(java.lang.String invalidMessageKey)

Sets the message key that is shown when the component is marked as invalid. Typically the component is marked invalid when you call EchoSupport.doValidationRecursively(Component) in your code. The value specified for this property is translated through the i18n support in jZeno (i18n.properties).


isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface PropertyComponent
Overrides:
isReadOnly in class CustomComponent

setColumns

public void setColumns(int columns)

Sets the number of radio buttons that are displayed in a single row. If not specified, the number of columns defaults to 1 (every radio button on a new line).


getColumns

public int getColumns()

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from interface: PropertyComponent

Mark this component as read-only.

Specified by:
setReadOnly in interface PropertyComponent
Overrides:
setReadOnly in class CustomComponent

itemStateChanged

public void itemStateChanged(ItemEvent event)

Used internally.

Specified by:
itemStateChanged in interface ItemListener
Parameters:
event - An event describing the selection.

setComparator

public void setComparator(java.util.Comparator comparator)

getComparator

public java.util.Comparator getComparator()

setActionCommand

public void setActionCommand(java.lang.String actionCommand)
Specified by:
setActionCommand in interface EventSource
Overrides:
setActionCommand in class CustomComponent

actionPerformed

public void actionPerformed(ActionEvent e)
Description copied from interface: ActionListener
Invoked when an action occurs.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - The event describing the action.

setFont

public void setFont(Font font)
Description copied from interface: Component
Sets the font of the component.

Specified by:
setFont in interface Component
Overrides:
setFont in class AbstractComponent
Parameters:
font - The new font of the component.

getFont

public Font getFont()
Description copied from interface: Component
Returns the font.

Specified by:
getFont in interface Component
Overrides:
getFont in class AbstractComponent
Returns:
The font of the component.

setNoTabStop

public void setNoTabStop(boolean noTabStop)

setFocused

public void setFocused(boolean newValue)
Description copied from interface: Component
Sets whether the component is focused.

Specified by:
setFocused in interface Component
Overrides:
setFocused in class AbstractComponent
Parameters:
newValue - True if the component is to be focused.

setFocused

public void setFocused(java.lang.Object key,
                       boolean newValue)

applyContext

public void applyContext()
Specified by:
applyContext in interface Precreation