Interface ToolBarActionSupplier

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ToolBarActionSupplier
A simple Supplier-like interface for supplying ToolBarActions for an ActionPanel. This can be used to add custom actions to the ToolBar for an ActionGroup within an ActionPanel, without needing to subclass ActionPanel or modify the existing code. Implementations of this interface can be registered with an ActionPanel via the ToolBarOptions class:
     myActionPanel.getToolBarOptions().addCustomActionSupplier(...);
 

This is useful for augmenting or replacing the built-in actions offered by ToolBarOptions.

Since:
swing-extras 2.8
Author:
scorbo2
  • Method Summary

    Modifier and Type
    Method
    Description
    get(ActionPanel actionPanel, String groupName)
    Returns a ToolBarAction implementation class that can be added to the ToolBar for an ActionGroup within an ActionPanel.
  • Method Details

    • get

      ToolBarAction get(ActionPanel actionPanel, String groupName)
      Returns a ToolBarAction implementation class that can be added to the ToolBar for an ActionGroup within an ActionPanel. The returned action should have a tooltip and an icon specified, as per the Javadocs in ToolBarAction. If the supplier returns null, it is ignored.
      Parameters:
      actionPanel - The ActionPanel that the ToolBarAction will be shown for.
      groupName - The name of the ActionGroup that the ToolBarAction will be shown for. This is case-insensitive.
      Returns:
      The ToolBarAction to show for the given ActionPanel and ActionGroup, or null if no action should be shown.