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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds anAction
to the collection of actions at the default position.void
Adds anAction
to the collection of actions at the specified position.protected void
addActionInternal
(Action action, int index) protected void
addShortcutListenerIfNeeded
(Action action) protected void
attachAction
(Action action) protected void
detachAction
(Action action) Finds anAction
by its identifier.Returns a collection of all actions associated with this instance.protected com.vaadin.flow.component.Component
void
removeAction
(Action action) Removes the specifiedAction
from the collection of actions.protected boolean
removeActionInternal
(Action action) protected void
removeShortcutListener
(Action action)
-
Field Details
-
component
-
actions
-
actionShortcutBinding
-
-
Constructor Details
-
AbstractActionsHolderSupport
-
-
Method Details
-
addAction
Adds anAction
to the collection of actions at the default position.- Parameters:
action
- the action to be added; must not be null
-
addAction
Adds anAction
to the collection of actions at the specified position.- Parameters:
action
- the action to be added; must not be nullindex
- 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
-
attachAction
-
addShortcutListenerIfNeeded
-
getShortcutLifecycleOwner
protected com.vaadin.flow.component.Component getShortcutLifecycleOwner() -
removeShortcutListener
-
removeAction
Removes the specifiedAction
from the collection of actions.- Parameters:
action
- the action to be removed; must not be null
-
removeActionInternal
-
detachAction
-
getAction
Finds anAction
by its identifier.- Parameters:
id
- the identifier of the action to retrieve; must not be null- Returns:
- an
Optional
containing the foundAction
, orOptional.empty()
if no action with the specified identifier exists
-
getActions
Returns a collection of all actions associated with this instance.- Returns:
- an unmodifiable collection of
Action
objects
-
getActionShortcutBinding
-