|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.form.binding.support.AbstractBindingFactory
org.springframework.richclient.form.binding.swing.SwingBindingFactory
public class SwingBindingFactory
A convenient implementation of BindingFactory
. Provides a set
of methods that address the typical binding requirements of Swing based
forms.
Nested Class Summary | |
---|---|
protected static class |
SwingBindingFactory.BeanPropertyEditorClosure
|
Constructor Summary | |
---|---|
SwingBindingFactory(FormModel formModel)
|
Method Summary | |
---|---|
Binding |
createBoundCheckBox(String formProperty)
|
Binding |
createBoundComboBox(String formProperty)
|
Binding |
createBoundComboBox(String formProperty,
Object selectableItems)
|
Binding |
createBoundComboBox(String formProperty,
Object selectableItems,
String renderedProperty)
|
Binding |
createBoundComboBox(String formProperty,
String selectableItemsProperty,
String renderedItemProperty)
|
Binding |
createBoundComboBox(String formProperty,
ValueModel selectableItemsHolder)
|
Binding |
createBoundComboBox(String formProperty,
ValueModel selectableItemsHolder,
String renderedProperty)
|
Binding |
createBoundFormattedTextField(String formProperty)
|
Binding |
createBoundFormattedTextField(String formProperty,
JFormattedTextField.AbstractFormatterFactory formatterFactory)
|
Binding |
createBoundLabel(String formProperty)
|
Binding |
createBoundList(String formProperty)
|
Binding |
createBoundList(String selectionFormProperty,
Object selectableItems)
Binds the values specified in the collection contained within selectableItems to a JList , with any
user selection being placed in the form property referred to by
selectionFormProperty . |
Binding |
createBoundList(String selectionFormProperty,
Object selectableItems,
String renderedProperty)
|
Binding |
createBoundList(String selectionFormProperty,
Object selectableItems,
String renderedProperty,
Integer forceSelectMode)
Binds the value(s) specified in selectableItems to
a JList , with any
user selection being placed in the form property referred to by
selectionFormProperty . |
Binding |
createBoundList(String selectionFormProperty,
ValueModel selectableItemsHolder)
Binds the values specified in the collection contained within selectableItemsHolder to a JList , with any
user selection being placed in the form property referred to by
selectionFormProperty . |
Binding |
createBoundList(String selectionFormProperty,
ValueModel selectableItemsHolder,
String renderedProperty)
Binds the values specified in the collection contained within selectableItemsHolder to a JList , with any
user selection being placed in the form property referred to by
selectionFormProperty . |
ObservableList |
createBoundListModel(String formProperty)
Deprecated. |
Binding |
createBoundSpinner(String formProperty)
|
Binding |
createBoundTextArea(String formProperty)
|
Binding |
createBoundTextArea(String formProperty,
int rows,
int columns)
|
Binding |
createBoundTextField(String formProperty)
|
Binding |
createBoundToggleButton(String formProperty)
|
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 |
---|
public SwingBindingFactory(FormModel formModel)
Method Detail |
---|
public Binding createBoundTextField(String formProperty)
public Binding createBoundTextArea(String formProperty)
public Binding createBoundTextArea(String formProperty, int rows, int columns)
public Binding createBoundFormattedTextField(String formProperty)
public Binding createBoundFormattedTextField(String formProperty, JFormattedTextField.AbstractFormatterFactory formatterFactory)
public Binding createBoundSpinner(String formProperty)
public Binding createBoundLabel(String formProperty)
public Binding createBoundToggleButton(String formProperty)
public Binding createBoundCheckBox(String formProperty)
public Binding createBoundComboBox(String formProperty)
public Binding createBoundComboBox(String formProperty, Object selectableItems)
formProperty
- the property to be boundselectableItems
- a Collection or array containing the list of items
that may be selectedpublic Binding createBoundComboBox(String formProperty, ValueModel selectableItemsHolder)
public Binding createBoundComboBox(String formProperty, String selectableItemsProperty, String renderedItemProperty)
public Binding createBoundComboBox(String formProperty, Object selectableItems, String renderedProperty)
public Binding createBoundComboBox(String formProperty, ValueModel selectableItemsHolder, String renderedProperty)
public ObservableList createBoundListModel(String formProperty)
public Binding createBoundList(String formProperty)
public Binding createBoundList(String selectionFormProperty, Object selectableItems)
selectableItems
to a JList
, 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. This method uses default behavior to
determine the selection mode of the resulting JList
:
if selectionFormProperty
refers to a
Collection
type property, then
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION
will
be used, otherwise
ListSelectionModel.SINGLE_SELECTION
will be used.
selectionFormProperty
- form property to hold user's selection.
This property must either be compatible
with the item objects contained in
selectableItemsHolder
(in
which case only single selection makes
sense), or must be a
Collection
type, which allows
for multiple selection.selectableItems
- a Collection or array containing the items
with which to populate the list.
public Binding createBoundList(String selectionFormProperty, Object selectableItems, String renderedProperty)
public Binding createBoundList(String selectionFormProperty, ValueModel selectableItemsHolder, String renderedProperty)
selectableItemsHolder
to a JList
, 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. This method uses default behavior to
determine the selection mode of the resulting JList
:
if selectionFormProperty
refers to a
Collection
type property, then
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION
will
be used, otherwise
ListSelectionModel.SINGLE_SELECTION
will be used.
selectionFormProperty
- form property to hold user's selection.
This property must either be compatible
with the item objects contained in
selectableItemsHolder
(in
which case only single selection makes
sense), or must be a
Collection
type, which allows
for multiple selection.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
public Binding createBoundList(String selectionFormProperty, ValueModel selectableItemsHolder)
selectableItemsHolder
to a JList
, 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. This method uses default behavior to
determine the selection mode of the resulting JList
:
if selectionFormProperty
refers to a
Collection
type property, then
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION
will
be used, otherwise
ListSelectionModel.SINGLE_SELECTION
will be used.
selectionFormProperty
- form property to hold user's selection.
This property must either be compatible
with the item objects contained in
selectableItemsHolder
(in
which case only single selection makes
sense), or must be a
Collection
type, which allows
for multiple selection.selectableItemsHolder
- ValueModel
containing the
items with which to populate the list.
public Binding createBoundList(String selectionFormProperty, Object selectableItems, String renderedProperty, Integer forceSelectMode)
selectableItems
to
a JList
, 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.
selectionFormProperty
- form property to hold user's selection.
This property must either be compatible
with the item objects contained in
selectableItemsHolder
(in
which case only single selection makes
sense), or must be a
Collection
type, which allows
for multiple selection.selectableItems
- Object
containing the
item(s) with which to populate the list.
Can be an instance Collection, Object[],
a ValueModel or ObjectrenderedProperty
- 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.forceSelectMode
- forces the list selection mode. Must be
one of the constants defined in
ListSelectionModel
or
null
for default behavior.
If null
, then
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION
will be used if
selectionFormProperty
refers
to a Collection
type
property, otherwise
ListSelectionModel.SINGLE_SELECTION
will be used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |