net.sf.jzeno.echo.databinding
Class DynaLargeListBox

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

public class DynaLargeListBox
extends CustomComponent
implements ListBoxInterface, EventPropagator, ListSelectionListener, Precreation, CollectionChangeListener

Allows the user to select one or more items from a list of possible items. This list is shown in a table. The items being displayed are a list of java beans (setList(List)).

When the user has selected one or more java beans from the possible options, the java beans from the original list that were selected will be written to the data binding target of this component.

You can configure this component to allow only a single selection, or to allow multiple selections (setMultiSelect(boolean)- by default false ).

If you allow only one item to be selected, you should bind this component to a property of the type corresponding to the type of the java beans in the list of all possible items.

If on the other hand you do allow multiple selection, than this component should be bound to a property of type java.util.Collection .

See Also:
Serialized Form

Nested Class Summary
 class DynaLargeListBox.DefaultValidator
           
 
Field Summary
static int PERCENT_UNITS
           
static int PIXEL_UNITS
           
 
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
DynaLargeListBox()
           Creates an unbound component.
DynaLargeListBox(java.lang.Class beanClass, java.lang.String propertyName, java.lang.String constructionHints, ConstructionList cl)
           Creates a databound component.
 
Method Summary
 void applyContext()
           
 void changed(java.util.Collection collection)
           
 void clear()
           
 void clearSelection()
           Clears any selection on the component.
 Color getBorderColor()
           Gets the color of the border (between cells).
 java.lang.String getClearButtonText()
           
 int getClearButtonWidth()
           
 java.util.Comparator getComparator()
           
 Decorator getDecorator()
          Implementation of RebindableComponent
 Color getEvenBackgroundColor()
           Gets the color that is used for the even rows in the table.
 ImageReference getFilteredIcon()
           
 Font getFont()
          Returns the font.
 int getHeightUnits()
           
 java.lang.String getInvalidMessage()
           Gets the message key that is added to the screen, when the component is marked as invalid.
 java.lang.String[] getLabelNames()
           
 java.util.List getList()
           Gets the list of java beans the user can select from.
 Color getOddBackgroundColor()
           Gets the color that is used for the odd rows in the table.
 int getPreferredRowsPerPage()
           
 Color getRolloverBackground()
           
 int getRowHeight(int row)
           
 int getRowsPerPage()
           
 java.lang.String getSearchButtonText()
           
 int getSearchButtonWidth()
           
 java.lang.String getSearchString()
           
 Color getSelectionBackground()
           
 ImageReference getUnfilteredIcon()
           
 int getWidth()
           
 int getWidthUnits()
           
 boolean isFiltered()
           
 boolean isFilterIconVisible()
          Deprecated. Just setSearchable(true/false)
 boolean isHeaderVisible()
           Gets whether or not this table has a header at the top.
 boolean isMultiSelect()
           Gets whether or not the listbox allows multiple items to be selected.
 boolean isPagerVisible()
           Gets whether or not the paging control is shown on the screen.
 boolean isReadOnly()
           
 boolean isRolloverEnabled()
           
 boolean isRowClickSelection()
           
 boolean isSearchable()
           Gets whether or not this table has a header at the top.
 boolean isSelectionHandlesShown()
           
 boolean isSorterVisible()
           
 void preRender()
           Make changes to the visual representation of this component before Echo starts rendering the component.
 void propagateEvent(ActionEvent event)
           
 void rebind()
           This operation causes the component to reset it's content to that of the domain model.
 void search()
           
 void setActionCommand(java.lang.String command)
           Sets the dynamic event handler that will be triggered when a selection is made in the table.
 void setBorderColor(Color color)
           Sets the color of the border (between cells).
 void setClearButtonText(java.lang.String s)
           
 void setClearButtonWidth(int i)
           
 void setComparator(java.util.Comparator comparator)
           
 void setDecorator(Decorator decorator)
           Sets the decorator.
 void setEvenBackgroundColor(Color evenBackgroundColor)
           Sets the color that is used for the even rows in the table.
 void setFilteredIcon(ImageReference filteredIcon)
           
 void setFilterIconVisible(boolean filterIconVisible)
          Deprecated. Just use setSearchable(true/false)
 void setFocused(boolean focused)
           Sets the input focus to this component.
 void setFont(Font font)
          Sets the font of the component.
 void setHeaderVisible(boolean headerVisible)
           Sets whether or not this table has a header at the top.
 void setHeightUnits(int heightUnits)
           
 void setInvalidMessage(java.lang.String invalidMessageKey)
           Sets the message key that is shown when the component is marked as invalid.
 void setList(java.util.List list)
           Sets the list of java beans the user can select from.
 void setMultiSelect(boolean allowMultiSelect)
           Sets whether or not the listbox allows multiple items to be selected.
 void setOddBackgroundColor(Color oddBackgroundColor)
           Sets the color that is used for the odd rows in the table.
 void setPreferredRowsPerPage(int rows)
           
 void setReadOnly(boolean readOnly)
           Mark this component as read-only.
 void setRolloverBackground(Color color)
           
 void setRolloverEnabled(boolean enabled)
           Sets whether or not moving your mouse over the rows in the table highlights that row.
 void setRowClickSelection(boolean rowClickSelects)
           Sets whether or not clicking in a row will select it.
 void setRowHeight(int row, int height)
           
 void setRowsPerPage(int rows)
           
 void setSearchable(boolean searchable)
           Sets whether or not this table has a header at the top.
 void setSearchButtonText(java.lang.String s)
           
 void setSearchButtonWidth(int i)
           
 void setSearchString(java.lang.String searchString)
           
 void setSelectionBackground(Color color)
           
 void setSelectionHandlesShown(boolean b)
           
 void setSorterIconName(java.lang.String sorterIconName)
           Sets the name of the icon to show on the multi-sort button.
 void setSorterVisible(boolean b)
           
 void setUnfilteredIcon(ImageReference unfilteredIcon)
           
 void setWidth(int width)
           
 void setWidthUnits(int widthUnits)
           
 void sort(int column, boolean ascending)
           Sorts the table ascending/descending on the specified column.
 void valueChanged(ListSelectionEvent e)
          Invoked when the a lists selection state changes.
 
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, 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
 
