bibliothek.gui.dock.common.action
Class CDropDownButton

java.lang.Object
  extended by bibliothek.gui.dock.common.action.CAction
      extended by bibliothek.gui.dock.common.intern.action.CDecorateableAction
          extended by bibliothek.gui.dock.common.action.CDropDownButton

public class CDropDownButton
extends CDecorateableAction

A dropdown-button, the last action which was selected by the user will be marked graphically.

Author:
Benjamin Sigg

Constructor Summary
CDropDownButton()
          Creates a new dropdown-button
CDropDownButton(java.lang.String text, javax.swing.Icon icon)
          Creates a new dropdown-button
 
Method Summary
 void add(CAction action)
          Adds an action to this menu.
 void addSeparator()
          Adds a separator at the end of this menu.
 void insert(int index, CAction action)
          Adds an action to the menu.
 void insertSeparator(int index)
          Adds a separator.
 void remove(CAction action)
          Removes an action from this menu
 void remove(int index)
          Removes the action at location index.
 void setSelection(CAction action)
          Sets the current selected action.
 
Methods inherited from class bibliothek.gui.dock.common.intern.action.CDecorateableAction
getAccelerator, getDisabledIcon, getIcon, getText, getTooltip, init, isEnabled, setAccelerator, setDisabledIcon, setEnabled, setIcon, setText, setTooltip
 
Methods inherited from class bibliothek.gui.dock.common.action.CAction
init, intern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDropDownButton

public CDropDownButton()
Creates a new dropdown-button


CDropDownButton

public CDropDownButton(java.lang.String text,
                       javax.swing.Icon icon)
Creates a new dropdown-button

Parameters:
text - the text of this button
icon - the icon of this button
Method Detail

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

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.