public class CDropDownButton extends CDecorateableAction<CommonSimpleDropDownAction>
Constructor and Description |
---|
CDropDownButton()
Creates a new dropdown-button
|
CDropDownButton(String text,
Icon icon)
Creates a new dropdown-button
|
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. |
CAction |
getSelection()
Gets the currently selected action.
|
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.
|
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 removepublic void setSelection(CAction action)
action
- the action to select.public CAction getSelection()
null