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

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
All Implemented Interfaces:
ControlFactory, Binding
Direct Known Subclasses:
ComboBoxBinding, ListBinding

public abstract class AbstractListBinding
extends AbstractBinding

Author:
Mathias Broekelmann

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
AbstractListBinding(JComponent component, FormModel formModel, String formPropertyPath, Class requiredSourceClass)
           
 
Method Summary
protected  Object convertValue(Object value, Class targetClass)
          Converts the given object value into the given targetClass
protected  AbstractFilteredListModel createFilteredModel(ListModel model, Constraint constraint)
           
protected  ListModel createModel()
           
protected  ListModel createSortedListModel(ListModel listModel, Comparator comparator)
           
protected  JComponent doBindControl()
           
protected abstract  void doBindControl(ListModel bindingModel)
           
protected  void enabledChanged()
          Called when the enabled state of the bound property changes.
protected  ListModel getBindingModel()
           
 Comparator getComparator()
           
 JComponent getComponent()
           
protected abstract  ListModel getDefaultModel()
           
 Constraint getFilter()
           
protected  AbstractFilteredListModel getFilteredModel()
           
 Object getSelectableItems()
           
protected  void readOnlyChanged()
          Called when the read only state of the bound property changes.
protected  void selectableItemsChanged()
           
 void setComparator(Comparator comparator)
           
 void setFilter(Constraint filter)
           
 void setSelectableItems(Object selectableItems)
           
 
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

AbstractListBinding

public AbstractListBinding(JComponent component,
                           FormModel formModel,
                           String formPropertyPath,
                           Class requiredSourceClass)
Method Detail

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

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

getSelectableItems

public Object getSelectableItems()

getComponent

public JComponent getComponent()

setSelectableItems

public final void setSelectableItems(Object selectableItems)

setComparator

public final void setComparator(Comparator comparator)

getComparator

public Comparator getComparator()

setFilter

public final void setFilter(Constraint filter)

doBindControl

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

doBindControl

protected abstract void doBindControl(ListModel bindingModel)

selectableItemsChanged

protected void selectableItemsChanged()

createModel

protected ListModel createModel()

getFilteredModel

protected AbstractFilteredListModel getFilteredModel()

getBindingModel

protected ListModel getBindingModel()

createSortedListModel

protected ListModel createSortedListModel(ListModel listModel,
                                          Comparator comparator)

createFilteredModel

protected AbstractFilteredListModel createFilteredModel(ListModel model,
                                                        Constraint constraint)

convertValue

protected Object convertValue(Object value,
                              Class targetClass)
                       throws org.springframework.binding.convert.ConversionException
Converts the given object value into the given targetClass

Parameters:
value - the value to convert
targetClass - the target class to convert the value to
Returns:
the converted value
Throws:
org.springframework.binding.convert.ConversionException - if the value can not be converted

getDefaultModel

protected abstract ListModel getDefaultModel()

getFilter

public Constraint getFilter()


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