Package io.jmix.flowui.util
Class RemoveOperation
java.lang.Object
io.jmix.flowui.util.RemoveOperation
Class that provides fluent interface for removing entity instances.
Inject the class into your view controller and use
Inject the class into your view controller and use
builder(Class, View)
method as an entry point.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Event sent when the remove operation is cancelled by user in the confirmation dialog.static class
Event sent after selected entities are removed.static class
Event sent before selected entities are removed.protected static enum
static class
Remove builder. -
Field Summary
Modifier and TypeFieldDescriptionprotected DataManager
protected EntityStates
protected ExtendedEntities
protected Messages
protected Metadata
protected MetadataTools
protected Consumer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder
(ListDataComponent<E> listDataComponent) Creates a remove builder usingListDataComponent
component.Creates a remove builder.protected <E> void
excludeItems
(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems) <E> void
excludeSelected
(ListDataComponent<E> listDataComponent) Excludes selected items from theListDataComponent
component without confirmation.protected <E> void
focusListDataComponent
(RemoveOperation.RemoveBuilder<E> builder) protected <E> CollectionContainer<E>
getCollectionContainer
(RemoveOperation.RemoveBuilder<E> builder) protected <E> void
performAction
(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems) protected <E> void
performActionWithConfirmation
(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems) protected <E> void
removeItems
(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems) <E> void
removeSelected
(ListDataComponent<E> listDataComponent) Removes selected items from theListDataComponent
component with confirmation dialog.protected void
saveIfNeeded
(Collection<?> entitiesToRemove, CollectionContainer<?> container, ViewData viewData) void
setDataManager
(DataManager dataManager) void
setEntityStates
(EntityStates entityStates) void
setExtendedEntities
(ExtendedEntities extendedEntities) void
setMessages
(Messages messages) void
setMetadata
(Metadata metadata) void
setMetadataTools
(MetadataTools metadataTools) protected <E> void
triggerAction
(RemoveOperation.RemoveBuilder<E> builder)
-
Field Details
-
dataManager
-
messages
-
extendedEntities
-
entityStates
-
metadata
-
metadataTools
-
removeDelegate
-
-
Constructor Details
-
RemoveOperation
public RemoveOperation()
-
-
Method Details
-
setDataManager
-
setMessages
-
setExtendedEntities
-
setEntityStates
-
setMetadata
-
setMetadataTools
-
builder
Creates a remove builder.- Type Parameters:
E
- type of entity- Parameters:
entityClass
- entity classorigin
- invoking view
-
builder
Creates a remove builder usingListDataComponent
component.- Type Parameters:
E
- type of entity- Parameters:
listDataComponent
- list data component
-
removeSelected
Removes selected items from theListDataComponent
component with confirmation dialog.
After confirmation removes items from DB if the bound container is not nested.- Type Parameters:
E
- entity type- Parameters:
listDataComponent
- list data component
-
excludeSelected
Excludes selected items from theListDataComponent
component without confirmation. Works with nested containers only.- Type Parameters:
E
- entity type- Parameters:
listDataComponent
- list data component
-
triggerAction
-
performAction
-
removeItems
-
focusListDataComponent
-
saveIfNeeded
protected void saveIfNeeded(Collection<?> entitiesToRemove, CollectionContainer<?> container, ViewData viewData) -
excludeItems
-
getCollectionContainer
protected <E> CollectionContainer<E> getCollectionContainer(RemoveOperation.RemoveBuilder<E> builder) -
performActionWithConfirmation
protected <E> void performActionWithConfirmation(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems)
-