Class CButton
java.lang.Object
bibliothek.gui.dock.common.action.CAction
bibliothek.gui.dock.common.intern.action.CDecorateableAction<A>
bibliothek.gui.dock.common.intern.action.CDropDownItem<CommonSimpleButtonAction>
bibliothek.gui.dock.common.action.CButton
A simple button, the user clicks onto the button and
action() is called.- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaction()Invoked when the user clicks onto this button.voidaddActionListener(ActionListener listener) Addslistenerto this button,listenerwill be called whenever this button it triggered.protected voidfire()Informs allActionListeners that this button was clicked.protected voidinit(CommonSimpleButtonAction action) Initializes this action, this method can be called only once.voidremoveActionListener(ActionListener listener) Removeslistenerfrom this button.Methods inherited from class bibliothek.gui.dock.common.intern.action.CDropDownItem
isDropDownSelectable, isDropDownTriggerableNotSelected, isDropDownTriggerableSelected, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelectedMethods inherited from class bibliothek.gui.dock.common.intern.action.CDecorateableAction
addDecorateableActionListener, getAccelerator, getDisabledHoverIcon, getDisabledIcon, getDisabledPressedIcon, getHoverIcon, getIcon, getPressedIcon, getText, getTooltip, intern, isAcceleratorGlobal, isEnabled, isShowTextOnButtons, removeDecorateableActionListener, setAccelerator, setAcceleratorIsGlobal, setDisabledHoverIcon, setDisabledIcon, setDisabledPressedIcon, setEnabled, setHoverIcon, setIcon, setPressedIcon, setShowTextOnButtons, setText, setTooltip
-
Constructor Details
-
CButton
public CButton()Creates the new button -
CButton
Creates and initializes this button.- Parameters:
action- the action that represents this action, can benullbut then subclasses have to callinit(CommonSimpleButtonAction)
-
CButton
Creates a new button.- Parameters:
text- the text of this buttonicon- the icon of this button
-
-
Method Details
-
init
Description copied from class:CDecorateableActionInitializes this action, this method can be called only once.- Overrides:
initin classCDecorateableAction<CommonSimpleButtonAction>- Parameters:
action- the internal representation
-
addActionListener
Addslistenerto this button,listenerwill be called whenever this button it triggered.- Parameters:
listener- the new listener, notnull
-
removeActionListener
Removeslistenerfrom this button.- Parameters:
listener- the listener to remove
-
action
protected void action()Invoked when the user clicks onto this button. The default behavior is to callfire(). -
fire
protected void fire()Informs allActionListeners that this button was clicked.
-