bibliothek.gui.dock.common.action
Class CMenu

java.lang.Object
  extended by bibliothek.gui.dock.common.action.CAction
      extended by bibliothek.gui.dock.common.intern.action.CDecorateableAction<CommonSimpleMenuAction>
          extended by bibliothek.gui.dock.common.action.CMenu

public class CMenu
extends CDecorateableAction<CommonSimpleMenuAction>

A collection of CActions which are shown in a menu.

Author:
Benjamin Sigg

Constructor Summary
CMenu()
          Creates a new menu
CMenu(String text, Icon icon)
          Creates a new menu.
 
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.
 
Methods inherited from class bibliothek.gui.dock.common.intern.action.CDecorateableAction
addDecorateableActionListener, getAccelerator, getDisabledHoverIcon, getDisabledIcon, getDisabledPressedIcon, getHoverIcon, getIcon, getPressedIcon, getText, getTooltip, init, intern, isEnabled, isShowTextOnButtons, removeDecorateableActionListener, setAccelerator, setDisabledHoverIcon, setDisabledIcon, setDisabledPressedIcon, setEnabled, setHoverIcon, setIcon, setPressedIcon, setShowTextOnButtons, setText, setTooltip
 
Methods inherited from class bibliothek.gui.dock.common.action.CAction
init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMenu

public CMenu()
Creates a new menu


CMenu

public CMenu(String text,
             Icon icon)
Creates a new menu.

Parameters:
text - the text of this menu
icon - the icon of this menu
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