Class CDropDownButton
java.lang.Object
bibliothek.gui.dock.common.action.CAction
bibliothek.gui.dock.common.intern.action.CDecorateableAction<CommonSimpleDropDownAction>
bibliothek.gui.dock.common.action.CDropDownButton
A dropdown-button, the last action which was selected by the user will be
marked graphically.
- Author:
- Benjamin Sigg
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new dropdown-buttonCDropDownButton(String text, Icon icon) Creates a new dropdown-button -
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.Gets the currently selected action.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 menuvoidsetSelection(CAction action) Sets the current selected action.Methods 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
-
CDropDownButton
public CDropDownButton()Creates a new dropdown-button -
CDropDownButton
Creates a new dropdown-button- Parameters:
text- the text of this buttonicon- the icon of this button
-
-
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
-
setSelection
Sets the current selected action.- Parameters:
action- the action to select.
-
getSelection
Gets the currently selected action.- Returns:
- the selected action or
null
-