Package javax.swing.tree

Examples of javax.swing.tree.TreeNode.children()


          TreeNode[] pathNodes = getPathToRoot((TreeNode) o[i]);

          if (node == null || pathNodes[0].toString().compareTo("Plugins") != 0) {
            TreeNode n1 = (TreeNode) o[i - 1];
            @SuppressWarnings("unchecked")
            Enumeration<DefaultMutableTreeNode> e1 = n1.children();

            while (e1.hasMoreElements()) {
              TreeNode n2 = e1.nextElement();
              if (n2.toString().compareTo(o[i].toString()) == 0) {
                o[i] = n2;
View Full Code Here


    private void expandAll(TreePath parent) {
        TreeNode node = (TreeNode)parent.getLastPathComponent();
        boolean hasAuxiliaryDsNodes = node instanceof DataSourceNode && ((DataSource)((DataSourceNode) node).getUserObject()).isCompound();

        if ((node.getChildCount() >= 0) && !hasAuxiliaryDsNodes) {
            for (Enumeration e=node.children(); e.hasMoreElements(); ) {
                TreeNode n = (TreeNode)e.nextElement();
                TreePath path = parent.pathByAddingChild(n);
                expandAll(path);
            }
        }
View Full Code Here

    private class PomTreeExpander implements TreeExpander {
        private boolean hasExpandedProjects() {
            final TreeNode projectsNode = model.getProjectsNode();
            //noinspection unchecked
            final Enumeration<TreeNode> projectNodes = projectsNode.children();
            while (projectNodes.hasMoreElements()) {
                final TreeNode node = projectNodes.nextElement();
                if (tree.isExpanded(new TreePath(model.getPathToRoot(node))))
                    return true;
            }
View Full Code Here

        }

        public void collapseAll() {
            final TreeNode projectsNode = model.getProjectsNode();
            //noinspection unchecked
            final Enumeration<TreeNode> projectNodes = projectsNode.children();
            while (projectNodes.hasMoreElements()) {
                final TreeNode node = projectNodes.nextElement();
                tree.collapsePath(new TreePath(model.getPathToRoot(node)));
            }
View Full Code Here

            final TreeNode pluginsNode = model.getPluginsNode();
            tree.expandPath(new TreePath(model.getPathToRoot(pluginsNode)));

            final TreeNode projectsNode = model.getProjectsNode();
            //noinspection unchecked
            final Enumeration<TreeNode> projectNodes = projectsNode.children();
            while (projectNodes.hasMoreElements()) {
                final TreeNode node = projectNodes.nextElement();
                tree.expandPath(new TreePath(model.getPathToRoot(node)));
            }
        }
View Full Code Here

                if (tablePath == null) {
                    return null;
                }

                tableNode = (TreeNode) tablePath.getLastPathComponent();
                enumer    = tableNode.children();

                while (enumer.hasMoreElements()) {
                    Object o = enumer.nextElement();

                    if (o.toString().equals("Indices")) {
View Full Code Here

    // Ensure that the template namespace tree node for the given namespace
    // is in its expanded state.
    void setNamespace(String namespace) {
        TreeNode root = (TreeNode) getModel().getRoot();
        Enumeration e = root.children();
        while (e.hasMoreElements()) {
            TemplateNamespaceTreeNode child =
                (TemplateNamespaceTreeNode) e.nextElement();
            String ns = child.toString();
            if (ns.equals(namespace)) {
View Full Code Here

    }

    // Initialize expanded states for namespace nodes
    private void initExpandedStates() {
        TreeNode root = (TreeNode) getModel().getRoot();
        Enumeration e = root.children();
        while (e.hasMoreElements()) {
            Object node = e.nextElement();
            String namespace = node.toString();
            if (Prefs.getBoolean(ExpandedKey + namespace, true)) {
                TreePath path = new TreePath(new Object[] { root, node });
View Full Code Here

    p.getResourceAttributes().setTitle((String)ra_title.getUserObject());
   
    //handle profile elements here
    TreeNode theProfElemRoot = theProfileRoot.getChildAt(2);
   
    for(Enumeration e = theProfElemRoot.children(); e.hasMoreElements(); ){
      DefaultMutableTreeNode profElemN_Root = (DefaultMutableTreeNode)e.nextElement();
      System.out.println("Got Profile Element "+(String)profElemN_Root.getUserObject());
      ProfileElement profElem = makeProfileElementFromTreeNode(p,profElemN_Root);
     
      if(profElem != null){
View Full Code Here

                if (tablePath == null) {
                    return null;
                }

                tableNode = (TreeNode) tablePath.getLastPathComponent();
                enumer    = tableNode.children();

                while (enumer.hasMoreElements()) {
                    Object o = enumer.nextElement();

                    if (o.toString().equals("Indices")) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.