Class PopupAction

All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public class PopupAction extends LocalizedAction
Action that displays a popup menu when triggered. GUI components based on this action are typically buttons, with the menu displayed adjacent to the button.
See Also:
  • Constructor Details

    • PopupAction

      public PopupAction(String id, Localization localization, Supplier<JPopupMenu> menuSupplier)
      Constructs a new popup action.
      Parameters:
      id - the id for localization
      localization - the source for localization strings
      menuSupplier - callback that generates the menu
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
    • toButton

      public JButton toButton()
      Convenience method to create a JButton based on this action.
      Returns:
      the menu item