bibliothek.gui.dock.action.actions
Class SimpleButtonAction

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
All Implemented Interfaces:
SharingDropDownItemAction, SharingStandardDockAction, ButtonDockAction, DockAction, DropDownItemAction, StandardDockAction, StandardDropDownItemAction
Direct Known Subclasses:
CloseAction, CommonSimpleButtonAction, DockFrontend.Hider, LocationModeAction, RenameAction

public class SimpleButtonAction
extends SimpleDropDownItemAction
implements ButtonDockAction

A ButtonDockAction that has the same properties for all Dockables which use the action.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.action.DockAction
BUTTON_CONTENT_FILTER
 
Constructor Summary
SimpleButtonAction()
          Creates a new action
SimpleButtonAction(boolean monitorDisabling)
          Creates a new action
 
Method Summary
 void action(Dockable dockable)
          Invoked when this action is triggered by the user.
 void addActionListener(ActionListener listener)
          Adds a listener to this action.
<V> V
createView(ViewTarget<V> target, ActionViewConverter converter, Dockable dockable)
          Creates a view for this action, for the platform target and with help of converter.
 String getCommand()
          Gets the command of this action.
 void removeActionListener(ActionListener listener)
          Removes a listener from this action.
 void setCommand(String command)
          Sets the command of this action.
 boolean trigger(Dockable dockable)
          Does the appropriate action that can be done respecting the current state of this action.
 
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.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.DockAction
bind, unbind
 
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

SimpleButtonAction

public SimpleButtonAction()
Creates a new action


SimpleButtonAction

public SimpleButtonAction(boolean monitorDisabling)
Creates a new action

Parameters:
monitorDisabling - whether to monitor the current DisablingStrategy
Method Detail

createView

public <V> V createView(ViewTarget<V> target,
                        ActionViewConverter converter,
                        Dockable dockable)
Description copied from interface: DockAction
Creates a view for this action, for the platform target and with help of converter. Clients might use their own code to create a new view, but the preferred way is to call ActionViewConverter.createView(ActionType, DockAction, ViewTarget, Dockable) with an ActionType that fits to this DockAction.

Specified by:
createView in interface DockAction
Type Parameters:
V - the type of view requested
Parameters:
target - The platform on which the view will be used
converter - A set of methods that can be used to create a view
dockable - The Dockable for which the view will be shown. Note that this action may not yet be bound to this action.
Returns:
a new view

setCommand

public void setCommand(String command)
Sets the command of this action. The command will be set in each ActionEvent that is created and fired by this action.

Parameters:
command - the command, might be null

getCommand

public String getCommand()
Gets the command of this action.

Returns:
the command, might be null
See Also:
setCommand(String)

addActionListener

public void addActionListener(ActionListener listener)
Adds a listener to this action. The listener will be notified whenever this action is triggered.

Parameters:
listener - the new listener

removeActionListener

public void removeActionListener(ActionListener listener)
Removes a listener from this action.

Parameters:
listener - the listener to remove

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
Parameters:
dockable - The Dockable which is associated with this DockAction, and which shall be used for the current action.

trigger

public boolean trigger(Dockable dockable)
Description copied from interface: DockAction
Does the appropriate action that can be done respecting the current state of this action.

Specified by:
trigger in interface DockAction
Parameters:
dockable - the element for which this action is called
Returns:
true if this action could do anything, false if this action was not able to react in any way to the event.