bibliothek.gui.dock.common.action
Class CButton

java.lang.Object
  extended by bibliothek.gui.dock.common.action.CAction
      extended by bibliothek.gui.dock.common.intern.action.CDecorateableAction
          extended by bibliothek.gui.dock.common.intern.action.CDropDownItem
              extended by bibliothek.gui.dock.common.action.CButton

public class CButton
extends CDropDownItem

A simple button, the user clicks onto the button and action() is called.

Author:
Benjamin Sigg

Constructor Summary
CButton()
          Creates the new button
CButton(java.lang.String text, javax.swing.Icon icon)
          Creates a new button.
 
Method Summary
protected  void action()
          Invoked when the user clicks onto this button.
 void addActionListener(java.awt.event.ActionListener listener)
          Adds listener to this button, listener will be called whenever this button it triggered.
protected  void fire()
          Informs all ActionListeners that this button was clicked.
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes listener from this button.
 
Methods inherited from class bibliothek.gui.dock.common.intern.action.CDropDownItem
init, isDropDownSelectable, isDropDownTriggerableNotSelected, isDropDownTriggerableSelected, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelected
 
Methods inherited from class bibliothek.gui.dock.common.intern.action.CDecorateableAction
getAccelerator, getDisabledIcon, getIcon, getText, getTooltip, init, isEnabled, setAccelerator, setDisabledIcon, setEnabled, setIcon, setText, setTooltip
 
Methods inherited from class bibliothek.gui.dock.common.action.CAction
init, intern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CButton

public CButton()
Creates the new button


CButton

public CButton(java.lang.String text,
               javax.swing.Icon icon)
Creates a new button.

Parameters:
text - the text of this button
icon - the icon of this button
Method Detail

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Adds listener to this button, listener will be called whenever this button it triggered.

Parameters:
listener - the new listener, not null

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes listener from 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 call fire().


fire

protected void fire()
Informs all ActionListeners that this button was clicked.