Class AbstractAction

java.lang.Object
io.jmix.flowui.kit.action.AbstractAction
All Implemented Interfaces:
Action, HasShortcutCombination
Direct Known Subclasses:
BaseAction

public abstract class AbstractAction extends Object implements Action
Abstract class for Actions.
  • Field Details

    • id

      protected final String id
    • text

      protected String text
    • enabled

      protected boolean enabled
    • visible

      protected boolean visible
    • icon

      protected com.vaadin.flow.component.icon.Icon icon
    • description

      protected String description
    • variant

      protected ActionVariant variant
    • shortcutCombination

      protected KeyCombination shortcutCombination
    • eventBus

      protected EventBus eventBus
  • Constructor Details

    • AbstractAction

      protected AbstractAction(String id)
  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface Action
      Returns:
      action's identifier
    • getText

      @Nullable public String getText()
      Description copied from interface: Action
      Returns the text property value of an action. May be used by components to initialize their appearance.
      Specified by:
      getText in interface Action
      Returns:
      action's text or null if not set
    • setText

      public void setText(@Nullable String text)
      Description copied from interface: Action
      Sets the text property value of an action. May be used by components to initialize their appearance.
      Specified by:
      setText in interface Action
      Parameters:
      text - text to set or null to remove
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: Action
      Returns the enabled property value of an action. May be used by components to initialize their appearance.
      Specified by:
      isEnabled in interface Action
      Returns:
      whether the action is currently enabled
    • setEnabled

      public void setEnabled(boolean enabled)
      Description copied from interface: Action
      Sets the enabled property value of an action. May be used by components to initialize their appearance.
      Specified by:
      setEnabled in interface Action
      Parameters:
      enabled - whether the action is currently enabled
    • isVisible

      public boolean isVisible()
      Description copied from interface: Action
      Returns the visible property value of an action. May be used by components to initialize their appearance.
      Specified by:
      isVisible in interface Action
      Returns:
      whether the action is currently visible
    • setVisible

      public void setVisible(boolean visible)
      Description copied from interface: Action
      Sets the visible property value of an action. May be used by components to initialize their appearance.
      Specified by:
      setVisible in interface Action
      Parameters:
      visible - whether the action is currently visible
    • getIcon

      @Nullable public com.vaadin.flow.component.icon.Icon getIcon()
      Description copied from interface: Action
      Returns the icon property value of an action. May be used by components to initialize their appearance.
      Specified by:
      getIcon in interface Action
      Returns:
      action's icon or null if not set
    • setIcon

      public void setIcon(@Nullable com.vaadin.flow.component.icon.Icon icon)
      Description copied from interface: Action
      Sets the icon property value of an action. May be used by components to initialize their appearance.
      Specified by:
      setIcon in interface Action
      Parameters:
      icon - icon to set or null to remove
    • getDescription

      @Nullable public String getDescription()
      Description copied from interface: Action
      Returns the description property value of an action. May be used by components to initialize their appearance.
      Specified by:
      getDescription in interface Action
      Returns:
      action's description or null if not set
    • setDescription

      public void setDescription(@Nullable String description)
      Description copied from interface: Action
      Sets the description property value of an action. May be used by components to initialize their appearance.
      Specified by:
      setDescription in interface Action
      Parameters:
      description - description to set or null to remove
    • getVariant

      public ActionVariant getVariant()
      Description copied from interface: Action
      Returns the variant property value of an action. May be used by components to initialize their appearance.
      Specified by:
      getVariant in interface Action
      Returns:
      action's variant
    • setVariant

      public void setVariant(ActionVariant variant)
      Description copied from interface: Action
      Sets the variant property value of an action. May be used by components to initialize their appearance.
      Specified by:
      setVariant in interface Action
      Parameters:
      variant - variant to set
    • getShortcutCombination

      @Nullable public KeyCombination getShortcutCombination()
      Specified by:
      getShortcutCombination in interface HasShortcutCombination
      Returns:
      object that stores information about keys, modifiers and additional settings that describe shortcut combinations or null if not set
    • setShortcutCombination

      public void setShortcutCombination(@Nullable KeyCombination shortcutCombination)
      Description copied from interface: HasShortcutCombination
      Sets object that stores information about keys, modifiers and additional settings that describe shortcut combinations.
      Specified by:
      setShortcutCombination in interface HasShortcutCombination
      Parameters:
      shortcutCombination - key combination to set or null to remove
    • addPropertyChangeListener

      public com.vaadin.flow.shared.Registration addPropertyChangeListener(Consumer<PropertyChangeEvent> listener)
      Description copied from interface: Action
      Adds a listener to be notified about changes in the properties of the action.
      Specified by:
      addPropertyChangeListener in interface Action
      Parameters:
      listener - listener to add
      Returns:
      a registration object for removing an event listener
    • getEventBus

      protected EventBus getEventBus()
    • hasListener

      protected boolean hasListener(Class<? extends EventObject> eventType)
    • firePropertyChange

      protected void firePropertyChange(String propertyName, @Nullable Object oldValue, @Nullable Object newValue)