Methods inherited from interface net.sf.jzeno.echo.databinding.PropertyComponent
addValidator, getBean, getBeanClass, getProperty, getValidationErrors, getValidators, getValue, isMarkedInvalid, isRequired, isValid, markInvalid, markValid, removeValidator, setBean, setBeanClass, setProperty, setRequired, setValue
 

Field Detail

PIXEL_UNITS

public static final int PIXEL_UNITS
See Also:
Constant Field Values

PERCENT_UNITS

public static final int PERCENT_UNITS
See Also:
Constant Field Values
Constructor Detail

DynaLargeListBox

public DynaLargeListBox()

Creates an unbound component.


DynaLargeListBox

public DynaLargeListBox(java.lang.Class beanClass,
                        java.lang.String propertyName,
                        java.lang.String constructionHints,
                        ConstructionList cl)

Creates a databound component.

Method Detail

getList

public java.util.List getList()

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

Specified by:
getList in interface ListBoxInterface

setList

public void setList(java.util.List list)

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

Specified by:
setList in interface ListBoxInterface

search

public void search()

clear

public void clear()

getDecorator

public Decorator getDecorator()
Description copied from class: CustomComponent
Implementation of RebindableComponent

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

setDecorator

public void setDecorator(Decorator decorator)
Description copied from interface: PropertyComponent

Sets the decorator.

Specified by:
setDecorator in interface ListBoxInterface
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).

Specified by:
getInvalidMessage in interface ListBoxInterface

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).

Specified by:
setInvalidMessage in interface ListBoxInterface

isReadOnly

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

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

isMultiSelect

public boolean isMultiSelect()

Gets whether or not the listbox allows multiple items to be selected.

Specified by:
isMultiSelect in interface ListBoxInterface

setMultiSelect

public void setMultiSelect(boolean allowMultiSelect)

Sets whether or not the listbox allows multiple items to be selected.

Specified by:
setMultiSelect in interface ListBoxInterface

clearSelection

public void clearSelection()

Clears any selection on the component.

Specified by:
clearSelection in interface ListBoxInterface

setActionCommand

public void setActionCommand(java.lang.String command)

Sets the dynamic event handler that will be triggered when a selection is made in the table. If you don't want a roundtrip when a selection is made, set this property to null (this is also the default).

Specified by:
setActionCommand in interface EventSource
Overrides:
setActionCommand in class CustomComponent

setFocused

public void setFocused(boolean focused)

Sets the input focus to this component.

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

setComparator

public void setComparator(java.util.Comparator comparator)
Specified by:
setComparator in interface ListBoxInterface

getComparator

public java.util.Comparator getComparator()
Specified by:
getComparator in interface ListBoxInterface

setWidth

public void setWidth(int width)
Specified by:
setWidth in interface ListBoxInterface

getWidth

public int getWidth()
Specified by:
getWidth in interface ListBoxInterface

setWidthUnits

public void setWidthUnits(int widthUnits)
Specified by:
setWidthUnits in interface ListBoxInterface

getWidthUnits

public int getWidthUnits()
Specified by:
getWidthUnits in interface ListBoxInterface

getSearchString

public java.lang.String getSearchString()

setSearchString

public void setSearchString(java.lang.String searchString)

setFont

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

Specified by:
setFont in interface ListBoxInterface
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 ListBoxInterface
Specified by:
getFont in interface Component
Overrides:
getFont in class AbstractComponent
Returns:
The font of the component.

