|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.AbstractButton | +--javax.swing.JMenuItem | +--javax.swing.JMenu | +--org.openide.awt.JMenuPlus | +--org.openide.explorer.view.MenuView.Menu
Menu item representing a node (with children) in a menu hierarchy. One can attach an acceptor to the menu that will be informed each time a user selects an item whether to close the menu or not.
Inner classes inherited from class javax.swing.JMenu |
JMenu.AccessibleJMenu, JMenu.WinListener |
Inner classes inherited from class javax.swing.JMenuItem |
JMenuItem.AccessibleJMenuItem |
Inner classes inherited from class javax.swing.AbstractButton |
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent |
Field Summary | |
protected NodeAcceptor |
action
Action listener to attach to all menu items. |
protected Node |
node
The node represented. |
Fields inherited from class javax.swing.JMenu |
popupListener |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
MenuView.Menu(Node node)
Constuctor that assigns the node a default action, e.g. |
|
MenuView.Menu(Node node,
MenuView.Acceptor action)
Deprecated. use MenuView.Menu(Node, NodeAcceptor) |
|
MenuView.Menu(Node node,
MenuView.Acceptor action,
boolean setName)
Deprecated. use MenuView.Menu(Node, NodeAcceptor, boolean) |
|
MenuView.Menu(Node node,
NodeAcceptor action)
Constructor that permits specification of the action on the node. |
|
MenuView.Menu(Node node,
NodeAcceptor action,
boolean setName)
Constructor that permits specification of the action on the node, and permits overriding the name and icon of the menu. |
Method Summary | |
protected JMenuItem |
createMenuItem(Node n)
Create a menu element for a node. |
JPopupMenu |
getPopupMenu()
Overrides superclass method. |
void |
processMouseEvent(MouseEvent e,
MenuElement[] path,
MenuSelectionManager manager)
Checks for right click to ask the acceptor whether
to accept the selection. |
Methods inherited from class org.openide.awt.JMenuPlus |
getPopupMenuOrigin, setPopupMenuVisible |
Methods inherited from class java.awt.Container |
add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.swing.MenuElement |
processKeyEvent |
Field Detail |
protected Node node
protected NodeAcceptor action
Constructor Detail |
public MenuView.Menu(Node node)
node
- node to representpublic MenuView.Menu(Node node, NodeAcceptor action)
node
- node to representaction
- action called when node is selectedpublic MenuView.Menu(Node node, MenuView.Acceptor action)
MenuView.Menu(Node, NodeAcceptor)
public MenuView.Menu(Node node, MenuView.Acceptor action, boolean setName)
MenuView.Menu(Node, NodeAcceptor, boolean)
public MenuView.Menu(Node node, NodeAcceptor action, boolean setName)
node
- node to representaction
- action called when node selectedsetName
- true
to automatically set the name and icon of the itemMethod Detail |
public void processMouseEvent(MouseEvent e, MenuElement[] path, MenuSelectionManager manager)
right click
to ask the acceptor whether
to accept the selection.processMouseEvent
in class JMenuItem
e
- the mouse eventpath
- used by the superclassmanager
- used by the superclasspublic JPopupMenu getPopupMenu()
getPopupMenu
in class JMenu
protected JMenuItem createMenuItem(Node n)
MenuView.MenuItem
s for leafs and Menu
for other nodes.n
- node to create element for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |