bibliothek.gui.dock.facile.action
Class CloseAction

java.lang.Object
  extended by bibliothek.gui.dock.action.actions.AbstractStandardDockAction
      extended by bibliothek.gui.dock.action.actions.SimpleDockAction
          extended by bibliothek.gui.dock.action.actions.SimpleDropDownItemAction
              extended by bibliothek.gui.dock.action.actions.SimpleButtonAction
                  extended by bibliothek.gui.dock.facile.action.CloseAction
All Implemented Interfaces:
SharingDropDownItemAction, SharingStandardDockAction, ButtonDockAction, DockAction, DropDownItemAction, ListeningDockAction, StandardDockAction, StandardDropDownItemAction
Direct Known Subclasses:
CCloseAction.Action

public class CloseAction
extends SimpleButtonAction
implements ListeningDockAction

This action shows an icon for "close". When the action is trigged, the close-method is invoked with the Dockable to close. This method will then remove the Dockable from it's parent.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.action.DockAction
BUTTON_CONTENT_FILTER
 
Constructor Summary
CloseAction(DockController controller)
          Sets the icon and the text of this action.
 
Method Summary
 void action(Dockable dockable)
          Invoked when this action is triggered by the user.
protected  void close(Dockable dockable)
          Invoked when the dockable has to be closed.
 DockActionIcon getCloseIcon()
          Gets the DockActionIcon which is responsible for automatically setting the close icon.
 DockActionIcon getCloseIconHover()
          Gets the DockActionIcon which is responsible for automatically setting the close icon when the mouse is hovering over the button.
 DockActionIcon getCloseIconPressed()
          Gets the DockActionIcon which is responsible for automatically setting the close icon if the mouse is pressed.
 void setController(DockController controller)
          Called when a new controller has been set.
 
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleButtonAction
addActionListener, createView, getCommand, removeActionListener, setCommand, trigger
 
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleDropDownItemAction
isDropDownSelectable, isDropDownSelectable, isDropDownTriggerable, isDropDownTriggerableNotSelected, isDropDownTriggerableSelected, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelected
 
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleDockAction
bound, getAccelerator, getDisabledIcon, getDockableRepresentation, getDockableRepresentation, getIcon, getIcon, getIcon, getIconContexts, getText, getText, getTooltip, getTooltipText, getTooltipText, isEnabled, isEnabled, setAccelerator, setDisabledIcon, setDockableRepresentation, setEnabled, setIcon, setIcon, setText, setTooltip, trigger, unbound
 
Methods inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction
addDockActionListener, bind, fireActionEnabledChanged, fireActionIconChanged, fireActionRepresentativeChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBoundDockables, isBound, removeDockActionListener, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.action.DockAction
bind, createView, trigger, unbind
 
Methods inherited from interface bibliothek.gui.dock.action.dropdown.DropDownItemAction
isDropDownSelectable, isDropDownTriggerable
 
Methods inherited from interface bibliothek.gui.dock.action.StandardDockAction
addDockActionListener, getDockableRepresentation, getIcon, getIconContexts, getText, getTooltipText, isEnabled, removeDockActionListener
 
Methods inherited from interface bibliothek.gui.dock.action.actions.SharingStandardDockAction
getAccelerator, getDisabledIcon, getDockableRepresentation, getIcon, getIcon, getText, getTooltip, getTooltipText, isEnabled, setAccelerator, setDisabledIcon, setDockableRepresentation, setEnabled, setIcon, setIcon, setText, setTooltip
 

Constructor Detail

CloseAction

public CloseAction(DockController controller)
Sets the icon and the text of this action.

Parameters:
controller - The controller from which this action should read properties, might be null and can be changed by the method setController
Method Detail

getCloseIcon

public DockActionIcon getCloseIcon()
Gets the DockActionIcon which is responsible for automatically setting the close icon.

Returns:
the object that sets the icon

getCloseIconHover

public DockActionIcon getCloseIconHover()
Gets the DockActionIcon which is responsible for automatically setting the close icon when the mouse is hovering over the button.

Returns:
the object that sets the icon

getCloseIconPressed

public DockActionIcon getCloseIconPressed()
Gets the DockActionIcon which is responsible for automatically setting the close icon if the mouse is pressed.

Returns:
the object that sets the icon

setController

public void setController(DockController controller)
Description copied from interface: ListeningDockAction
Called when a new controller has been set.

Specified by:
setController in interface ListeningDockAction
Parameters:
controller - the new controller

action

public void action(Dockable dockable)
Description copied from interface: ButtonDockAction
Invoked when this action is triggered by the user.

Specified by:
action in interface ButtonDockAction
Overrides:
action in class SimpleButtonAction
Parameters:
dockable - The Dockable which is associated with this DockAction, and which shall be used for the current action.

close

protected void close(Dockable dockable)
Invoked when the dockable has to be closed. The default-behaviour of this method is to remove the Dockable from it's parent, if there is a parent.

Parameters:
dockable - The Dockable to close