Package io.jmix.flowui.util
Class RemoveOperation.RemoveBuilder<E>
java.lang.Object
io.jmix.flowui.util.RemoveOperation.RemoveBuilder<E>
- Type Parameters:
E- entity type
- Enclosing class:
- RemoveOperation
Remove builder.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Consumer<RemoveOperation.ActionCancelledEvent<E>>protected Consumer<RemoveOperation.AfterActionPerformedEvent<E>>protected Consumer<RemoveOperation.BeforeActionPerformedEvent<E>>protected booleanprotected Stringprotected Stringprotected CollectionContainer<E>protected final Consumer<RemoveOperation.RemoveBuilder<E>>protected ListDataComponent<E>protected RemoveOperation.Operationprotected final View<?>protected Consumer<Collection<E>> -
Constructor Summary
ConstructorsConstructorDescriptionRemoveBuilder(View<?> origin, Class<E> entityClass, Consumer<RemoveOperation.RemoveBuilder<E>> actionHandler) -
Method Summary
Modifier and TypeMethodDescriptionSets a handler to be invoked after the action is performed.Sets a handler to be invoked before the action is performed.voidexclude()Excludes items from relation: One-To-Many or Many-To-Many.Returns the handler to be invoked when the remove operation is cancelled by the user in the confirmation dialog.Returns the handler to be invoked after the action is performed.Returns the handler to be invoked before the action is performed.Returns the confirmation message to be displayed in the confirmation dialog for the remove operation.Returns the confirmation title to be displayed in the confirmation dialog for the remove operation.Returns theCollectionContainerassociated with this builder.Returns the class of the entity associated with this builder.getItems()Returns the list of items to be removed associated with this builder.Returns theListDataComponentassociated with this builder.Returns theRemoveOperation.Operationassociated with this builder.View<?>Returns theViewassociated with this builder.booleanReturns whether a confirmation dialog is required before performing the remove operation.onCancel(Consumer<RemoveOperation.ActionCancelledEvent<E>> handler) Sets a handler to be invoked when the remove operation is cancelled by the user in the confirmation dialog.voidremove()Removes items.withConfirmation(boolean confirmation) Sets whether a confirmation dialog is required before performing the remove operation.withConfirmationMessage(String confirmationMessage) Sets the confirmation message to be displayed in the confirmation dialog for the remove operation.withConfirmationTitle(String confirmationTitle) Sets the confirmation title to be displayed in the confirmation dialog for the remove operation.withContainer(CollectionContainer<E> container) Sets theCollectionContainerto be used by the builder.Sets the items to be removed by the builder.withListDataComponent(ListDataComponent<E> listDataComponent) Sets theListDataComponentto be used by the builder.withRemoveDelegate(Consumer<Collection<E>> removeDelegate) Sets the delegate to be invoked instead ofDataManagerto remove the entities from a storage.
-
Field Details
-
origin
-
entityClass
-
handler
-
operation
-
listDataComponent
-
container
-
items
-
confirmation
protected boolean confirmation -
confirmationMessage
-
confirmationTitle
-
beforeActionPerformedHandler
-
afterActionPerformedHandler
-
actionCancelledHandler
-
removeDelegate
-
-
Constructor Details
-
RemoveBuilder
-
-
Method Details
-
withListDataComponent
public RemoveOperation.RemoveBuilder<E> withListDataComponent(ListDataComponent<E> listDataComponent) Sets theListDataComponentto be used by the builder.- Parameters:
listDataComponent- theListDataComponentinstance to be associated with this builder- Returns:
- the current instance for method chaining
-
withContainer
Sets theCollectionContainerto be used by the builder.- Parameters:
container- theCollectionContainerinstance to be associated with this builder- Returns:
- the current instance for method chaining
-
withItems
Sets the items to be removed by the builder.- Parameters:
items- the list of items to be removed- Returns:
- the current instance for method chaining
-
withConfirmation
Sets whether a confirmation dialog is required before performing the remove operation.- Parameters:
confirmation-trueto enable confirmation dialog,falseto disable it- Returns:
- the current instance for method chaining
-
withConfirmationMessage
Sets the confirmation message to be displayed in the confirmation dialog for the remove operation.- Parameters:
confirmationMessage- the confirmation message to be displayed- Returns:
- the current instance for method chaining
-
withConfirmationTitle
Sets the confirmation title to be displayed in the confirmation dialog for the remove operation.- Parameters:
confirmationTitle- the confirmation title to be displayed- Returns:
- the current instance for method chaining
-
beforeActionPerformed
public RemoveOperation.RemoveBuilder<E> beforeActionPerformed(Consumer<RemoveOperation.BeforeActionPerformedEvent<E>> handler) Sets a handler to be invoked before the action is performed.- Parameters:
handler- a handler to set- Returns:
- the current instance for method chaining
-
afterActionPerformed
public RemoveOperation.RemoveBuilder<E> afterActionPerformed(Consumer<RemoveOperation.AfterActionPerformedEvent<E>> handler) Sets a handler to be invoked after the action is performed.- Parameters:
handler- a handler to set- Returns:
- the current instance for method chaining
-
onCancel
public RemoveOperation.RemoveBuilder<E> onCancel(Consumer<RemoveOperation.ActionCancelledEvent<E>> handler) Sets a handler to be invoked when the remove operation is cancelled by the user in the confirmation dialog.- Parameters:
handler- a handler to set- Returns:
- the current instance for method chaining
-
withRemoveDelegate
Sets the delegate to be invoked instead ofDataManagerto remove the entities from a storage.- Parameters:
removeDelegate- a delegate to set- Returns:
- the current instance for method chaining
-
getListDataComponent
Returns theListDataComponentassociated with this builder.- Returns:
- the
ListDataComponentinstance, ornullif not set
-
getContainer
Returns theCollectionContainerassociated with this builder.- Returns:
- the
CollectionContainerinstance, ornullif not set
-
getItems
Returns the list of items to be removed associated with this builder.- Returns:
- the list of items, or
nullif no items are set
-
getConfirmationTitle
Returns the confirmation title to be displayed in the confirmation dialog for the remove operation.- Returns:
- the confirmation title, or
nullif not set
-
getConfirmationMessage
Returns the confirmation message to be displayed in the confirmation dialog for the remove operation.- Returns:
- the confirmation message, or
nullif not set
-
isConfirmationRequired
public boolean isConfirmationRequired()Returns whether a confirmation dialog is required before performing the remove operation.- Returns:
trueif a confirmation dialog is required;falseotherwise
-
getOrigin
Returns theViewassociated with this builder.- Returns:
- the
Viewinstance
-
getEntityClass
Returns the class of the entity associated with this builder.- Returns:
- the
Classof the entity
-
getOperation
Returns theRemoveOperation.Operationassociated with this builder.- Returns:
- the
RemoveOperation.Operationinstance
-
getBeforeActionPerformedHandler
@Nullable public Consumer<RemoveOperation.BeforeActionPerformedEvent<E>> getBeforeActionPerformedHandler()Returns the handler to be invoked before the action is performed.- Returns:
- the handler to be invoked before the action is performed,
or
nullif no handler is set
-
getAfterActionPerformedHandler
@Nullable public Consumer<RemoveOperation.AfterActionPerformedEvent<E>> getAfterActionPerformedHandler()Returns the handler to be invoked after the action is performed.- Returns:
- the handler to be invoked after the action is performed,
or
nullif no handler is set
-
getActionCancelledHandler
Returns the handler to be invoked when the remove operation is cancelled by the user in the confirmation dialog.- Returns:
- the handler to be invoked upon removal cancellation,
or
nullif no handler is set
-
exclude
public void exclude()Excludes items from relation: One-To-Many or Many-To-Many. -
remove
public void remove()Removes items.
-