Class AbstractEntityEditor.DefaultComboBoxModels<F extends EntityComboBoxModel,C extends FilterComboBoxModel<?>>
- Type Parameters:
F- the foreign key based combo box model typeC- the column based combo box model type
- All Implemented Interfaces:
EntityEditor.ComboBoxModels
- Enclosing class:
AbstractEntityEditor<R extends AbstractEntityEditor<R>>
Parameterized on the two combo box model families so toolkit layers can narrow the foreign key based
models (F) and the map accessors without re-casting: a Swing subclass simply parameterizes this
with its toolkit types and only the column based get/create need narrowing overrides (Java
can't express "the C family at element type T" as a type parameter).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncolumn()Returns the column based combo box models initialized viaEntityEditor.ComboBoxModels.get(Column).<T> FilterComboBoxModel<T> Creates a combo box model containing the current values of the given column.create(ForeignKey foreignKey) Creates a newEntityComboBoxModelfor the given foreign key.Returns the foreign key based combo box models initialized viaEntityEditor.ComboBoxModels.get(ForeignKey).<T> FilterComboBoxModel<T> Returns theFilterComboBoxModelassociated with the given column.get(ForeignKey foreignKey) Returns theEntityComboBoxModelassociated with the given foreign key.final voidinitialize(Attribute<?>... attributes) Creates and refreshes combo box models for the given attributes.
-
Constructor Details
-
DefaultComboBoxModels
- Parameters:
editor- the editor
-
-
Method Details
-
foreignKey
Description copied from interface:EntityEditor.ComboBoxModelsReturns the foreign key based combo box models initialized viaEntityEditor.ComboBoxModels.get(ForeignKey).- Specified by:
foreignKeyin interfaceEntityEditor.ComboBoxModels- Returns:
- an unmodifiable view of the foreign key based combo box models
-
column
Description copied from interface:EntityEditor.ComboBoxModelsReturns the column based combo box models initialized viaEntityEditor.ComboBoxModels.get(Column).- Specified by:
columnin interfaceEntityEditor.ComboBoxModels- Returns:
- an unmodifiable view of the column based combo box models
-
initialize
Description copied from interface:EntityEditor.ComboBoxModelsCreates and refreshes combo box models for the given attributes. Doing this in an edit model constructor avoids the models being refreshed when the combo boxes using them are initialized- Specified by:
initializein interfaceEntityEditor.ComboBoxModels- Parameters:
attributes- the attributes for which to initialize combo box models- See Also:
-
get
Description copied from interface:EntityEditor.ComboBoxModelsReturns the
EntityComboBoxModelassociated with the given foreign key. If no such combo box model exists, one is created by callingEntityEditor.ComboBoxModels.create(ForeignKey).This method always returns the same
EntityComboBoxModelinstance, once one has been created.- Specified by:
getin interfaceEntityEditor.ComboBoxModels- Parameters:
foreignKey- the foreign key- Returns:
- the
EntityComboBoxModelassociated with the given foreign key - See Also:
-
get
Description copied from interface:EntityEditor.ComboBoxModelsReturns the
FilterComboBoxModelassociated with the given column. If no such combo box model exists, one is created by callingEntityEditor.ComboBoxModels.create(Column).This method always returns the same
FilterComboBoxModelinstance, once one has been created.- Specified by:
getin interfaceEntityEditor.ComboBoxModels- Type Parameters:
T- the value type- Parameters:
column- the column- Returns:
- the
FilterComboBoxModelassociated with the given column - See Also:
-
create
Description copied from interface:EntityEditor.ComboBoxModelsCreates a new
EntityComboBoxModelfor the given foreign key.- Specified by:
createin interfaceEntityEditor.ComboBoxModels- Parameters:
foreignKey- the foreign key for which to create aEntityComboBoxModel- Returns:
- a
EntityComboBoxModelfor the given foreign key - See Also:
-
create
Description copied from interface:EntityEditor.ComboBoxModelsCreates a combo box model containing the current values of the given column.- Specified by:
createin interfaceEntityEditor.ComboBoxModels- Type Parameters:
T- the value type- Parameters:
column- the column- Returns:
- a combo box model based on the given column
- See Also:
-