Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityEditor.EditorTasks
- Enclosing interface:
EntityEditor<R extends EntityEditor<R>>
public static interface EntityEditor.EditorTasks
Provides factory methods for creating EntityEditor.EditorTask instances.
Each factory method validates the input, captures entity state and fires "before" events. Must be called on the UI thread if the editor is linked to UI components. The returned task should be executed promptly, not cached for later use.
-
Method Summary
Modifier and TypeMethodDescriptiondelete()delete(Collection<Entity> entities) insert()insert(Collection<Entity> entities) refresh()update()update(Collection<Entity> entities)
-
Method Details
-
insert
- Returns:
- a task for inserting the active entity
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case inserting is not enabled
-
insert
- Parameters:
before- called on the entity before it is inserted- Returns:
- a task for inserting the active entity
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case inserting is not enabled
-
insert
- Parameters:
entity- the entity- Returns:
- a task for inserting the given entity
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case inserting is not enabled
-
insert
EntityEditor.EditorTask<Collection<Entity>> insert(Collection<Entity> entities) throws EntityValidationException - Parameters:
entities- the entities- Returns:
- a task for inserting the given entities
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case inserting is not enabled
-
update
- Returns:
- a task for updating the active entity
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case updating is not enabled
-
update
- Parameters:
entity- the entity- Returns:
- a task for updating the given entity
- Throws:
IllegalStateException- in case the entity is not modified or if updating is not enabledEntityValidationException- in case of validation failure
-
update
EntityEditor.EditorTask<Collection<Entity>> update(Collection<Entity> entities) throws EntityValidationException - Parameters:
entities- the entities- Returns:
- a task for updating the given entities
- Throws:
IllegalStateException- in case the entity is not modified or if updating is not enabledEntityValidationException- in case of validation failure
-
delete
EntityEditor.EditorTask<Entity> delete()- Returns:
- a task for deleting the active entity
- Throws:
IllegalStateException- in case deleting is not enabled
-
delete
- Parameters:
entity- the entity- Returns:
- a task for deleting the given entity
- Throws:
IllegalStateException- in case deleting is not enabled
-
delete
- Parameters:
entities- the entities- Returns:
- a task for deleting the given entities
- Throws:
IllegalStateException- in case deleting is not enabled
-
refresh
EntityEditor.EditorTask<Entity> refresh()- Returns:
- a task for refreshing the active entity
- Throws:
IllegalStateException- in case the active entity does not exist- See Also:
-
set
- Parameters:
entity- the entity to set- Returns:
- a task for setting the active entity
- See Also:
-
replace
- Parameters:
entity- the entity to set- Returns:
- a task for replacing the active entity
- See Also:
-