public class CMenu extends CDecorateableAction<CommonSimpleMenuAction>
CAction
s which are shown in a menu.Constructor and Description |
---|
CMenu()
Creates a new menu
|
CMenu(String text,
Icon icon)
Creates a new menu.
|
Modifier and Type | Method and Description |
---|---|
void |
add(CAction action)
Adds an action to this menu.
|
void |
addSeparator()
Adds a separator at the end of this menu.
|
CAction |
getAction(int index)
Gets the
index 'th action of this menu. |
int |
getActionCount()
Gets the number of
DockAction s that were added to 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 . |
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
public void add(CAction action)
action
- the new actionpublic void insert(int index, CAction action)
index
- the location of the actionaction
- the new actionpublic void addSeparator()
public void insertSeparator(int index)
index
- the location of the new separatorpublic int getActionCount()
DockAction
s that were added to this menu.public CAction getAction(int index)
index
'th action of this menu.index
- the index of the actionnull
if the index
'th
DockAction
is not a CommonDockAction
(and hence no CAction
can be found)public void remove(int index)
index
.index
- the location of the element to removepublic void remove(CAction action)
action
- the action to remove