net.sf.jzeno.echo.databinding
Class DynaPickList

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by net.sf.jzeno.echo.components.CustomComponent
          extended by net.sf.jzeno.echo.databinding.AbstractDynaPickList
              extended by net.sf.jzeno.echo.databinding.DynaPickList
All Implemented Interfaces:
java.io.Serializable, BindingTarget, PropertyComponent, RebindableComponent, EventSink, EventSource, Precreation, CollectionChangeListener, Component, FastComponent, FastComponentContainer

public final class DynaPickList
extends AbstractDynaPickList
implements FastComponent, CollectionChangeListener

A component for selecting one or multiple options from a list of many. It visualizes 2 lists, left with options not yet selected, and right with options that were selected. Items can be moved between both lists by using move buttons.

A list of java beans that the user can select from can be set on this component using the setList(List) method.

You should bind this component to a property of type java.util.Collection. This collection will be filled with the selected java beans, from the list of possible java beans.

The label used to visualize the java beans on the screen can be configured with the setLabelProperty(String) method.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.jzeno.echo.databinding.AbstractDynaPickList
AbstractDynaPickList.DefaultValidator
 
Field Summary
static long serialVersionUID
           
 
Fields inherited from class net.sf.jzeno.echo.databinding.AbstractDynaPickList
addAllButton, addButton, allOptions, buttonGrid, cssButtonClass, cssButtonClassDisabled, decorator, invalidMessageKey, leftSelection, leftTitle, leftTitleText, PERCENT_UNITS, PIXEL_UNITS, removeAllButton, removeButton, rightSelection, rightTitle, rightTitleText, selectedTitle, unselectedTitle
 
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
DynaPickList()
           Creates an unbound component.
DynaPickList(java.lang.Class beanClass, java.lang.String propertyName, java.lang.String constructionHints)
           Creates a databound component.
 
Method Summary
 void applyContext()
           
 void applyStyle(Style style)
          Sets stylistic properties of this component based on a Style object.
 void changed(java.util.Collection collection)
           
 java.lang.String getEmptySelectionLabel()
           Gets the label that is shown when no item is selected (in the right-hand listbox on the screen).
 java.lang.String getLabelProperty()
           Gets the property that is shown on the screen to select.
protected  ListBoxInterface getLeftListBox()
           
 java.util.List getList()
           Gets the list of java beans that the user can select from.
 Color getListBackground()
           Gets the background color for the listboxes.
 java.lang.String getListCssClass()
           
 Color getListForeground()
           Gets the foreground (text) color for the listboxes.
 int getListVisibleRowCount()
           Gets the number of items shown in the listboxes.
protected  ListBoxInterface getRightListBox()
           
 void rebind()
           This operation causes the component to reset it's content to that of the domain model.
 void setEmptySelectionLabel(java.lang.String emptySelectionLabel)
           Sets the label that is shown when no item is selected (in the right-hand listbox on the screen).
 void setLabelProperty(java.lang.String labelProperty)
           Sets the property that is shown on the screen to select.
 void setList(java.util.List allOptions)
           Sets the list of java beans that the user can select from.
 void setListBackground(Color backGroundForBothLists)
           Sets the background color for the listboxes.
 void setListCssClass(java.lang.String newValue)
           
 void setListForeground(Color foreground)
           Sets the foreground (text) color for the listboxes.
 void setListVisibleRowCount(int numberOfRowsToShow)
           Sets the number of items shown in the listboxes.
 void setReadOnly(boolean readOnly)
           Mark this component as read-only.
 void setRequired(boolean required)
           Determine if the editor is required to be filled in.
 
Methods inherited from class net.sf.jzeno.echo.databinding.AbstractDynaPickList
addAll, addOne, getAddAllLabel, getAddLabel, getButtonHeight, getButtonWidth, getCssButtonClass, getCssButtonClassDisabled, getDecorator, getFont, getInvalidMessage, getInvalidMessageKey, getLeftComparator, getLeftSelection, getLeftWidth, getLeftWidthUnits, getRemoveAllLabel, getRemoveLabel, getRightComparator, getRightSelection, getRightWidth, getRightWidthUnits, getSelectedTitle, getUnselectedTitle, isReadOnly, preRender, removeAll, removeOne, setAddAllLabel, setAddLabel, setButtonHeight, setButtonWidth, setCssButtonClass, setCssButtonClassDisabled, setDecorator, setFocused, setFont, setInvalidMessage, setInvalidMessageKey, setLeftComparator, setLeftSelection, setLeftWidth, setLeftWidthUnits, setRemoveAllLabel, setRemoveLabel, setRightComparator, setRightSelection, setRightWidth, setRightWidthUnits, setSelectedTitle, setUnselectedTitle
 
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, removeValidator, setActionCommand, setBean, setBeanClass, setNullObject, setProperty, setValue, traceValue, validate
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, 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, 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
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

DynaPickList

public DynaPickList()

Creates an unbound component.


DynaPickList

public DynaPickList(java.lang.Class beanClass,
                    java.lang.String propertyName,
                    java.lang.String constructionHints)

Creates a databound component.

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 that the user can select from.

Specified by:
getList in class AbstractDynaPickList

setList

public void setList(java.util.List allOptions)

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


getLabelProperty

public java.lang.String getLabelProperty()

Gets the property that is shown on the screen to select. Also see setLabelProperty(String).


setLabelProperty

public void setLabelProperty(java.lang.String labelProperty)

Sets the property that is shown on the screen to select. This property (path) is specified relative to the individual java beans, specified in the list (setList(List)).


getEmptySelectionLabel

public java.lang.String getEmptySelectionLabel()

Gets the label that is shown when no item is selected (in the right-hand listbox on the screen).


setEmptySelectionLabel

public void setEmptySelectionLabel(java.lang.String emptySelectionLabel)

Sets the label that is shown when no item is selected (in the right-hand listbox on the screen).


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 AbstractDynaPickList

getListCssClass

public java.lang.String getListCssClass()

setListCssClass

public void setListCssClass(java.lang.String newValue)

setListBackground

public void setListBackground(Color backGroundForBothLists)

Sets the background color for the listboxes.


getListBackground

public Color getListBackground()

Gets the background color for the listboxes.


setListForeground

public void setListForeground(Color foreground)

Sets the foreground (text) color for the listboxes.


getListForeground

public Color getListForeground()

Gets the foreground (text) color for the listboxes.


setListVisibleRowCount

public void setListVisibleRowCount(int numberOfRowsToShow)

Sets the number of items shown in the listboxes. If more items are available scrollbars appear.


getListVisibleRowCount

public int getListVisibleRowCount()

Gets the number of items shown in the listboxes.


applyStyle

public void applyStyle(Style style)
Description copied from interface: Component
Sets stylistic properties of this component based on a Style object. The version of this method in Component will set foreground and background colors and the font from the style if they are present. Components should override this method if they allow more properties to be set from a style object, and should call super.applyStyle() if necessary.

Specified by:
applyStyle in interface Component
Overrides:
applyStyle in class AbstractDynaPickList
Parameters:
style - The style object from which to retrieve properties for this Component.

setRequired

public void setRequired(boolean required)
Description copied from interface: PropertyComponent

Determine if the editor is required to be filled in.

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

getLeftListBox

protected ListBoxInterface getLeftListBox()
Specified by:
getLeftListBox in class AbstractDynaPickList

getRightListBox

protected ListBoxInterface getRightListBox()
Specified by:
getRightListBox in class AbstractDynaPickList

applyContext

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

changed

public void changed(java.util.Collection collection)
Specified by:
changed in interface CollectionChangeListener