bibliothek.gui.dock.common.action.predefined
Class CCloseAction

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.predefined.CCloseAction

public class CCloseAction
extends CDropDownItem

An action that can close any CDockable by calling CDockable.setVisible(boolean). Clients can either create one CCloseAction for each CDockable or use one action for many CDockables at the same time.

Author:
Benjamin Sigg

Constructor Summary
CCloseAction(CControl control)
          Creates a new action
 
Method Summary
 void close(CDockable dockable)
          Closes dockable now.
 
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

CCloseAction

public CCloseAction(CControl control)
Creates a new action

Parameters:
control - the control for which this action will be used
Method Detail

close

public void close(CDockable dockable)
Closes dockable now. This method is always called when this action is triggered, so this is the optimal method to be overridden and extended with new features like a JOptionPane asking whether dockable should really be closed.
Note: Consider using the CVetoClosingListener instead, it can handle all kind of closing events.

Parameters:
dockable - the element to close