public class ComboBoxBindingBuilderImpl extends Object implements ComboBoxBindingBuilder
Examples:
binder.bind(countryComboBoxModel).to(countryCombo); binder.bind(countryComboBoxModel).to(countryFilterCombo, "(None)");
Constructor and Description |
---|
ComboBoxBindingBuilderImpl(ComboBoxModel comboBoxModel)
Creates a ComboBoxBindingBuilderImpl for the given combo box model.
|
Modifier and Type | Method and Description |
---|---|
protected ComboBoxModel |
getComboBoxModel() |
void |
to(JComboBox comboBox)
Binds this builder's ComboBoxModel to the given combo box.
|
void |
to(JComboBox comboBox,
String nullText)
Binds this builder's ComboBoxModel to the given combo box
where
null values are mapped to a special null element
that is displayed using the given nullElementText . |
public ComboBoxBindingBuilderImpl(ComboBoxModel comboBoxModel)
comboBoxModel
- provides both the data and the selectionNullPointerException
- if comboBoxModel
is null
public void to(JComboBox comboBox)
ComboBoxBindingBuilder
Example:
binder.bind(countryComboBoxModel).to(countryCombo);
to
in interface ComboBoxBindingBuilder
comboBox
- the combo box where the combo box model is set
as both data and selection model.public void to(JComboBox comboBox, String nullText)
ComboBoxBindingBuilder
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(countryComboBoxModel).to(countryCombo, "(None)");
to
in interface ComboBoxBindingBuilder
comboBox
- the combo box where the combo box model is set
as both data and selection model.nullText
- the text that represents the null
value
in the combo boxprotected final ComboBoxModel getComboBoxModel()
Copyright © 2002-2015 JGoodies Software GmbH. All Rights Reserved.