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

java.lang.Object
  extended by org.springframework.richclient.form.binding.support.AbstractBindingFactory
      extended by org.springframework.richclient.form.binding.swing.SwingBindingFactory
          extended by org.springframework.richclient.form.binding.swing.SandboxSwingBindingFactory
All Implemented Interfaces:
BindingFactory

public class SandboxSwingBindingFactory
extends SwingBindingFactory

A convenient extension of SwingBindingFactory. Provides a set of methods that address the typical binding requirements of Swing components in the sandbox.

In order to use this factory, specify the SandboxSwingBindingFactoryProvider as the binding factory provider in the application context. Like this:

      <bean id="bindingFactoryProvider" class="org.springframework.richclient.form.binding.swing.SandboxSwingBindingFactoryProvider" />
 

Author:
Larry Streepy

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.richclient.form.binding.swing.SwingBindingFactory
SwingBindingFactory.BeanPropertyEditorClosure
 
Constructor Summary
SandboxSwingBindingFactory(ConfigurableFormModel formModel)
          Constructor.
 
Method Summary
 Binding createBoundShuttleList(String selectionFormProperty, Object selectableItems)
          Binds the values specified in the collection contained within selectableItems (which will be wrapped in a ValueHolder to a ShuttleList, with any user selection being placed in the form property referred to by selectionFormProperty.
 Binding createBoundShuttleList(String selectionFormProperty, Object selectableItems, String renderedProperty)
          Binds the values specified in the collection contained within selectableItems (which will be wrapped in a ValueHolder to a ShuttleList, with any user selection being placed in the form property referred to by selectionFormProperty.
 Binding createBoundShuttleList(String selectionFormProperty, ValueModel selectableItemsHolder, String renderedProperty)
          Binds the values specified in the collection contained within selectableItemsHolder to a ShuttleList, with any user selection being placed in the form property referred to by selectionFormProperty.
 
Methods inherited from class org.springframework.richclient.form.binding.swing.SwingBindingFactory
createBoundCheckBox, createBoundComboBox, createBoundComboBox, createBoundComboBox, createBoundComboBox, createBoundComboBox, createBoundComboBox, createBoundFormattedTextField, createBoundFormattedTextField, createBoundLabel, createBoundList, createBoundList, createBoundList, createBoundList, createBoundList, createBoundList, createBoundListModel, createBoundSpinner, createBoundTextArea, createBoundTextArea, createBoundTextField, createBoundToggleButton
 
Methods inherited from class org.springframework.richclient.form.binding.support.AbstractBindingFactory
bindControl, bindControl, createBinding, createBinding, createBinding, createBinding, createContext, getBinderSelectionStrategy, getFormModel, interceptBinding, setBinderSelectionStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SandboxSwingBindingFactory

public SandboxSwingBindingFactory(ConfigurableFormModel formModel)
Constructor. Use specified formModel.

Parameters:
formModel -
Method Detail

createBoundShuttleList

public Binding createBoundShuttleList(String selectionFormProperty,
                                      ValueModel selectableItemsHolder,
                                      String renderedProperty)
Binds the values specified in the collection contained within selectableItemsHolder to a ShuttleList, with any user selection being placed in the form property referred to by selectionFormProperty. Each item in the list will be rendered by looking up a property on the item by the name contained in renderedProperty, retrieving the value of the property, and rendering that value in the UI.

Note that the selection in the bound list will track any changes to the selectionFormProperty. This is especially useful to preselect items in the list - if selectionFormProperty is not empty when the list is bound, then its content will be used for the initial selection.

Parameters:
selectionFormProperty - form property to hold user's selection. This property must be a Collection or array type.
selectableItemsHolder - ValueModel containing the items with which to populate the list.
renderedProperty - the property to be queried for each item in the list, the result of which will be used to render that item in the UI. May be null, in which case the selectable items will be rendered as strings.
Returns:
constructed Binding. Note that the bound control is of type ShuttleList. Access this component to set specific display properties.

createBoundShuttleList

public Binding createBoundShuttleList(String selectionFormProperty,
                                      Object selectableItems,
                                      String renderedProperty)
Binds the values specified in the collection contained within selectableItems (which will be wrapped in a ValueHolder to a ShuttleList, with any user selection being placed in the form property referred to by selectionFormProperty. Each item in the list will be rendered by looking up a property on the item by the name contained in renderedProperty, retrieving the value of the property, and rendering that value in the UI.

Note that the selection in the bound list will track any changes to the selectionFormProperty. This is especially useful to preselect items in the list - if selectionFormProperty is not empty when the list is bound, then its content will be used for the initial selection.

Parameters:
selectionFormProperty - form property to hold user's selection. This property must be a Collection or array type.
selectableItems - Collection or array containing the items with which to populate the selectable list (this object will be wrapped in a ValueHolder).
renderedProperty - the property to be queried for each item in the list, the result of which will be used to render that item in the UI. May be null, in which case the selectable items will be rendered as strings.
Returns:
constructed Binding. Note that the bound control is of type ShuttleList. Access this component to set specific display properties.

createBoundShuttleList

public Binding createBoundShuttleList(String selectionFormProperty,
                                      Object selectableItems)
Binds the values specified in the collection contained within selectableItems (which will be wrapped in a ValueHolder to a ShuttleList, with any user selection being placed in the form property referred to by selectionFormProperty. Each item in the list will be rendered as a String.

Note that the selection in the bound list will track any changes to the selectionFormProperty. This is especially useful to preselect items in the list - if selectionFormProperty is not empty when the list is bound, then its content will be used for the initial selection.

Parameters:
selectionFormProperty - form property to hold user's selection. This property must be a Collection or array type.
selectableItems - Collection or array containing the items with which to populate the selectable list (this object will be wrapped in a ValueHolder).
Returns:
constructed Binding. Note that the bound control is of type ShuttleList. Access this component to set specific display properties.


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