|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.event.MouseAdapter | +--com.objectwave.viewUtility.PopupMenu
Encapsulate all of the support necessary to support popup menus. Use like: PopupMenu menu = new PopupMenu(); for(int i = 0; i < .length; ++i) { menu.add(action[i]); } myFrame.addMouseListener(menu);
Nested Class Summary | |
protected class |
PopupMenu.ActionChangedListener
Expanded from the default of JPopupMenu to include updates the icon. |
static class |
PopupMenu.Test
|
Field Summary | |
protected java.awt.Point |
popupPoint
|
protected javax.swing.JPopupMenu |
selectionPopup
|
Constructor Summary | |
PopupMenu()
|
Method Summary | |
javax.swing.JMenuItem |
add(javax.swing.Action act)
Append a new menuitem to the end of the menu which dispatches the specified Action object. |
void |
addPopupMenuListener(javax.swing.event.PopupMenuListener l)
Add a PopupMenu listener |
void |
addSeparator()
Delegate to the real popup menu. |
javax.swing.JMenuItem |
addTransientMenuItem(javax.swing.Action act)
Append a new menuitem to the end of the menu which dispatches the specified Action object. |
void |
addTransientSeparator()
Delegate to the real popup menu. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Add a VetoableListener to the listener list. |
protected java.beans.PropertyChangeListener |
createActionChangeListener(javax.swing.JMenuItem b)
|
java.awt.Component |
getComponent()
The component in which the mouse was righclicked. |
java.awt.Component |
getPopupComponent()
In the event we have nested components, this will get the deepest component at that point. |
java.awt.Point |
getPopupPoint()
The point within the 'component' that mouse was righclicked. |
boolean |
isEventSource(javax.swing.event.PopupMenuEvent evt)
Since this class is hiding the popup menu, the PopupMenuEvents will not contain this class as the source. |
void |
mousePressed(java.awt.event.MouseEvent e)
|
protected void |
popupClosed()
|
void |
popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
|
void |
popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
|
void |
popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
|
void |
removePopupMenuListener(javax.swing.event.PopupMenuListener l)
Remove a PopupMenu listener |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Remove a VetoableChangeListener from the listener list. |
Methods inherited from class java.awt.event.MouseAdapter |
mouseClicked, mouseEntered, mouseExited, mouseReleased |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.swing.JPopupMenu selectionPopup
protected java.awt.Point popupPoint
Constructor Detail |
public PopupMenu()
Method Detail |
public boolean isEventSource(javax.swing.event.PopupMenuEvent evt)
evt
- The real popup menu event.public void addPopupMenuListener(javax.swing.event.PopupMenuListener l)
l
- The Listener to add.public void removePopupMenuListener(javax.swing.event.PopupMenuListener l)
l
- The listener to remove.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener to be addedpublic void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener to be removedpublic void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
popupMenuWillBecomeVisible
in interface javax.swing.event.PopupMenuListener
public void popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
popupMenuCanceled
in interface javax.swing.event.PopupMenuListener
public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
popupMenuWillBecomeInvisible
in interface javax.swing.event.PopupMenuListener
public java.awt.Point getPopupPoint()
protected void popupClosed()
public java.awt.Component getComponent()
public java.awt.Component getPopupComponent()
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
e
- MouseEvent The eventpublic void addSeparator()
public void addTransientSeparator()
public javax.swing.JMenuItem addTransientMenuItem(javax.swing.Action act)
act
- The Action object contains all of the information to create both the Menu label
and the action to take upon selection.Action
public javax.swing.JMenuItem add(javax.swing.Action act)
act
- The Action object contains all of the information to create both the Menu label
and the action to take upon selection.Action
protected java.beans.PropertyChangeListener createActionChangeListener(javax.swing.JMenuItem b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |