Package org.freeplane.core.ui.IndexedTree

Examples of org.freeplane.core.ui.IndexedTree.Node


  /** there are little reasons to use this in scripts. */
  public static Node findAssignedMenuItemNodeRecursively(final DefaultMutableTreeNode menubarNode,
                                                         final KeyStroke keystroke) {
    final Enumeration<?> children = menubarNode.children();
    while (children.hasMoreElements()) {
      final Node child = (Node) children.nextElement();
      final Object childUserObject = child.getUserObject();
      if (childUserObject instanceof JMenuItem) {
        final JMenuItem childMenuItem = (JMenuItem) childUserObject;
        if (keystroke.equals(childMenuItem.getAccelerator())) {
          return child;
        }
      }
      // recurse
      final Node assignedMenuItemNode = findAssignedMenuItemNodeRecursively(child, keystroke);
      if (assignedMenuItemNode != null)
        return assignedMenuItemNode;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.freeplane.core.ui.IndexedTree.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.