Class CDropDownButton


public class CDropDownButton extends CDecorateableAction<CommonSimpleDropDownAction>
A dropdown-button, the last action which was selected by the user will be marked graphically.
Author:
Benjamin Sigg
  • Constructor Details

    • CDropDownButton

      public CDropDownButton()
      Creates a new dropdown-button
    • CDropDownButton

      public CDropDownButton(String text, Icon icon)
      Creates a new dropdown-button
      Parameters:
      text - the text of this button
      icon - the icon of this button
  • Method Details

    • add

      public void add(CAction action)
      Adds an action to this menu.
      Parameters:
      action - the new action
    • insert

      public void insert(int index, CAction action)
      Adds an action to the menu.
      Parameters:
      index - the location of the action
      action - the new action
    • addSeparator

      public void addSeparator()
      Adds a separator at the end of this menu.
    • insertSeparator

      public void insertSeparator(int index)
      Adds a separator.
      Parameters:
      index - the location of the new separator
    • getActionCount

      public int getActionCount()
      Gets the number of DockActions that were added to this menu.
      Returns:
      the number of actions
    • getAction

      public CAction getAction(int index)
      Gets the index'th action of this menu.
      Parameters:
      index - the index of the action
      Returns:
      the action or null if the index'th DockAction is not a CommonDockAction (and hence no CAction can be found)
    • remove

      public void remove(int index)
      Removes the action at location index.
      Parameters:
      index - the location of the element to remove
    • remove

      public void remove(CAction action)
      Removes an action from this menu
      Parameters:
      action - the action to remove
    • setSelection

      public void setSelection(CAction action)
      Sets the current selected action.
      Parameters:
      action - the action to select.
    • getSelection

      public CAction getSelection()
      Gets the currently selected action.
      Returns:
      the selected action or null