Java Code Examples for org.openide.explorer.view.BeanTreeView#setRootVisible()

The following examples show how to use org.openide.explorer.view.BeanTreeView#setRootVisible() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BytecodeViewTopComponent.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private BytecodeViewTopComponent() {
    initComponents();
    setName(NbBundle.getMessage(BytecodeViewTopComponent.class, "CTL_BytecodeViewTopComponent"));
    setToolTipText(NbBundle.getMessage(BytecodeViewTopComponent.class, "HINT_BytecodeViewTopComponent"));

    manager = new ExplorerManager();
    rootNode = new MethodNode(null, null, "");
    manager.setRootContext(rootNode);

    setLayout(new BorderLayout());

    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    this.add(BorderLayout.CENTER, treeView);
    associateLookup(ExplorerUtils.createLookup(manager, getActionMap()));
}
 
Example 2
Source File: JaxWsExplorerPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initUserComponents() {
    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    treeView.setPopupAllowed(false);
    treeView.setBorder(new EtchedBorder());
    
    java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 11);
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(treeView, gridBagConstraints);
    jLblTreeView.setLabelFor(treeView.getViewport().getView());
    treeView.getAccessibleContext().setAccessibleName(NbBundle.getMessage(JaxWsExplorerPanel.class, "ACSD_WebServicesTreeView"));
    treeView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(JaxWsExplorerPanel.class, "ACSD_WebServicesTreeView"));
}
 
Example 3
Source File: SaasExplorerPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initUserComponents() {
    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    treeView.setPopupAllowed(false);
    treeView.setBorder(new EtchedBorder());
    treeView.setDefaultActionAllowed(false);
    
    java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 11);
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(treeView, gridBagConstraints);
    jLblTreeView.setLabelFor(treeView.getViewport().getView());
    treeView.getAccessibleContext().setAccessibleName(NbBundle.getMessage(SaasExplorerPanel.class, "ACSD_RESTResourcesTreeView"));
    treeView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SaasExplorerPanel.class, "ACSD_RESTResourcesTreeView"));
}
 
Example 4
Source File: NodeDisplayPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Creates a new instance of NodeDisplayPanel */
public NodeDisplayPanel(Node rootNode) {
    BeanTreeView btv = new BeanTreeView();
    btv.setRootVisible(false);
    btv.setDefaultActionAllowed(false);
    btv.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    manager.setRootContext(rootNode);
    Node[] rootChildren = rootNode.getChildren().getNodes();
    for (int i = 0; i < rootChildren.length; i++) {
        btv.expandNode(rootChildren[i]);
    }
    manager.addPropertyChangeListener(
    new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent pce) {
            firePropertyChange();
        }
    });
    setLayout(new BorderLayout());
    add(btv, BorderLayout.CENTER);
    btv.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(NodeDisplayPanel.class, "ACSD_PortNodeTreeView"));
    btv.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(NodeDisplayPanel.class, "ACSD_PortNodeTreeView"));
}
 
Example 5
Source File: BrowseFolders.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Creates new form BrowseFolders */
public BrowseFolders( SourceGroup[] folders, Class target, String preselectedFileName  ) {
    initComponents();
    getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(BrowseFolders.class, (target == DataFolder.class?"ACSD_BrowseFolders":"ACSD_BrowseFiles")));

    this.folders = folders;
    this.target = target;
    manager = new ExplorerManager();        
    AbstractNode rootNode = new AbstractNode( new SourceGroupsChildren( folders ) );
    manager.setRootContext( rootNode );
    
    // Create the templates view
    btv = new BeanTreeView();
    btv.setRootVisible( false );
    btv.setSelectionMode( javax.swing.tree.TreeSelectionModel.SINGLE_TREE_SELECTION );
    btv.setBorder( SAMPLE_SCROLL_PANE.getBorder() );
    expandSelection( preselectedFileName );
    folderPanel.add( btv, java.awt.BorderLayout.CENTER );
}
 
Example 6
Source File: DefaultClientSelectionPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initUserComponents() {
    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    treeView.setPopupAllowed(false);

    java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 11);
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(treeView, gridBagConstraints);
    jLblTreeView.setLabelFor(treeView.getViewport().getView());
    treeView.getAccessibleContext().setAccessibleName(
            NbBundle.getMessage(DefaultClientSelectionPanel.class, "ACSD_AvailableWebServicesTree"));
    treeView.getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(DefaultClientSelectionPanel.class, "ACSD_AvailableWebServicesTree"));
    treeView.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
}
 
