org.moyoman.client.reference.util
Class PopupListener

java.lang.Object
  |
  +--java.awt.event.MouseAdapter
        |
        +--org.moyoman.client.reference.util.PopupListener
All Implemented Interfaces:
EventListener, MouseListener

public class PopupListener
extends MouseAdapter

Provides a simple listener to activate popup menus. This listener is installed upon the component over which you wish the popup to appear.

Since:
v0.01
Version:
v0.01
Author:
Jeffrey M. Thompson

Field Summary
private  JPopupMenu _popup
          Handle to the popup menu.
 
Constructor Summary
PopupListener(JPopupMenu popup)
          Create the listener with a handle to the popup menu.
 
Method Summary
private  void maybeShowPopup(MouseEvent e)
          Show the popup menu based upon the event type.
 void mousePressed(MouseEvent e)
          Respond to a mouse pressed event.
 void mouseReleased(MouseEvent e)
          Respond to a mouse released event.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_popup

private JPopupMenu _popup
Handle to the popup menu.

Constructor Detail

PopupListener

public PopupListener(JPopupMenu popup)
Create the listener with a handle to the popup menu.

Parameters:
popup - The popup menu to activate.
Since:
v0.01
Method Detail

mousePressed

public void mousePressed(MouseEvent e)
Respond to a mouse pressed event.

Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class MouseAdapter
Since:
v0.01

mouseReleased

public void mouseReleased(MouseEvent e)
Respond to a mouse released event.

Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class MouseAdapter
Since:
v0.01

maybeShowPopup

private void maybeShowPopup(MouseEvent e)
Show the popup menu based upon the event type.

Since:
v0.01