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


Java BeanTreeView.setBorder方法代码示例

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


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

示例1: BrowseFolders

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
/** Creates new form BrowseFolders */
public BrowseFolders( SourceGroup[] folders, Project project, String preselectedFileName ) {
    initComponents();
    this.folders = folders;
    this.project = project;
    
    manager = new ExplorerManager();        
    AbstractNode rootNode = new AbstractNode( new SourceGroupsChildren( folders, project ) );
    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() );        
    btv.setPopupAllowed( false );
    btv.getAccessibleContext ().setAccessibleName (NbBundle.getMessage(BrowseFolders.class, "ACSN_BrowseFolders_folderPanel"));
    btv.getAccessibleContext ().setAccessibleDescription (NbBundle.getMessage(BrowseFolders.class, "ACSD_BrowseFolders_folderPanel"));
    expandSelection( preselectedFileName );
    //expandAllNodes( btv, manager.getRootContext() );
    folderPanel.add( btv, java.awt.BorderLayout.CENTER );      
    jLabel1.setLabelFor(btv.getViewport().getView());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:BrowseFolders.java

示例2: initComponents

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jScrollPane1 = new BeanTreeView();

    jScrollPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder(null, javax.swing.UIManager.getDefaults().getColor("CheckBoxMenuItem.selectionBackground")));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 524, Short.MAX_VALUE)
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE))
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:UsagesUI.java

