bibliothek.gui.dock.action.actions
Class RenameAction

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.action.actions.RenameAction
All Implemented Interfaces:
ButtonDockAction, DockAction, DropDownItemAction, StandardDockAction, StandardDropDownItemAction
Direct Known Subclasses:
RenameAction.RenameDefaultDockable, RenameAction.RenameFlapDockStation, RenameAction.RenameSplitDockStation, RenameAction.RenameStackDockStation

public abstract class RenameAction
extends SimpleButtonAction

This DockAction can change the title-text of a Dockable. When this action is triggered, a popupmenu will appear, where the user can enter the new title of the Dockable.
RenameActions can be easely created by a RenameActionFactory

Author:
Benjamin Sigg

Nested Class Summary
static class RenameAction.RenameDefaultDockable
          An implementation of RenameAction that can handle DefaultDockables.
static class RenameAction.RenameFlapDockStation
          An implementation of RenameAction that can handle FlapDockStations.
static class RenameAction.RenameSplitDockStation
          An implementation of RenameAction that can handle SplitDockStations.
static class RenameAction.RenameStackDockStation
          An implementation of RenameAction that can handle StackDockStations.
 
Field Summary
private  javax.swing.JButton cancelButton
          button to cancel the event
private  Dockable current
          the dockable whose title is currently changed
private  javax.swing.JPopupMenu menu
          the menu on which the items will be shown
private  javax.swing.JButton okButton
          button that is pressed if the new name should be applied
private  javax.swing.JTextField titleField
          the field containing the new title
 
Constructor Summary
RenameAction(DockController controller)
          Constructs a new action
 
Method Summary
 void action(Dockable dockable)
          Invoked when this action is triggered by the user.
private  void rename()
          Changes the name of the current Dockable to the text of the titleField.
protected abstract  void rename(Dockable dockable, java.lang.String text)
          Invoked when the action was triggered, and the user tipped in the new title for dockable.
 
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleButtonAction
addActionListener, createView, getCommand, removeActionListener, setCommand
 
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
getDisabledIcon, getDisabledIcon, getIcon, getIcon, getText, getText, getTooltipText, getTooltipText, isEnabled, isEnabled, setDisabledIcon, setEnabled, setIcon, setText, setTooltipText
 
Methods inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction
addDockActionListener, bind, binded, fireActionDisabledIconChanged, fireActionEnabledChanged, fireActionIconChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBindeds, isBinded, removeDockActionListener, unbind, unbinded
 
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
 

Field Detail

okButton

private javax.swing.JButton okButton
button that is pressed if the new name should be applied


cancelButton

private javax.swing.JButton cancelButton
button to cancel the event


titleField

private javax.swing.JTextField titleField
the field containing the new title


menu

private javax.swing.JPopupMenu menu
the menu on which the items will be shown


current

private Dockable current
the dockable whose title is currently changed

Constructor Detail

RenameAction

public RenameAction(DockController controller)
Constructs a new action

Parameters:
controller - The controller to which a listener will be added to get the Icon for this action
Method Detail

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.

rename

private void rename()
Changes the name of the current Dockable to the text of the titleField.


rename

protected abstract void rename(Dockable dockable,
                               java.lang.String text)
Invoked when the action was triggered, and the user tipped in the new title for dockable.

Parameters:
dockable - The Dockable whose title should be changed
text - The new title