Example 7
Source File: NodeDisplayPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public NodeDisplayPanel(Node rootNode) {
    BeanTreeView btv = new BeanTreeView();
    btv.setRootVisible(false);
    btv.setDefaultActionAllowed(false);
    btv.setFocusable(false);
    manager.setRootContext(rootNode);
    manager.addPropertyChangeListener(
    new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent pce) {
            firePropertyChange(ExplorerManager.PROP_NODE_CHANGE, null, null);
        }
    });
    setLayout(new BorderLayout());
    add(btv, BorderLayout.CENTER);
    btv.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(NodeDisplayPanel.class, "ACSD_NodeTreeView"));
    btv.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(NodeDisplayPanel.class, "ACSD_NodeTreeView"));
}
 
Example 8
Source File: RESTExplorerPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initUserComponents() {
    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    treeView.setPopupAllowed(false);
    treeView.setBorder(new EtchedBorder());
    treeView.setDefaultActionAllowed(false);
    
    java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 11);
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(treeView, gridBagConstraints);
    jLblTreeView.setLabelFor(treeView.getViewport().getView());
    treeView.getAccessibleContext().setAccessibleName(NbBundle.getMessage(RESTExplorerPanel.class, "ACSD_RESTResourcesTreeView"));
    treeView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(RESTExplorerPanel.class, "ACSD_RESTResourcesTreeView"));        
}
 
Example 9
Source File: BytecodeViewTopComponent.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private BytecodeViewTopComponent() {
    initComponents();
    setName(NbBundle.getMessage(BytecodeViewTopComponent.class, "CTL_BytecodeViewTopComponent"));
    setToolTipText(NbBundle.getMessage(BytecodeViewTopComponent.class, "HINT_BytecodeViewTopComponent"));

    manager = new ExplorerManager();
    rootNode = new MethodNode(null, null, "");
    manager.setRootContext(rootNode);

    setLayout(new BorderLayout());

    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    this.add(BorderLayout.CENTER, treeView);
    associateLookup(ExplorerUtils.createLookup(manager, getActionMap()));
}
 
Example 10
Source File: BytecodeViewTopComponent.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private BytecodeViewTopComponent() {
    initComponents();
    setName(NbBundle.getMessage(BytecodeViewTopComponent.class, "CTL_BytecodeViewTopComponent"));
    setToolTipText(NbBundle.getMessage(BytecodeViewTopComponent.class, "HINT_BytecodeViewTopComponent"));

    manager = new ExplorerManager();
    rootNode = new MethodNode(null, null, "");
    manager.setRootContext(rootNode);

    setLayout(new BorderLayout());

    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    this.add(BorderLayout.CENTER, treeView);
    associateLookup(ExplorerUtils.createLookup(manager, getActionMap()));
}
 
Example 11
Source File: BytecodeViewTopComponent.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private BytecodeViewTopComponent() {
    initComponents();
    setName(NbBundle.getMessage(BytecodeViewTopComponent.class, "CTL_BytecodeViewTopComponent"));
    setToolTipText(NbBundle.getMessage(BytecodeViewTopComponent.class, "HINT_BytecodeViewTopComponent"));

    manager = new ExplorerManager();
    rootNode = new MethodNode(null, null, "");
    manager.setRootContext(rootNode);

    setLayout(new BorderLayout());

    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    this.add(BorderLayout.CENTER, treeView);
    associateLookup(ExplorerUtils.createLookup(manager, getActionMap()));
}
 
Example 12
Source File: BrowseFolders.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Creates new form BrowseFolders */
public BrowseFolders( SourceGroup[] folders) {
    initComponents();
    this.folders = folders;
    manager = new ExplorerManager();        
    AbstractNode rootNode = new AbstractNode( new SourceGroupsChildren( folders ) );
    manager.setRootContext( rootNode );
    
    // Create the templates view
    BeanTreeView btv = new BeanTreeView();
    btv.setRootVisible( false );
    btv.setSelectionMode( javax.swing.tree.TreeSelectionModel.SINGLE_TREE_SELECTION );
    btv.setBorder( SAMPLE_SCROLL_PANE.getBorder() );
    folderPanel.add( btv, java.awt.BorderLayout.CENTER );
}
 
