public class SelectionInListBindingBuilderImpl extends Object implements SelectionInListBindingBuilder
Examples:
binder.bind(countrySelectionInList).to(countryCombo); binder.bind(countrySelectionInList).to(countryFilterCombo, "(None)"); binder.bind(contactSelectionInList).to(contactList); binder.bind(contactSelectionInList).to(contactTable);
Constructor and Description |
---|
SelectionInListBindingBuilderImpl(SelectionInList<?> selectionInList)
Creates a SelectionInListBindingBuilderImpl for the given selection in list.
|
SelectionInListBindingBuilderImpl(SelectionInList<?> selectionInList,
String propertyName)
Creates a SelectionInListBindingBuilderImpl for the given selection in list.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getPropertyName() |
protected SelectionInList |
getSelectionInList() |
protected void |
setValidationMessageKey(JComponent comp)
Sets this builder's property name - if any - as the component's
validation message key.
|
void |
to(JComboBox comboBox)
Binds this builder's SelectionInList to the given combo box.
|
void |
to(JComboBox comboBox,
String nullText)
Binds this builder's SelectionInList to the given combo box
where
null values are mapped to a special null element
that is displayed using the given nullElementText . |
void |
to(JList list)
Binds this builder's SelectionInList to the given list.
|
void |
to(JTable table)
Binds this builder's SelectionInList to the given table.
|
public SelectionInListBindingBuilderImpl(SelectionInList<?> selectionInList)
selectionInList
- provides both the data and the selectionNullPointerException
- if selectionInList
is null
public SelectionInListBindingBuilderImpl(SelectionInList<?> selectionInList, String propertyName)
selectionInList
- provides both the data and the selectionpropertyName
- an optional bean property name that has
been used to create selectionInList
. Used to set
a validation message key for combo boxes.NullPointerException
- if selectionInList
is null
IllegalArgumentException
- if propertyName
is empty or whitespacepublic void to(JComboBox comboBox)
SelectionInListBindingBuilder
Example:
binder.bind(countrySelectionInList).to(countryCombo);
to
in interface SelectionInListBindingBuilder
comboBox
- the combo box where the SelectionInList is set
as both data and selection model.public void to(JComboBox comboBox, String nullText)
SelectionInListBindingBuilder
null
values are mapped to a special null element
that is displayed using the given nullElementText
.Note that the Microsoft User Experience Guide (UX Guide) recommends to enclose meta-options in parentheses, e.g. "(None)".
Example:
binder.bind(countrySelectionInList).to(countryCombo, "(None)");
to
in interface SelectionInListBindingBuilder
comboBox
- the combo box where the SelectionInList is set
as both data and selection model.nullText
- the text that represents the null
value
in the combo boxpublic void to(JList list)
SelectionInListBindingBuilder
Example:
binder.bind(contactSelectionInList).to(contactList);
to
in interface SelectionInListBindingBuilder
list
- the list where the SelectionInList is set
as both data and selection model.public void to(JTable table)
SelectionInListBindingBuilder
Example:
binder.bind(contactSelectionInList).to(contactTable);
to
in interface SelectionInListBindingBuilder
table
- the table where the SelectionInList is set
as both data and selection model.protected final SelectionInList getSelectionInList()
protected final String getPropertyName()
protected final void setValidationMessageKey(JComponent comp)
comp
- the component where the validation message key shall be setCopyright © 2002-2015 JGoodies Software GmbH. All Rights Reserved.