bibliothek.gui.dock.common.action
Class CPanelPopup.PanelPopup

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.common.action.core.CommonSimpleButtonAction
                      extended by bibliothek.gui.dock.common.action.CPanelPopup.PanelPopup
All Implemented Interfaces:
SharingDropDownItemAction, SharingStandardDockAction, ButtonDockAction, DockAction, DropDownItemAction, StandardDockAction, StandardDropDownItemAction, CommonDecoratableDockAction, CommonDockAction, CommonDropDownItem
Enclosing class:
CPanelPopup

public class CPanelPopup.PanelPopup
extends CommonSimpleButtonAction

A custom action shows some dialog or window when triggered

Author:
Benjamin Sigg

Constructor Summary
CPanelPopup.PanelPopup()
          Creates a new action
 
Method Summary
<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.
 CPanelPopup getAction()
          Gets the CAction that is represented by this action.
 void onMenuItemTrigger(Dockable dockable)
          Called if the menu-item representing this action has been hit.
 void onMenuTrigger(JPopupMenu menu)
          Called if a menu is opening a submenu in which the content is to be shown.
 void onMousePressed(Dockable dockable, JComponent item, DockTitle.Orientation orientation)
          Called if the mouse is pressed on the button item of of a DockTitle which has orientation orientation.
 void onMouseReleased(Dockable dockable, JComponent item, DockTitle.Orientation orientation)
          Called if the mouse is released of the button item of of a DockTitle which has orientation orientation.
 void onTrigger(Dockable dockable, JComponent item, DockTitle.Orientation orientation)
          Called if the button item of a DockTitle which has orientation orientation was triggered.
 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.SimpleButtonAction
action, addActionListener, 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
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.actions.SharingDropDownItemAction
isDropDownSelectable, isDropDownTriggerableNotSelected, isDropDownTriggerableSelected, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelected
 
Methods inherited from interface bibliothek.gui.dock.action.dropdown.DropDownItemAction
isDropDownSelectable, isDropDownTriggerable
 
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
 
Methods inherited from interface bibliothek.gui.dock.action.StandardDockAction
addDockActionListener, getDockableRepresentation, getIcon, getIconContexts, getText, getTooltipText, isEnabled, removeDockActionListener
 

Constructor Detail

CPanelPopup.PanelPopup

public CPanelPopup.PanelPopup()
Creates a new action

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
Overrides:
createView in class SimpleButtonAction
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

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
Overrides:
trigger in class SimpleButtonAction
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.

getAction

public CPanelPopup getAction()
Gets the CAction that is represented by this action.

Specified by:
getAction in interface CommonDockAction
Overrides:
getAction in class CommonSimpleButtonAction
Returns:
the action, never null

onMousePressed

public void onMousePressed(Dockable dockable,
                           JComponent item,
                           DockTitle.Orientation orientation)
Called if the mouse is pressed on the button item of of a DockTitle which has orientation orientation.

Parameters:
dockable - the element for which this panel is shown
item - the pressed component
orientation - the orientation of the title

onMouseReleased

public void onMouseReleased(Dockable dockable,
                            JComponent item,
                            DockTitle.Orientation orientation)
Called if the mouse is released of the button item of of a DockTitle which has orientation orientation.

Parameters:
dockable - the element for which this panel is shown
item - the released component
orientation - the orientation of the title

onTrigger

public void onTrigger(Dockable dockable,
                      JComponent item,
                      DockTitle.Orientation orientation)
Called if the button item of a DockTitle which has orientation orientation was triggered.

Parameters:
dockable - the element for which this panel is shown
item - the triggered button
orientation - the orientation of the title

onMenuItemTrigger

public void onMenuItemTrigger(Dockable dockable)
Called if the menu-item representing this action has been hit.

Parameters:
dockable - the source of the event

onMenuTrigger

public void onMenuTrigger(JPopupMenu menu)
Called if a menu is opening a submenu in which the content is to be shown.

Parameters:
menu - the new parent of the content