Class RemoveOperation

java.lang.Object
io.jmix.flowui.util.RemoveOperation

@Component("flowui_RemoveOperation") public class RemoveOperation extends Object
Class that provides fluent interface for removing entity instances.
Inject the class into your view controller and use builder(Class, View) method as an entry point.
  • Field Details

  • Constructor Details

    • RemoveOperation

      public RemoveOperation()
  • Method Details

    • setDataManager

      @Autowired public void setDataManager(DataManager dataManager)
    • setMessages

      @Autowired public void setMessages(Messages messages)
    • setExtendedEntities

      @Autowired public void setExtendedEntities(ExtendedEntities extendedEntities)
    • setEntityStates

      @Autowired public void setEntityStates(EntityStates entityStates)
    • setMetadata

      @Autowired public void setMetadata(Metadata metadata)
    • setMetadataTools

      @Autowired public void setMetadataTools(MetadataTools metadataTools)
    • builder

      public <E> RemoveOperation.RemoveBuilder<E> builder(Class<E> entityClass, View<?> origin)
      Creates a remove builder.
      Type Parameters:
      E - type of entity
      Parameters:
      entityClass - entity class
      origin - invoking view
    • builder

      public <E> RemoveOperation.RemoveBuilder<E> builder(ListDataComponent<E> listDataComponent)
      Creates a remove builder using ListDataComponent component.
      Type Parameters:
      E - type of entity
      Parameters:
      listDataComponent - list data component
    • removeSelected

      public <E> void removeSelected(ListDataComponent<E> listDataComponent)
      Removes selected items from the ListDataComponent 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

      public <E> void excludeSelected(ListDataComponent<E> listDataComponent)
      Excludes selected items from the ListDataComponent component without confirmation. Works with nested containers only.
      Type Parameters:
      E - entity type
      Parameters:
      listDataComponent - list data component
    • triggerAction

      protected <E> void triggerAction(RemoveOperation.RemoveBuilder<E> builder)
    • performAction

      protected <E> void performAction(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems)
    • removeItems

      protected <E> void removeItems(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems)
    • focusListDataComponent

      protected <E> void focusListDataComponent(RemoveOperation.RemoveBuilder<E> builder)
    • saveIfNeeded

      protected void saveIfNeeded(Collection<?> entitiesToRemove, CollectionContainer<?> container, ViewData viewData)
    • excludeItems

      protected <E> void excludeItems(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems)
    • getCollectionContainer

      protected <E> CollectionContainer<E> getCollectionContainer(RemoveOperation.RemoveBuilder<E> builder)
    • performActionWithConfirmation

      protected <E> void performActionWithConfirmation(RemoveOperation.RemoveBuilder<E> builder, List<E> selectedItems)