Class CMenu
java.lang.Object
bibliothek.gui.dock.common.action.CAction
bibliothek.gui.dock.common.intern.action.CDecorateableAction<CommonSimpleMenuAction>
bibliothek.gui.dock.common.action.CMenu
A collection of
CActions which are shown in a menu.- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an action to this menu.voidAdds a separator at the end of this menu.getAction(int index) Gets theindex'th action of this menu.intGets the number ofDockActions that were added to this menu.voidAdds an action to the menu.voidinsertSeparator(int index) Adds a separator.voidremove(int index) Removes the action at locationindex.voidRemoves an action from this menuMethods inherited from class bibliothek.gui.dock.common.intern.action.CDecorateableAction
addDecorateableActionListener, getAccelerator, getDisabledHoverIcon, getDisabledIcon, getDisabledPressedIcon, getHoverIcon, getIcon, getPressedIcon, getText, getTooltip, init, intern, isAcceleratorGlobal, isEnabled, isShowTextOnButtons, removeDecorateableActionListener, setAccelerator, setAcceleratorIsGlobal, setDisabledHoverIcon, setDisabledIcon, setDisabledPressedIcon, setEnabled, setHoverIcon, setIcon, setPressedIcon, setShowTextOnButtons, setText, setTooltip
-
Constructor Details
-
CMenu
public CMenu()Creates a new menu -
CMenu
Creates a new menu.- Parameters:
text- the text of this menuicon- the icon of this menu
-
-
Method Details
-
add
Adds an action to this menu.- Parameters:
action- the new action
-
insert
Adds an action to the menu.- Parameters:
index- the location of the actionaction- 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 ofDockActions that were added to this menu.- Returns:
- the number of actions
-
getAction
Gets theindex'th action of this menu.- Parameters:
index- the index of the action- Returns:
- the action or
nullif theindex'thDockActionis not aCommonDockAction(and hence noCActioncan be found)
-
remove
public void remove(int index) Removes the action at locationindex.- Parameters:
index- the location of the element to remove
-
remove
Removes an action from this menu- Parameters:
action- the action to remove
-