示例3: ResourceSelector

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
public ResourceSelector(Node root) {
    setLayout(new BorderLayout(0, 5));
    setBorder(new EmptyBorder(12, 12, 0, 11));
    getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_ResourceSelector")); // NOI18N
    getAccessibleContext().setAccessibleName(bundle.getString("ACSN_ResourceSelector")); // NOI18N
    manager.setRootContext(root);
    
    BeanTreeView tree = new BeanTreeView();
    tree.setPopupAllowed(false);
    tree.setDefaultActionAllowed(false);
    // install proper border for tree
    tree.setBorder((Border)UIManager.get("Nb.ScrollPane.border")); // NOI18N
    tree.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_ResourceSelectorView")); // NOI18N
    tree.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_ResourceSelectorView")); // NOI18N
    add(tree, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:BiIconEditor.java

示例4: BrowseFolders

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
/**
 * Creates new form BrowseFolders
 */
public BrowseFolders(SourceGroup[] folders, FileFilter filter) {
    initComponents();
    
    this.filter = filter;
    if (this.filter == null) {
        this.filter = new FileFilter() {
            public boolean accept(File pathname) {
                return true;
            }
        };
    }
    
    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());
    btv.setDefaultActionAllowed(false);
    expandFirstLevel(btv);
    folderPanel.add(btv, java.awt.BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:BrowseFolders.java

示例5: initComponents

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jScrollPane1 = new BeanTreeView();
    lblDescription = new javax.swing.JLabel();

    jScrollPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder(null, javax.swing.UIManager.getDefaults().getColor("CheckBoxMenuItem.selectionBackground")));

    lblDescription.setText(org.openide.util.NbBundle.getMessage(AddDependencyUI.class, "LBL_Description")); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE)
                .addComponent(lblDescription, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(lblDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE))
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:AddDependencyUI.java

示例6: BrowseFolders

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
/** 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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:BrowseFolders.java

示例7: ClassPathFileChooser

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
/**
 * Creates a new ClassPathFileChooser. Can be used directly as a panel,
 * or getDialog can be called to get it wrapped in a Dialog.
 * @param fileInProject a source file from project sources (determines the
 *        project's classpath)
 * @param filter a filter for files to be displayed
 * @param choosingFolder if true, the chooser only allows to select a folder,
 *        and only source classpath is shown (i.e. not JARs on execution CP)
 * @param okCancelButtons defines whether the controls buttons should be shown
 *        (typically true if using as a dialog and false if using as a panel)
 */
public ClassPathFileChooser(FileObject fileInProject, Filter filter, boolean choosingFolder, boolean okCancelButtons) {
    this.choosingFolder = choosingFolder;

    Listener listener = new Listener();

    Node root = getRootNode(fileInProject, filter);
    explorerManager = new ExplorerManager();
    explorerManager.setRootContext(root);
    try {
        explorerManager.setSelectedNodes (new Node[] { root });
    }
    catch(PropertyVetoException ex) {
        ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
    }
    explorerManager.addPropertyChangeListener(listener);

    if (choosingFolder) { // add a button allowing to create a new folder
        newButton = new JButton();
        Mnemonics.setLocalizedText(newButton, NbBundle.getMessage(ClassPathFileChooser.class, "CTL_CreateNewButton")); // NOI18N
        newButton.addActionListener(listener);
        newButton.setEnabled(false);
        newButton.setToolTipText(NbBundle.getMessage(ClassPathFileChooser.class, "CTL_CreateNewButtonHint")); // NOI18N
    }
    if (okCancelButtons) {
        okButton = new JButton(NbBundle.getMessage(ClassPathFileChooser.class, "CTL_OKButton")); // NOI18N
        okButton.addActionListener(listener);
        okButton.setEnabled(false);
        cancelButton = new JButton(NbBundle.getMessage(ClassPathFileChooser.class, "CTL_CancelButton")); // NOI18N
    }

    treeView = new BeanTreeView();
    treeView.setPopupAllowed(false);
    treeView.setDefaultActionAllowed(true);
    treeView.setBorder((Border)UIManager.get("Nb.ScrollPane.border")); // NOI18N
    treeView.getAccessibleContext().setAccessibleName(NbBundle.getMessage(ClassPathFileChooser.class, "ACSN_FileSelectorTreeView")); // NOI18N
    treeView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ClassPathFileChooser.class, "ACSD_FileSelectorTreeView")); // NOI18N
    this.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ClassPathFileChooser.class, "ACSD_FileSelectorPanel")); // NOI18N

    // label and text field with mnemonic
    JLabel label = new JLabel();
    Mnemonics.setLocalizedText(label, NbBundle.getMessage(ClassPathFileChooser.class,
            choosingFolder ? "LBL_FolderName": "LBL_FileName")); // NOI18N
    fileNameTextField = new JTextField();
    fileNameTextField.getDocument().addDocumentListener(listener);
    fileNameTextField.addActionListener(listener);
    label.setLabelFor(fileNameTextField);

    GroupLayout layout = new GroupLayout(this);
    setLayout(layout);
    layout.setAutoCreateGaps(true);

    GroupLayout.SequentialGroup sq = layout.createSequentialGroup()
                                        .addComponent(label).addComponent(fileNameTextField);
    if (!okCancelButtons && newButton != null) // add newButton next to the text field
        sq.addComponent(newButton);
    layout.setHorizontalGroup(layout.createParallelGroup()
        .addComponent(treeView, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addGroup(sq));

    GroupLayout.ParallelGroup pq = layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                    .addComponent(label).addComponent(fileNameTextField);
    if (!okCancelButtons && newButton != null) // add newButton next to the text field
        pq.addComponent(newButton);
    layout.setVerticalGroup(layout.createSequentialGroup()
        .addComponent(treeView, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addGroup(pq));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:79,代码来源:ClassPathFileChooser.java

示例8: FileSelector

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
/**
     * @param title is a title of the dialog
     * @param rootLabel label for the root node
     * @param root the base object to start browsing from
     * @param acceptor decides whether we have valid selection or not
     * @param top is a <code>Component</code> we just place on the top of the dialog
     * it can be <code>null</code>
     */
    public FileSelector ( String rootLabel, Node root, final NodeAcceptor acceptor, Component top) {
        super ();

        this.acceptor = acceptor;
        
        ResourceBundle bundle = NbBundle.getBundle(FileSelector.class);


        okButton = new JButton(bundle.getString("CTL_FileSelectorOkButton"));
        cancelButton = new JButton(bundle.getString("CTL_FileSelectorCancelButton"));
        okButton.getAccessibleContext().setAccessibleDescription(bundle.getString ("ACSD_FileSelectorOkButton"));
        cancelButton.getAccessibleContext().setAccessibleDescription(bundle.getString ("ACSD_FileSelectorCancelButton"));
        buttons = new JButton[] { okButton, cancelButton };
        

        manager.setRootContext (root);//s[0]);
        
        // Center
        tree = new BeanTreeView () {
            {
                tree.setCellEditor(null);
                tree.setEditable(false);
            }
        };
        tree.setPopupAllowed (false);
        tree.setDefaultActionAllowed (false);
        // install proper border for tree
        tree.setBorder((Border)UIManager.get("Nb.ScrollPane.border")); // NOI18N
        tree.getAccessibleContext().setAccessibleName(NbBundle.getBundle(FileSelector.class).getString("ACSN_FileSelectorTreeView"));
        tree.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(FileSelector.class).getString("ACSD_FileSelectorTreeView"));
        this.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(FileSelector.class).getString("ACSD_FileSelectorDialog"));
        setLayout(new BorderLayout());
        add(tree, BorderLayout.CENTER);

        // component to place at the top
        try {
                manager.setSelectedNodes (new Node[] { root });
                JLabel label = new JLabel();
                Mnemonics.setLocalizedText(label, rootLabel);
                label.setLabelFor(tree.getViewport().getView());
                add(label, BorderLayout.NORTH);
        } catch(PropertyVetoException pve) {
            throw new IllegalStateException(pve.getMessage());
        }



        // South
        if (top != null) {
            add(top, BorderLayout.SOUTH);
        }

        manager.addPropertyChangeListener (this);

//        if (top != null) top.requestFocus ();

        if (acceptor.acceptNodes (manager.getSelectedNodes())) {
            enableButton ();
        } else {
            disableButton ();
        }

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

示例9: initComponents

import org.openide.explorer.view.BeanTreeView; //导入方法依赖的package包/类
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    lblClassName = new javax.swing.JLabel();
    txtClassName = new javax.swing.JTextField();
    treeView = new BeanTreeView();
    lblMatchingArtifacts = new javax.swing.JLabel();
    lblSelected = new javax.swing.JLabel();

    lblClassName.setText(org.openide.util.NbBundle.getMessage(SearchDependencyUI.class, "LBL_Class_Name")); // NOI18N

    treeView.setBorder(javax.swing.BorderFactory.createEtchedBorder(null, javax.swing.UIManager.getDefaults().getColor("ComboBox.selectionBackground")));

    lblMatchingArtifacts.setText(org.openide.util.NbBundle.getMessage(SearchDependencyUI.class, "LBL_Matching_artifacts")); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(lblSelected, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 430, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(treeView, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE)
                .addComponent(txtClassName, javax.swing.GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE)
                .addComponent(lblMatchingArtifacts, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE)
                .addComponent(lblClassName, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(lblClassName)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(txtClassName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(lblMatchingArtifacts)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(treeView, javax.swing.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(lblSelected, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:51,代码来源:SearchDependencyUI.java


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