bibliothek.gui.dock.action.popup
Class DefaultActionPopupMenu

java.lang.Object
  extended by bibliothek.gui.dock.action.popup.DefaultActionPopupMenu
All Implemented Interfaces:
ActionPopupMenu

public class DefaultActionPopupMenu
extends Object
implements ActionPopupMenu

This is the default implementation of ActionPopupMenu, this implementation makes use of a MenuMenuHandler to create and update its content.

Author:
Benjamin Sigg

Constructor Summary
DefaultActionPopupMenu(Dockable dockable, DockActionSource actions)
           
DefaultActionPopupMenu(Dockable dockable, DockActionSource actions, JPopupMenu menu)
           
 
Method Summary
 void addListener(ActionPopupMenuListener listener)
          Adds a listener to this menu, the listener is to be informed if the menu closes.
 Dockable getDockable()
          Gets the Dockable for which this menu is shown.
 boolean isShowing()
          Tells whether the menu is currently open.
 void removeListener(ActionPopupMenuListener listener)
          Removes a listener from this menu.
 void show(Component owner, int x, int y)
          Opens this menu assuming the mouse is currently over owner at location x/y.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultActionPopupMenu

public DefaultActionPopupMenu(Dockable dockable,
                              DockActionSource actions)

DefaultActionPopupMenu

public DefaultActionPopupMenu(Dockable dockable,
                              DockActionSource actions,
                              JPopupMenu menu)
Method Detail

addListener

public void addListener(ActionPopupMenuListener listener)
Description copied from interface: ActionPopupMenu
Adds a listener to this menu, the listener is to be informed if the menu closes.

Specified by:
addListener in interface ActionPopupMenu
Parameters:
listener - the new listener

getDockable

public Dockable getDockable()
Description copied from interface: ActionPopupMenu
Gets the Dockable for which this menu is shown.

Specified by:
getDockable in interface ActionPopupMenu
Returns:
the owner of this menu

removeListener

public void removeListener(ActionPopupMenuListener listener)
Description copied from interface: ActionPopupMenu
Removes a listener from this menu.

Specified by:
removeListener in interface ActionPopupMenu
Parameters:
listener - the listener to remove

show

public void show(Component owner,
                 int x,
                 int y)
Description copied from interface: ActionPopupMenu
Opens this menu assuming the mouse is currently over owner at location x/y.

Specified by:
show in interface ActionPopupMenu
Parameters:
owner - the Component over which the menu should appear
x - the x coordinate of the position
y - the y coordinate of the position

isShowing

public boolean isShowing()
Tells whether the menu is currently open.

Returns:
true if the menu is open