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 TypeClassDescriptionfinal classManages the combo box models used by aSwingEntityEditor.static interfaceASwingEntityEditor.SwingComponentModelsextension providing foreign key basedEntityComboBoxModeland column basedFilterComboBoxModel.Nested classes/interfaces inherited from interface is.codion.framework.model.EntityEditor
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
FieldsModifier and TypeFieldDescriptionstatic final PropertyValue<Boolean> Specifies whetherSwingEntityEditorinstances set and replace the active entity asynchronously, on a background thread, or on the user interface thread Value type: Boolean Default value: trueFields 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 TypeMethodDescriptionasync()Controls whether the active entity is set and replaced asynchronously, on a background thread, when invoked on the user interface thread.protected SwingEntityEditor.SwingComponentModelsprotected voidexecute(EntityEditor.EditorTask<Entity> task) Executes the given task, by default this is done synchronously, override to provide async executionMethods inherited from class is.codion.framework.model.AbstractEntityEditor
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
-
Field Details
-
ASYNC
Specifies whetherSwingEntityEditorinstances set and replace the active entity asynchronously, on a background thread, or on the user interface thread- Value type: Boolean
- Default value: true
- See Also:
-
-
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
- Returns:
- the
SwingEntityEditor.ComboBoxModelsinstance
-
async
Controls whether the active entity is set and replaced asynchronously, on a background thread, when invoked on the user interface thread. When enabled (the default), setting or replacing the active entity loads any registered detail editors on a background thread and returns before the change has completed.
Disabling asynchronous behaviour provides predictable, synchronous set and replace, which can be useful when orchestrating interdependent models, such as complex master/detail selection cascades, where the order of operations must be deterministic.
- Returns:
- the
Statecontrolling whether asynchronous set and replace is enabled - See Also:
-
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
-