Class BaseButtonWithDropDownMenu

    • Constructor Detail

      • BaseButtonWithDropDownMenu

        public BaseButtonWithDropDownMenu()
        Initializes the button. Uses the "arrow-head-down.png" icon.
      • BaseButtonWithDropDownMenu

        public BaseButtonWithDropDownMenu​(Icon icon)
        Initializes the button, using the specified icon.
        Parameters:
        icon - the icon for the button
      • BaseButtonWithDropDownMenu

        public BaseButtonWithDropDownMenu​(String text,
                                          Icon icon)
        Initializes the button, using the specified button text and icon.
        Parameters:
        text - the text for the button
        icon - the icon for the button
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
      • clearMenu

        public void clearMenu()
        Removes all supplied menu items. Does not affect a supplied menu.
      • addToMenu

        public void addToMenu​(JMenuItem item)
        Adds the menu item for the dropdown menu.
        Parameters:
        item - the item to add
      • addToMenu

        public void addToMenu​(Action action)
        Adds the action for the dropdown menu.
        Parameters:
        action - the action to add
      • addSeparatorToMenu

        public void addSeparatorToMenu()
        Adds a separator to the dropdown menu.
      • setDropDownMenu

        public void setDropDownMenu​(JPopupMenu menu)
        Sets the menu to display.
        Parameters:
        menu - the menu to use
      • getDropDownMenu

        public JPopupMenu getDropDownMenu()
        Returns the menu to display.
        Returns:
        the menu to use, null if none set
      • showMenu

        protected void showMenu()
        Shows the menu.