Package is.codion.swing.framework.model
Class SwingEntityEditor
java.lang.Object
is.codion.framework.model.AbstractEntityEditor<SwingEntityEditor>
is.codion.swing.framework.model.SwingEntityEditor
- All Implemented Interfaces:
EntityEditor<SwingEntityEditor>
A Swing
AbstractEntityEditor implementation.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceManages the combo box models used by aSwingEntityEditor.static interfaceASwingEntityEditor.SwingComponentModelsextension providing foreign key basedSwingEntityComboBoxModeland column basedSwingFilterComboBoxModel.Nested classes/interfaces inherited from class is.codion.framework.model.AbstractEntityEditor
AbstractEntityEditor.DefaultComboBoxModels<F extends EntityComboBoxModel,C extends FilterComboBoxModel<?>> Nested classes/interfaces inherited from interface is.codion.framework.model.EntityEditor
EntityEditor.ComboBoxModels, EntityEditor.ComponentModels, EntityEditor.DetailEditors<R extends EntityEditor<R>>, EntityEditor.EditorEntity, EntityEditor.EditorPersistence, EntityEditor.EditorTask<T>, EntityEditor.EditorTasks, EntityEditor.EditorValue<T>, EntityEditor.EditorValues, EntityEditor.Exists, EntityEditor.Modified, EntityEditor.PersistEvents, EntityEditor.Present, EntityEditor.SearchModels, EntityEditor.Settings -
Field Summary
Fields inherited from class is.codion.framework.model.AbstractEntityEditor
ASYNCFields inherited from interface is.codion.framework.model.EntityEditor
PERSIST_FOREIGN_KEYS, PUBLISH_PERSISTENCE_EVENTS -
Constructor Summary
ConstructorsConstructorDescriptionSwingEntityEditor(EntityType entityType, EntityConnectionProvider connectionProvider) Instantiates a newSwingEntityEditorSwingEntityEditor(EntityType entityType, EntityConnectionProvider connectionProvider, SwingEntityEditor.SwingComponentModels componentModels) Instantiates a newSwingEntityEditor -
Method Summary
Modifier and TypeMethodDescriptionReturns theEntityEditor.ComboBoxModelsinstance.protected SwingEntityEditor.SwingComponentModelscreate(EntityType entityType) create(EntityType entityType, EntityEditor.ComponentModels componentModels) protected voidexecute(EntityEditor.EditorTask<Entity> task) Executes the given task, by default this is done synchronously, override to provide async executionprotected voidSupersedes any ongoing asynchronous execution.Methods inherited from class is.codion.framework.model.AbstractEntityEditor
async, connectionProvider, delete, delete, detail, entities, entity, entityDefinition, events, insert, insert, persistence, searchModels, settings, tasks, tasks, toString, update, update, validate, validate, validate, validate, validator, value, values
-
Constructor Details
-
SwingEntityEditor
Instantiates a newSwingEntityEditor- Parameters:
entityType- the entity typeconnectionProvider- the connection provider
-
SwingEntityEditor
public SwingEntityEditor(EntityType entityType, EntityConnectionProvider connectionProvider, SwingEntityEditor.SwingComponentModels componentModels) Instantiates a newSwingEntityEditor- Parameters:
entityType- the entity typeconnectionProvider- the connection providercomponentModels- the component models
-
-
Method Details
-
comboBoxModels
Description copied from class:AbstractEntityEditorReturns theEntityEditor.ComboBoxModelsinstance.Intentionally non-final, unlike the other editor sub-model accessors: combo box models are the only editor sub-model with toolkit-specific variants, so subclasses may narrow the return type — for example
SwingEntityEditornarrows it toSwingComboBoxModels. To supply a customEntityEditor.ComboBoxModelsimplementation, pass a factory to the protected constructor rather than overriding this accessor's behaviour.- Specified by:
comboBoxModelsin interfaceEntityEditor<SwingEntityEditor>- Overrides:
comboBoxModelsin classAbstractEntityEditor<SwingEntityEditor>- Returns:
- the
EntityEditor.ComboBoxModelsinstance
-
create
- Parameters:
entityType- the entity type- Returns:
- an editor based on the given type
-
create
public SwingEntityEditor create(EntityType entityType, EntityEditor.ComponentModels componentModels) - Parameters:
entityType- the entity typecomponentModels- the component models- Returns:
- an editor based on the given type
-
componentModels
- Overrides:
componentModelsin classAbstractEntityEditor<SwingEntityEditor>- Returns:
- the
EntityEditor.ComponentModelsinstance
-
execute
Description copied from class:AbstractEntityEditorExecutes the given task, by default this is done synchronously, override to provide async execution- Overrides:
executein classAbstractEntityEditor<SwingEntityEditor>- Parameters:
task- the task to execute
-
supersede
protected void supersede()Description copied from class:AbstractEntityEditorSupersedes any ongoing asynchronous execution. Called before applying a synchronous state change (defaults/clear) so that an in-flight asynchronous set or replace does not complete afterwards and clobber it. The default implementation does nothing.- Overrides:
supersedein classAbstractEntityEditor<SwingEntityEditor>
-