org.springframework.richclient.form.binding.swing
Class ListBinding

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.form.binding.swing.AbstractListBinding
                  extended by org.springframework.richclient.form.binding.swing.ListBinding
All Implemented Interfaces:
ControlFactory, Binding

public class ListBinding
extends AbstractListBinding


Nested Class Summary
protected  class ListBinding.SelectionListener
           
protected  class ListBinding.ValueModelListener
           
 
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
ListBinding(JList list, FormModel formModel, String formFieldPath, Class requiredSourceClass)
           
 
Method Summary
protected  Object convertSelectedValues(Object[] selectedValues)
          Converts the given values into a type that matches the fieldType
protected  int[] determineValueIndexes(Object[] values)
           
protected  void doBindControl(ListModel bindingModel)
           
protected  ListModel getDefaultModel()
           
 JList getList()
           
protected  org.springframework.binding.convert.ConversionExecutor getPropertyConversionExecutor()
          Returns a conversion executor which converts a value of the given sourceType into the fieldType
 ListCellRenderer getRenderer()
           
 int getSelectionMode()
           
protected  boolean isPropertyConversionExecutorAvailable()
           
 void setRenderer(ListCellRenderer renderer)
           
 void setSelectionMode(int selectionMode)
           
protected  void updateSelectedItemsFromSelectionModel()
           
protected  void updateSelectedItemsFromValueModel()
          Updates the selection model with the selected values from the value model.
 
Methods inherited from class org.springframework.richclient.form.binding.swing.AbstractListBinding
convertValue, createFilteredModel, createModel, createSortedListModel, doBindControl, enabledChanged, getBindingModel, getComparator, getComponent, getFilter, getFilteredModel, getSelectableItems, readOnlyChanged, selectableItemsChanged, setComparator, setFilter, setSelectableItems
 
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

ListBinding

public ListBinding(JList list,
                   FormModel formModel,
                   String formFieldPath,
                   Class requiredSourceClass)
Method Detail

getList

public JList getList()

setSelectionMode

public void setSelectionMode(int selectionMode)

getSelectionMode

public int getSelectionMode()

getPropertyConversionExecutor

protected org.springframework.binding.convert.ConversionExecutor getPropertyConversionExecutor()
Returns a conversion executor which converts a value of the given sourceType into the fieldType

Parameters:
sourceType - the sourceType
Returns:
true if a converter is available, otherwise false
See Also:
AbstractBinding.getPropertyType()

isPropertyConversionExecutorAvailable

protected boolean isPropertyConversionExecutorAvailable()

updateSelectedItemsFromSelectionModel

protected void updateSelectedItemsFromSelectionModel()

convertSelectedValues

protected Object convertSelectedValues(Object[] selectedValues)
Converts the given values into a type that matches the fieldType

Parameters:
selectedValues - the selected values
Returns:
the value which can be assigned to the type of the field

doBindControl

protected void doBindControl(ListModel bindingModel)
Specified by:
doBindControl in class AbstractListBinding

updateSelectedItemsFromValueModel

protected void updateSelectedItemsFromValueModel()
Updates the selection model with the selected values from the value model.


determineValueIndexes

protected int[] determineValueIndexes(Object[] values)
Parameters:
values -
Returns:

setRenderer

public void setRenderer(ListCellRenderer renderer)

getRenderer

public ListCellRenderer getRenderer()

getDefaultModel

protected ListModel getDefaultModel()
Specified by:
getDefaultModel in class AbstractListBinding


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