valueChanged

public void valueChanged(ListSelectionEvent e)
Description copied from interface: ListSelectionListener
Invoked when the a lists selection state changes.

Specified by:
valueChanged in interface ListSelectionListener
Parameters:
e - An event describing the change.

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

setRowsPerPage

public void setRowsPerPage(int rows)

getRowsPerPage

public int getRowsPerPage()

setPreferredRowsPerPage

public void setPreferredRowsPerPage(int rows)

getPreferredRowsPerPage

public int getPreferredRowsPerPage()

isPagerVisible

public boolean isPagerVisible()

Gets whether or not the paging control is shown on the screen.


setSorterVisible

public void setSorterVisible(boolean b)

isSorterVisible

public boolean isSorterVisible()

getEvenBackgroundColor

public Color getEvenBackgroundColor()

Gets the color that is used for the even rows in the table.


setEvenBackgroundColor

public void setEvenBackgroundColor(Color evenBackgroundColor)

Sets the color that is used for the even rows in the table.


getOddBackgroundColor

public Color getOddBackgroundColor()

Gets the color that is used for the odd rows in the table.


setOddBackgroundColor

public void setOddBackgroundColor(Color oddBackgroundColor)

Sets the color that is used for the odd rows in the table.


sort

public void sort(int column,
                 boolean ascending)

Sorts the table ascending/descending on the specified column.


setBorderColor

public void setBorderColor(Color color)

Sets the color of the border (between cells).


getBorderColor

public Color getBorderColor()

Gets the color of the border (between cells).


isHeaderVisible

public boolean isHeaderVisible()

Gets whether or not this table has a header at the top.


setHeaderVisible

public void setHeaderVisible(boolean headerVisible)

Sets whether or not this table has a header at the top.


isSearchable

public boolean isSearchable()

Gets whether or not this table has a header at the top.


setSearchable

public void setSearchable(boolean searchable)

Sets whether or not this table has a header at the top.


setRowClickSelection

public void setRowClickSelection(boolean rowClickSelects)

Sets whether or not clicking in a row will select it.


isRowClickSelection

public boolean isRowClickSelection()

setSorterIconName

public void setSorterIconName(java.lang.String sorterIconName)

Sets the name of the icon to show on the multi-sort button. Specify the name of the png/gif/jpg/.. you want to use. Specify the name of the gif/jpg/png/... image you want to show. Images should be located in the images folder, in the root of your web application.


getHeightUnits

public int getHeightUnits()

setHeightUnits

public void setHeightUnits(int heightUnits)

getRowHeight

public int getRowHeight(int row)

setRowHeight

public void setRowHeight(int row,
                         int height)

getLabelNames

public java.lang.String[] getLabelNames()

setRolloverBackground

public void setRolloverBackground(Color color)

getRolloverBackground

public Color getRolloverBackground()

setSelectionBackground

public void setSelectionBackground(Color color)

getSelectionBackground

public Color getSelectionBackground()

setRolloverEnabled

public void setRolloverEnabled(boolean enabled)

Sets whether or not moving your mouse over the rows in the table highlights that row.


isRolloverEnabled

public boolean isRolloverEnabled()

setSelectionHandlesShown

public void setSelectionHandlesShown(boolean b)

isSelectionHandlesShown

public boolean isSelectionHandlesShown()

setSearchButtonWidth

public void setSearchButtonWidth(int i)

getSearchButtonWidth

public int getSearchButtonWidth()

setSearchButtonText

public void setSearchButtonText(java.lang.String s)

getSearchButtonText

public java.lang.String getSearchButtonText()

setClearButtonWidth

public void setClearButtonWidth(int i)

getClearButtonWidth

public int getClearButtonWidth()

setClearButtonText

public void setClearButtonText(java.lang.String s)

getClearButtonText

public java.lang.String getClearButtonText()

propagateEvent

public void propagateEvent(ActionEvent event)
Specified by:
propagateEvent in interface EventPropagator

getFilteredIcon

public ImageReference getFilteredIcon()

setFilteredIcon

public void setFilteredIcon(ImageReference filteredIcon)

isFilterIconVisible

public boolean isFilterIconVisible()
Deprecated. Just setSearchable(true/false)


setFilterIconVisible

public void setFilterIconVisible(boolean filterIconVisible)
Deprecated. Just use setSearchable(true/false)


getUnfilteredIcon

public ImageReference getUnfilteredIcon()

setUnfilteredIcon

public void setUnfilteredIcon(ImageReference unfilteredIcon)

preRender

public void preRender()
Description copied from interface: PropertyComponent

Make changes to the visual representation of this component before Echo starts rendering the component.

Do not modify any bound javabeans in this method, as the changes to these will not be reflected properly on the screen.

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

isFiltered

public boolean isFiltered()

applyContext

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

changed

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