Package is.codion.swing.framework.model
Class SwingEntityEditor.SwingComponentModels
java.lang.Object
is.codion.framework.model.DefaultEntityEditor.DefaultComponentModels
is.codion.swing.framework.model.SwingEntityEditor.SwingComponentModels
- All Implemented Interfaces:
EntityEditor.ComponentModels
- Enclosing class:
SwingEntityEditor
public static class SwingEntityEditor.SwingComponentModels
extends DefaultEntityEditor.DefaultComponentModels
A DefaultEntityEditor.DefaultComponentModels extension providing foreign key based
EntityComboBoxModel and column based FilterComboBoxModel.
Override to customize combo box model behaviour.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> voidconfigure(Column<T> column, FilterComboBoxModel<T> comboBoxModel, SwingEntityEditor editor) Called when aFilterComboBoxModelis created bySwingEntityEditor.ComboBoxModels.get(Column)voidconfigure(ForeignKey foreignKey, EntityComboBoxModel comboBoxModel, SwingEntityEditor editor) Called when aEntityComboBoxModelis created bySwingEntityEditor.ComboBoxModels.get(ForeignKey).<T> FilterComboBoxModel<T> createComboBoxModel(Column<T> column, SwingEntityEditor editor) Creates a combo box model containing the current values of the given column.createComboBoxModel(ForeignKey foreignKey, SwingEntityEditor editor) Creates a newEntityComboBoxModelfor the given foreign key, override to provide a customEntityComboBoxModelimplementation.Methods inherited from class is.codion.framework.model.DefaultEntityEditor.DefaultComponentModels
createSearchModelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface is.codion.framework.model.EntityEditor.ComponentModels
configure
-
Constructor Details
-
SwingComponentModels
public SwingComponentModels()
-
-
Method Details
-
createComboBoxModel
Creates a new
EntityComboBoxModelfor the given foreign key, override to provide a customEntityComboBoxModelimplementation.This default implementation returns a sorted
EntityComboBoxModelusing the default null item caption if the underlying attribute is nullable.If the foreign key has select attributes defined, those are set in the combo box model.
- Parameters:
foreignKey- the foreign key for which to create aEntityComboBoxModeleditor- the editor- Returns:
- a
EntityComboBoxModelfor the given foreign key - See Also:
-
createComboBoxModel
Creates a combo box model containing the current values of the given column. This default implementation returns a sortedFilterComboBoxModelusing the default null item caption if the underlying column is nullable- Type Parameters:
T- the value type- Parameters:
column- the columneditor- the editor- Returns:
- a combo box model based on the given column
- See Also:
-
configure
public void configure(ForeignKey foreignKey, EntityComboBoxModel comboBoxModel, SwingEntityEditor editor) Called when a
EntityComboBoxModelis created bySwingEntityEditor.ComboBoxModels.get(ForeignKey).- Parameters:
foreignKey- the foreign keycomboBoxModel- the combo box modeleditor- the editor
-
configure
public <T> void configure(Column<T> column, FilterComboBoxModel<T> comboBoxModel, SwingEntityEditor editor) Called when aFilterComboBoxModelis created bySwingEntityEditor.ComboBoxModels.get(Column)- Type Parameters:
T- the column type- Parameters:
column- the columncomboBoxModel- the combo box modeleditor- the editor
-