Class AbstractActionsHolderSupport<C extends com.vaadin.flow.component.Component>

java.lang.Object
io.jmix.flowui.kit.component.delegate.AbstractActionsHolderSupport<C>
Type Parameters:
C - the type of the component that holds actions
Direct Known Subclasses:
FragmentActionsDelegate, GenericFilterActionsSupport, GridActionsSupport, JmixKanbanActionsSupport, MainTabSheetActionsSupport, ValuePickerActionSupport

public abstract class AbstractActionsHolderSupport<C extends com.vaadin.flow.component.Component> extends Object
Abstract base class for managing and binding actions to a component. This class provides support for adding, removing, and managing Action instances associated with a component, while also handling shortcut registrations and property change listeners for these actions.
  • Field Details

    • component

      protected final C extends com.vaadin.flow.component.Component component
    • actions

      protected List<Action> actions
    • actionShortcutBinding

      protected Map<Action,com.vaadin.flow.component.ShortcutRegistration> actionShortcutBinding
  • Constructor Details

    • AbstractActionsHolderSupport

      public AbstractActionsHolderSupport(C component)
  • Method Details

    • addAction

      public void addAction(Action action)
      Adds an Action to the collection of actions at the default position.
      Parameters:
      action - the action to be added; must not be null
    • addAction

      public void addAction(Action action, int index)
      Adds an Action to the collection of actions at the specified position.
      Parameters:
      action - the action to be added; must not be null
      index - the position at which the specified action is to be inserted; if the action already exists, it will be moved to the new position
    • addActionInternal

      protected void addActionInternal(Action action, int index)
    • attachAction

      protected void attachAction(Action action)
    • addShortcutListenerIfNeeded

      protected void addShortcutListenerIfNeeded(Action action)
    • getShortcutLifecycleOwner

      protected com.vaadin.flow.component.Component getShortcutLifecycleOwner()
    • removeShortcutListener

      protected void removeShortcutListener(Action action)
    • removeAction

      public void removeAction(Action action)
      Removes the specified Action from the collection of actions.
      Parameters:
      action - the action to be removed; must not be null
    • removeActionInternal

      protected boolean removeActionInternal(Action action)
    • detachAction

      protected void detachAction(Action action)
    • getAction

      public Optional<Action> getAction(String id)
      Finds an Action by its identifier.
      Parameters:
      id - the identifier of the action to retrieve; must not be null
      Returns:
      an Optional containing the found Action, or Optional.empty() if no action with the specified identifier exists
    • getActions

      public Collection<Action> getActions()
      Returns a collection of all actions associated with this instance.
      Returns:
      an unmodifiable collection of Action objects
    • getActionShortcutBinding

      protected Map<Action,com.vaadin.flow.component.ShortcutRegistration> getActionShortcutBinding()