Class SwingEntityEditModel
- All Implemented Interfaces:
EntityEditModel
EntityEditModel
.-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.framework.model.EntityEditModel
EntityEditModel.DeleteEntities, EntityEditModel.EditEvent<T>, EntityEditModel.EditEvents, EntityEditModel.EditorValue<T>, EntityEditModel.EntityEditor, EntityEditModel.InsertEntities, EntityEditModel.UpdateEntities
-
Field Summary
Fields inherited from interface is.codion.framework.model.EntityEditModel
POST_EDIT_EVENTS
-
Constructor Summary
ConstructorsConstructorDescriptionSwingEntityEditModel
(EntityType entityType, EntityConnectionProvider connectionProvider) Instantiates a newSwingEntityEditModel
based on the given entity type. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Clears all combobox modelsfinal <T> FilterComboBoxModel
<T> comboBoxModel
(Column<T> column) Returns theFilterComboBoxModel
associated with the given column.final EntityComboBoxModel
comboBoxModel
(ForeignKey foreignKey) Returns theEntityComboBoxModel
associated with the given foreign key.protected <T> void
configureComboBoxModel
(Column<T> column, FilterComboBoxModel<T> comboBoxModel) Called when aFilterComboBoxModel
is created bycomboBoxModel(Column)
protected void
configureComboBoxModel
(ForeignKey foreignKey, EntityComboBoxModel comboBoxModel) Called when aEntityComboBoxModel
is created bycomboBoxModel(ForeignKey)
.<T> FilterComboBoxModel
<T> createComboBoxModel
(Column<T> column) Creates a combo box model containing the current values of the given column.createComboBoxModel
(ForeignKey foreignKey) Creates a newEntityComboBoxModel
for the given foreign key, override to provide a customEntityComboBoxModel
implementation.final void
initializeComboBoxModels
(Attribute<?>... attributes) Creates and refreshes combo box models for the given attributes.final void
Refreshes all combobox modelsfinal void
Refreshes all foreign key combobox modelsMethods inherited from class is.codion.framework.model.AbstractEntityEditModel
afterDelete, afterInsert, afterInsertUpdateOrDelete, afterUpdate, applyEdit, beforeDelete, beforeInsert, beforeUpdate, configureSearchModel, connection, connectionProvider, createDelete, createDelete, createInsert, createInsert, createSearchModel, createUpdate, createUpdate, delete, delete, delete, deleted, deleteEnabled, editor, entities, entityDefinition, entityType, insert, insert, insert, inserted, insertEnabled, notifyAfterDelete, notifyAfterInsert, notifyAfterUpdate, notifyBeforeDelete, notifyBeforeInsert, notifyBeforeUpdate, postEditEvents, readOnly, refresh, searchModel, toString, update, update, update, updated, updateEnabled, updateMultipleEnabled
-
Constructor Details
-
SwingEntityEditModel
Instantiates a newSwingEntityEditModel
based on the given entity type.- Parameters:
entityType
- the type of the entity to base thisSwingEntityEditModel
onconnectionProvider
- theEntityConnectionProvider
instance
-
-
Method Details
-
initializeComboBoxModels
Creates and refreshes combo box models for the given attributes. Doing this in the model constructor avoids the models being refreshed when the combo boxes using them are initialized, which usually happens on the Event Dispatch Thread.- Parameters:
attributes
- the attributes for which to initialize combo box models- See Also:
-
refreshForeignKeyComboBoxModels
public final void refreshForeignKeyComboBoxModels()Refreshes all foreign key combobox models -
refreshComboBoxModels
public final void refreshComboBoxModels()Refreshes all combobox models -
clearComboBoxModels
public final void clearComboBoxModels()Clears all combobox models -
comboBoxModel
Returns the
EntityComboBoxModel
associated with the given foreign key. If no such combo box model exists, one is created by callingcreateComboBoxModel(ForeignKey)
.This method always returns the same
EntityComboBoxModel
instance, once one has been created.- Parameters:
foreignKey
- the foreign key- Returns:
- the
EntityComboBoxModel
associated with the given foreign key - See Also:
-
comboBoxModel
Returns the
FilterComboBoxModel
associated with the given column. If no such combo box model exists, one is created by callingcreateComboBoxModel(Column)
.This method always returns the same
FilterComboBoxModel
instance, once one has been created.- Type Parameters:
T
- the value type- Parameters:
column
- the column- Returns:
- the
FilterComboBoxModel
associated with the given column - See Also:
-
createComboBoxModel
Creates a new
EntityComboBoxModel
for the given foreign key, override to provide a customEntityComboBoxModel
implementation.This default implementation returns a sorted
EntityComboBoxModel
using 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 aEntityComboBoxModel
- Returns:
- a
EntityComboBoxModel
for 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 sortedFilterComboBoxModel
using the default null item caption if the underlying column is nullable- Type Parameters:
T
- the value type- Parameters:
column
- the column- Returns:
- a combo box model based on the given column
- See Also:
-
configureComboBoxModel
Called when a
EntityComboBoxModel
is created bycomboBoxModel(ForeignKey)
.- Parameters:
foreignKey
- the foreign keycomboBoxModel
- the combo box model
-
configureComboBoxModel
Called when aFilterComboBoxModel
is created bycomboBoxModel(Column)
- Type Parameters:
T
- the column type- Parameters:
column
- the columncomboBoxModel
- the combo box model
-