Class NMActionButton

All Implemented Interfaces:
com.nomagic.awt.HelpInformationProvider, KeyListener, MouseListener, ImageObserver, ItemSelectable, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, SwingConstants

@OpenApi public class NMActionButton extends NMPopupButton implements PropertyChangeListener
Button created from action. All properties for button(text, icon, tool tip...) are taken from action. Also action is added as button ActionListener. Button listens for changes in action and updates it state according the action state.
See Also:
  • Constructor Details

    • NMActionButton

      @OpenApi public NMActionButton(NMAction action)
      Constructs new button with given action.
      Parameters:
      action - action for the button.
  • Method Details

    • getToolTipText

      @OpenApi public static String getToolTipText(NMAction action)
      Creates tooltip text for button from given action. Tooltip will have action description or name and representation of first shortcut.
      Parameters:
      action - the given action.
    • getToolTipText

      @OpenApi public String getToolTipText()
      Creates tool tip text from button action. Tool tip will have action description or name and representation of first shortcut.
      Overrides:
      getToolTipText in class JComponent
    • getAction

      @OpenApi public Action getAction()
      Returns action of this button.
      Overrides:
      getAction in class AbstractButton
      Returns:
      action of this button.