|
org.openide.explorer 6.5.22 1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.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
public static class 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. The submenu content is taken as a blocking snapshot of the Node's Children at the time of the submenu popup and does not reflect subsequent changes to Node's Children until next popup. This means that the Node's Children should properly implement blocking getNodes(true) in order to show proper content in MenuView.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JMenu |
---|
JMenu.AccessibleJMenu, JMenu.WinListener |
Nested classes/interfaces inherited from class javax.swing.JMenuItem |
---|
JMenuItem.AccessibleJMenuItem |
Nested classes/interfaces inherited from class javax.swing.AbstractButton |
---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
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, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, 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)
Constructor that assigns the node a default action. |
|
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()
Overriden to fill the submenu with the real content lazily |
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 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 JPopupMenu getPopupMenu()
getPopupMenu
in class JMenu
public void processMouseEvent(MouseEvent e, MenuElement[] path, MenuSelectionManager manager)
right click
to ask the acceptor whether
to accept the selection.
processMouseEvent
in interface MenuElement
processMouseEvent
in class JMenuItem
e
- the mouse eventpath
- used by the superclassmanager
- used by the superclassprotected JMenuItem createMenuItem(Node n)
MenuView.MenuItem
s for leafs and Menu
for other nodes.
n
- node to create element for
|
org.openide.explorer 6.5.22 1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |