org.springframework.richclient.components
Class ShuttleListBinding

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.factory.AbstractControlFactory
          extended by org.springframework.richclient.form.binding.support.AbstractBinding
              extended by org.springframework.richclient.components.ShuttleListBinding
All Implemented Interfaces:
ControlFactory, Binding

public class ShuttleListBinding
extends AbstractBinding

Binding to manage a ShuttleList component.

Author:
lstreepy

Field Summary
 
Fields inherited from class org.springframework.richclient.form.binding.support.AbstractBinding
fieldMetadata, formModel, formPropertyPath
 
Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
logger
 
Constructor Summary
ShuttleListBinding(ShuttleList list, FormModel formModel, String formPropertyPath)
          Construct a binding.
 
Method Summary
protected  boolean arraysEqual(Object[] a1, Object[] a2)
          Compare two arrays for equality using the configured comparator.
protected  boolean collectionsEqual(Collection a1, Collection a2)
          Compare two collections for equality using the configured comparator.
protected  JComponent doBindControl()
           
protected  void enabledChanged()
          Called when the enabled state of the bound property changes.
protected  Class getConcreteSelectedType()
           
protected  String getFormId()
           
 ListCellRenderer getRenderer()
           
protected  Class getSelectedItemType()
           
protected  int indexOf(Object o)
           
protected  int[] indicesOf(Object itemSet)
          Return an array of indices in the selectableItems for each element in the provided set.
protected  boolean isSelectedItemACollection()
           
protected  boolean isSelectedItemAnArray()
          Determine if the selected item type can be multi-valued (is a collection or an array.
protected  void readOnlyChanged()
          Called when the read only state of the bound property changes.
 void setComparator(Comparator comparator)
           
protected  void setFormId(String formId)
           
 void setModel(ListModel model)
           
 void setRenderer(ListCellRenderer renderer)
           
 void setSelectableItemsHolder(ValueModel selectableItemsHolder)
           
 void setSelectedItemsHolder(ValueModel selectedItemsHolder)
           
 void setSelectedItemType(Class selectedItemType)
           
protected  void setSelectedValue(PropertyChangeListener silentValueChangeHandler)
           
protected  void updateSelectionHolderFromList(PropertyChangeListener silentValueChangeHandler)
           
 
Methods inherited from class org.springframework.richclient.form.binding.support.AbstractBinding
createControl, getFieldFace, getFormModel, getProperty, getPropertyType, getValue, getValueModel, isEnabled, isReadOnly
 
Methods inherited from class org.springframework.richclient.factory.AbstractControlFactory
createControlIfNecessary, getControl, isControlCreated, isSingleton, setSingleton
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.richclient.form.binding.Binding
getControl
 

Constructor Detail

ShuttleListBinding

public ShuttleListBinding(ShuttleList list,
                          FormModel formModel,
                          String formPropertyPath)
Construct a binding.

Parameters:
list - ShuttleList to bind
formModel - The form model holding the bound property
formPropertyPath - Path to the property to bind
Method Detail

setComparator

public void setComparator(Comparator comparator)

setModel

public void setModel(ListModel model)

setRenderer

public void setRenderer(ListCellRenderer renderer)

getRenderer

public ListCellRenderer getRenderer()

setSelectableItemsHolder

public void setSelectableItemsHolder(ValueModel selectableItemsHolder)

setSelectedItemsHolder

public void setSelectedItemsHolder(ValueModel selectedItemsHolder)

setSelectedItemType

public void setSelectedItemType(Class selectedItemType)

getSelectedItemType

protected Class getSelectedItemType()

doBindControl

protected JComponent doBindControl()
Specified by:
doBindControl in class AbstractBinding

isSelectedItemAnArray

protected boolean isSelectedItemAnArray()
Determine if the selected item type can be multi-valued (is a collection or an array.

Returns:
boolean true if the selectedItemType is a Collection or an Array.

isSelectedItemACollection

protected boolean isSelectedItemACollection()

getConcreteSelectedType

protected Class getConcreteSelectedType()

setSelectedValue

protected void setSelectedValue(PropertyChangeListener silentValueChangeHandler)

indicesOf

protected int[] indicesOf(Object itemSet)
Return an array of indices in the selectableItems for each element in the provided set. The set can be either a Collection or an Array.

Parameters:
itemSet - Either an array or a Collection of items
Returns:
array of indices of the elements in itemSet within the selectableItems

indexOf

protected int indexOf(Object o)

updateSelectionHolderFromList

protected void updateSelectionHolderFromList(PropertyChangeListener silentValueChangeHandler)

arraysEqual

protected boolean arraysEqual(Object[] a1,
                              Object[] a2)
Compare two arrays for equality using the configured comparator.

Parameters:
a1 - First array to compare
a2 - Second array to compare
Returns:
boolean true if they are equal

collectionsEqual

protected boolean collectionsEqual(Collection a1,
                                   Collection a2)
Compare two collections for equality using the configured comparator. Element order must be the same for the collections to compare equal.

Parameters:
a1 - First collection to compare
a2 - Second collection to compare
Returns:
boolean true if they are equal

readOnlyChanged

protected void readOnlyChanged()
Description copied from class: AbstractBinding
Called when the read only state of the bound property changes.

Specified by:
readOnlyChanged in class AbstractBinding
See Also:
FormPropertyState

enabledChanged

protected void enabledChanged()
Description copied from class: AbstractBinding
Called when the enabled state of the bound property changes.

Specified by:
enabledChanged in class AbstractBinding
See Also:
FormPropertyState

getFormId

protected String getFormId()
Returns:
Returns the formId.

setFormId

protected void setFormId(String formId)
Parameters:
formId - The formId to set.


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.