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

The following examples show how to use org.openide.explorer.view.BeanTreeView#setDragSource() . 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: ComponentInspector.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void createComponents() {
    treeView = new BeanTreeView();
    treeView.setDragSource(true);
    treeView.setDropTarget(true);
    treeView.getAccessibleContext().setAccessibleName(
        FormUtils.getBundleString("ACS_ComponentTree")); // NOI18N
    treeView.getAccessibleContext().setAccessibleDescription(
        FormUtils.getBundleString("ACSD_ComponentTree")); // NOI18N
    add(treeView, BorderLayout.CENTER);
}
 
Example 2
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"));

    }