当前位置: 首页>>代码示例>>Java>>正文


Java BeanTreeView.expandNode方法代码示例

本文整理汇总了Java中org.openide.explorer.view.BeanTreeView.expandNode方法的典型用法代码示例。如果您正苦于以下问题:Java BeanTreeView.expandNode方法的具体用法?Java BeanTreeView.expandNode怎么用?Java BeanTreeView.expandNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.explorer.view.BeanTreeView的用法示例。


在下文中一共展示了BeanTreeView.expandNode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: expandAllNodes

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
private static void expandAllNodes (BeanTreeView btv, Node node, ExplorerManager mgr, JavaPlatform platform) {
    btv.expandNode (node);
    Children ch = node.getChildren();
    if ( ch == Children.LEAF ) {
        if (platform != null && platform.equals(node.getLookup().lookup(JavaPlatform.class))) {
            try {
                mgr.setSelectedNodes (new Node[] {node});
            } catch (PropertyVetoException e) {
                //Ignore it
            }
        }
        return;
    }
    Node nodes[] = ch.getNodes( true );
    for ( int i = 0; i < nodes.length; i++ ) {
        expandAllNodes( btv, nodes[i], mgr, platform);
    }

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:PlatformsCustomizer.java

示例2: expandFirstLevel

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
private void expandFirstLevel(BeanTreeView btv) {
    
    Node root = manager.getRootContext();
    Children ch = root.getChildren();
    if ( ch == Children.LEAF ) {
        return;
    }
    Node nodes[] = ch.getNodes(true);

    btv.expandNode(root);
    for ( int i = 0; i < nodes.length; i++ ) {            
        btv.expandNode( nodes[i] );
        if ( i == 0 ) {
            try {
                manager.setSelectedNodes( new Node[] { nodes[i] } );
            }
            catch ( java.beans.PropertyVetoException e ) {
                // No selection for some reason
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:BrowseFolders.java

示例3: expandAllNodes

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
private static void expandAllNodes(BeanTreeView btv, Node node, ExplorerManager mgr, AndroidSdk platform) {
    btv.expandNode(node);
    Children ch = node.getChildren();
    if (ch == Children.LEAF) {
        if (platform != null && platform.equals(node.getLookup().lookup(AndroidSdk.class))) {
            try {
                mgr.setSelectedNodes(new Node[]{node});
            } catch (PropertyVetoException e) {
                //Ignore it
            }
        }
        return;
    }
    Node nodes[] = ch.getNodes(true);
    for (int i = 0; i < nodes.length; i++) {
        expandAllNodes(btv, nodes[i], mgr, platform);
    }

}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:20,代码来源:SdksCustomizer.java

示例4: expandAllNodes

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
private static void expandAllNodes (BeanTreeView btv, Node node) {
    btv.expandNode (node);
    Children ch = node.getChildren();
    if ( ch == Children.LEAF ) {            
        return;
    }
    Node nodes[] = ch.getNodes( true );
    for ( int i = 0; i < nodes.length; i++ ) {
        expandAllNodes( btv, nodes[i]);
    }

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:LibrariesCustomizer.java

示例5: initTreeView

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
/**
 * Initializes the tree view.
 */
private void initTreeView() {
    treeView = new BeanTreeView() {
        {
            tree.setCellRenderer(createTreeCellRenderer(tree.getCellRenderer()));
        }

        @Override
        public void expandAll() {
            // The original expandAll() doesn't work for us as it doesn't
            // seem to wait for the calculation of sub-nodes.
            Node root = manager.getRootContext();
            expandAll(root);
            // The view attempts to scroll to the expanded node
            // and it does it with a delay. Hence, simple calls like
            // tree.scrollRowToVisible(0) have no effect (are overriden
            // later) => the dummy collapse and expansion attempts
            // to work around that and keep the root node visible.
            collapseNode(root);
            expandNode(root);
        }

        /**
         * Expands the whole sub-tree under the specified node.
         *
         * @param node root node of the sub-tree that should be expanded.
         */
        private void expandAll(Node node) {
            treeView.expandNode(node);
            for (Node subNode : node.getChildren().getNodes(true)) {
                if (!subNode.isLeaf()) {
                    expandAll(subNode);
                }
            }
        }
    };
    treeView.setAllowedDragActions(DnDConstants.ACTION_NONE);
    treeView.setAllowedDropActions(DnDConstants.ACTION_NONE);
    treeView.setRootVisible(false);
    add(treeView, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:44,代码来源:DocumentViewPanel.java


注:本文中的org.openide.explorer.view.BeanTreeView.expandNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。