charvax.swing
Class JPopupMenu

java.lang.Object
  extended bycharva.awt.Component
      extended bycharva.awt.Container
          extended bycharva.awt.Window
              extended bycharva.awt.Frame
                  extended bycharvax.swing.JFrame
                      extended bycharvax.swing.JPopupMenu
All Implemented Interfaces:
java.lang.Runnable

public class JPopupMenu
extends JFrame

An implementation of a popup menu - a small window that pops up and displays a number of choices.


Field Summary
protected  boolean _leftWasPressed
           
protected  boolean _rightWasPressed
           
protected  boolean _wasCancelled
           
 
Fields inherited from class charvax.swing.JFrame
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from class charva.awt.Window
_term
 
Fields inherited from class charva.awt.Container
_components, _currentFocus, _insets, _isValid, _layoutMgr, _minimumSize, _size
 
Fields inherited from class charva.awt.Component
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JPopupMenu(java.util.Vector items_)
          Constructs a JPopupMenu that contains the specified items.
 
Method Summary
 int getComponentIndex(Component c)
           
 Component getInvoker()
          Returns the component that invoked this popup menu.
 JMenuItem getMenuItem(int index_)
          Returns the menu item at the specified index.
 void processKeyEvent(KeyEvent e)
          Invoke all the KeyListener callbacks that may have been registered for this component.
 void setInvoker(Component invoker_)
          Sets the "invoker" of this popup menu; must be a JMenuBar or another JPopupMenu.
 java.lang.String toString()
           
 boolean wasCancelled()
           
 
Methods inherited from class charvax.swing.JFrame
getContentPane, minimumSize, setBackground, setDefaultCloseOperation, setForeground, setJMenuBar
 
Methods inherited from class charva.awt.Frame
draw, getTitle, setTitle
 
Methods inherited from class charva.awt.Window
addWindowListener, adjustLocation, debug, getLocationOnScreen, getOwner, hide, isDisplayed, isFocusTraversable, pack, processEvent, processWindowEvent, run, show
 
Methods inherited from class charva.awt.Container
add, add, doLayout, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getCurrentFocus, getHeight, getInsets, getSize, getWidth, invalidate, isValid, nextFocus, previousFocus, remove, requestFocus, setFocus, setHeight, setLayout, setSize, setSize, setWidth, validate
 
Methods inherited from class charva.awt.Component
addFocusListener, addKeyListener, contains, contains, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getName, getParent, hasFocus, isEnabled, isTotallyObscured, isVisible, processFocusEvent, processMouseEvent, repaint, requestSync, setBounds, setBounds, setBounds, setEnabled, setLocation, setLocation, setName, setParent, setVisible, validateCursesColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_wasCancelled

protected boolean _wasCancelled

_leftWasPressed

protected boolean _leftWasPressed

_rightWasPressed

protected boolean _rightWasPressed
Constructor Detail

JPopupMenu

public JPopupMenu(java.util.Vector items_)
Constructs a JPopupMenu that contains the specified items. Each element in the Vector must be a JMenuItem or JSeparator.

Method Detail

setInvoker

public void setInvoker(Component invoker_)
Sets the "invoker" of this popup menu; must be a JMenuBar or another JPopupMenu.


getInvoker

public Component getInvoker()
Returns the component that invoked this popup menu.


getMenuItem

public JMenuItem getMenuItem(int index_)
Returns the menu item at the specified index. If the item is a JSeparator, it returns null.


getComponentIndex

public int getComponentIndex(Component c)

processKeyEvent

public void processKeyEvent(KeyEvent e)
Description copied from class: Component
Invoke all the KeyListener callbacks that may have been registered for this component. The KeyListener objects may modify the keycodes, and can also set the "consumed" flag.

Overrides:
processKeyEvent in class Container

wasCancelled

public boolean wasCancelled()

toString

public java.lang.String toString()