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 screen controller and use
Inject the class into your screen controller and use
builder(Class, Screen) method as an entry point.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEvent sent when the remove operation is cancelled by user in the confirmation dialog.static classEvent sent after selected entities are removed.static classEvent sent before selected entities are removed.protected static enumstatic classRemove builder. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataManagerprotected EntityStatesprotected ExtendedEntitiesprotected Messagesprotected Metadata -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder(ListDataComponent<E> listDataComponent) Creates a remove builder usingListDataComponentcomponent.Creates a remove builder.protected voidcommitIfNeeded(Collection<?> entitiesToRemove, CollectionContainer container, ScreenData screenData) protected <E> voidexcludeItems(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems) <E> voidexcludeSelected(ListDataComponent<E> listDataComponent) Excludes selected items from theListDataComponentcomponent without confirmation.protected <E> voidfocusListDataComponent(RemoveOperation.RemoveBuilder<E> builder) protected <E> CollectionContainer<E>getCollectionContainer(RemoveOperation.RemoveBuilder<E> builder) protected <E> voidperformAction(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems) protected <E> voidperformActionWithConfirmation(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems) protected <E> voidremoveItems(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems) <E> voidremoveSelected(ListDataComponent<E> listDataComponent) Removes selected items from theListDataComponentcomponent with confirmation dialog.voidsetDataManager(DataManager dataManager) voidsetEntityStates(EntityStates entityStates) voidsetExtendedEntities(ExtendedEntities extendedEntities) voidsetMessages(Messages messages) voidsetMetadata(Metadata metadata) protected <E> voidtriggerAction(RemoveOperation.RemoveBuilder<E> builder)
-
Field Details
-
dataManager
-
messages
-
extendedEntities
-
entityStates
-
metadata
-
-
Constructor Details
-
RemoveOperation
public RemoveOperation()
-
-
Method Details
-
setDataManager
-
setMessages
-
setExtendedEntities
-
setEntityStates
-
setMetadata
-
builder
Creates a remove builder.- Type Parameters:
E- type of entity- Parameters:
entityClass- entity classorigin- invoking screen
-
builder
Creates a remove builder usingListDataComponentcomponent.- Type Parameters:
E- type of entity- Parameters:
listDataComponent- list data component
-
removeSelected
Removes selected items from theListDataComponentcomponent 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 theListDataComponentcomponent without confirmation. Works with nested containers only.- Type Parameters:
E- entity type- Parameters:
listDataComponent- list data component
-
triggerAction
-
performAction
-
removeItems
-
focusListDataComponent
-
commitIfNeeded
protected void commitIfNeeded(Collection<?> entitiesToRemove, CollectionContainer container, ScreenData screenData) -
excludeItems
-
getCollectionContainer
protected <E> CollectionContainer<E> getCollectionContainer(RemoveOperation.RemoveBuilder<E> builder) -
performActionWithConfirmation
protected <E> void performActionWithConfirmation(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems)
-