Example 13
Source File: SaasExplorerPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void initUserComponents() {
    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    treeView.setPopupAllowed(false);
    
    innerPanel.setLayout( new BorderLayout() );
    innerPanel.add(treeView , BorderLayout.CENTER);
    selectWsdlLbl.setLabelFor(treeView.getViewport().getView());
    treeView.getAccessibleContext().setAccessibleName(NbBundle.getMessage(
            SaasExplorerPanel.class, "ACSN_SaasTreeView"));     // NOI18N
    treeView.getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(SaasExplorerPanel.class, "ACSD_SaasTreeView")); //NOI18N
}
 
Example 14
Source File: CategoryView.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public CategoryView( CategoryModel categoryModel ) {

        this.categoryModel = categoryModel;

        // See #36315
        manager = new ExplorerManager();

        setLayout( new BorderLayout() );

        Dimension size = new Dimension( 220, 4 );
        btv = new BeanTreeView();    // Add the BeanTreeView
        btv.setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION );
        btv.setPopupAllowed( false );
        btv.setRootVisible( false );
        btv.setDefaultActionAllowed( false );
        btv.setMinimumSize( size );
        btv.setPreferredSize( size );
        btv.setMaximumSize( size );
        btv.setDragSource (false);
        this.add( btv, BorderLayout.CENTER );
        manager.setRootContext( createRootNode( categoryModel ) );
        manager.addPropertyChangeListener( this );
        categoryModel.addPropertyChangeListener( this );
        btv.expandAll();
        selectNode( categoryModel.getCurrentCategory() );

        btv.getAccessibleContext().setAccessibleName(NbBundle.getMessage(CategoryView.class,"AN_CatgoryView"));
        btv.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CategoryView.class,"AD_CategoryView"));

    }
 
Example 15
Source File: BrowseFolders.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Creates new form BrowseFolders
 */
public BrowseFolders(SourceGroup[] folders, FileObjectFilter filter) {
    initComponents();
    this.filter = filter == null ? new FileObjectFilter() : filter;
    manager = new ExplorerManager();
    AbstractNode rootNode = new AbstractNode(new SourceGroupsChildren(folders));
    manager.setRootContext(rootNode);
    
    // Create the templates view
    BeanTreeView btv = new BeanTreeView();
    btv.setRootVisible(false);
    btv.setSelectionMode(javax.swing.tree.TreeSelectionModel.SINGLE_TREE_SELECTION);
    btv.setBorder(SAMPLE_SCROLL_PANE.getBorder());
    folderPanel.add(btv, java.awt.BorderLayout.CENTER);
}
 
Example 16
Source File: SnippetPanelUI.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Creates new form SnippetPanelUI
 */
public SnippetPanelUI() {
    treeView = new BeanTreeView();

    initComponents();
    treeView.setRootVisible(false);
    
    manager.addPropertyChangeListener(this);
}
 
Example 17
Source File: UnusedBindingsPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes the three with unused bindings.
 */
private void initTreeView() {
    treeView = new BeanTreeView();
    treeView.setAllowedDragActions(DnDConstants.ACTION_NONE);
    treeView.setAllowedDropActions(DnDConstants.ACTION_NONE);
    treeView.setRootVisible(false);
}
 
Example 18
Source File: DomPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes the tree view.
 */
private void initTreeView() {
    treeView = new BeanTreeView() {
        {
            MouseAdapter listener = createTreeMouseListener();
            tree.addMouseListener(listener);
            tree.addMouseMotionListener(listener);
            tree.setCellRenderer(createTreeCellRenderer(tree.getCellRenderer()));
        }
    };
    treeView.setAllowedDragActions(DnDConstants.ACTION_NONE);
    treeView.setAllowedDropActions(DnDConstants.ACTION_NONE);
    treeView.setRootVisible(false);
}
 
Example 19
Source File: HierarchyTopComponent.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@NonNull
private static BeanTreeView createBeanTreeView() {
    final BeanTreeView btw = new BeanTreeView();
    btw.setRootVisible(false);
    return btw;
}
 
Example 20
Source File: CSSStylesDocumentPanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/**
 * Initializes the tree view.
 */
private void initTreeView() {
    treeView = new BeanTreeView() {
        {
            MouseAdapter listener = createTreeMouseListener();
            tree.addMouseListener(listener);
            tree.addMouseMotionListener(listener);
            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);
}