charvax.swing

Class JPopupMenu

Implemented Interfaces:
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

BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT, _alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible

Constructor Summary

JPopupMenu(Vector items_)
Constructs a JPopupMenu that contains the specified items.

Method Summary

int
getComponentIndex(Component c)
JMenuItem
getFirstMenuItem()
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)
void
setInvoker(Component invoker_)
Sets the "invoker" of this popup menu; must be a JMenuBar or another JPopupMenu.
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, draw, getLocationOnScreen, getOwner, hide, isDisplayed, isFocusTraversable, pack, processEvent, processWindowEvent, run, show

Methods inherited from class charva.awt.Container

add, add, debug, doLayout, draw, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getCurrentFocus, getHeight, getInsets, getSize, getWidth, invalidate, isFocusTraversable, isValid, minimumSize, nextFocus, previousFocus, processKeyEvent, remove, requestFocus, setBackground, setFocus, setForeground, setHeight, setLayout, setSize, setSize, setWidth, validate

Methods inherited from class charva.awt.Component

addFocusListener, addKeyListener, contains, contains, debug, draw, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getHeight, getLocation, getLocationOnScreen, getName, getParent, getSize, getWidth, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, minimumSize, processEvent, processFocusEvent, processKeyEvent, processMouseEvent, repaint, requestFocus, requestSync, setBackground, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor

Field Details

_leftWasPressed

protected boolean _leftWasPressed

_rightWasPressed

protected boolean _rightWasPressed

_wasCancelled

protected boolean _wasCancelled

Constructor Details

JPopupMenu

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

Method Details

getComponentIndex

public int getComponentIndex(Component c)

getFirstMenuItem

public JMenuItem getFirstMenuItem()

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.

processKeyEvent

public void processKeyEvent(KeyEvent e)
Overrides:
processKeyEvent in interface Container

setInvoker

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

toString

public String toString()

wasCancelled

public boolean wasCancelled()