public class DefaultActionPopupMenu extends java.lang.Object implements ActionPopupMenu
ActionPopupMenu
, this implementation
makes use of a MenuMenuHandler
to create and update its content.Constructor and Description |
---|
DefaultActionPopupMenu(Dockable dockable,
DockActionSource actions) |
DefaultActionPopupMenu(Dockable dockable,
DockActionSource actions,
javax.swing.JPopupMenu menu) |
Modifier and Type | Method and Description |
---|---|
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(java.awt.Component owner,
int x,
int y)
Opens this menu assuming the mouse is currently over
owner
at location x/y . |
public DefaultActionPopupMenu(Dockable dockable, DockActionSource actions)
public DefaultActionPopupMenu(Dockable dockable, DockActionSource actions, javax.swing.JPopupMenu menu)
public void addListener(ActionPopupMenuListener listener)
ActionPopupMenu
addListener
in interface ActionPopupMenu
listener
- the new listenerpublic Dockable getDockable()
ActionPopupMenu
Dockable
for which this menu is shown.getDockable
in interface ActionPopupMenu
public void removeListener(ActionPopupMenuListener listener)
ActionPopupMenu
removeListener
in interface ActionPopupMenu
listener
- the listener to removepublic void show(java.awt.Component owner, int x, int y)
ActionPopupMenu
owner
at location x/y
.show
in interface ActionPopupMenu
owner
- the Component
over which the menu should appearx
- the x coordinate of the positiony
- the y coordinate of the positionpublic boolean isShowing()
true
if the menu is open