本文整理汇总了Java中org.openide.explorer.view.BeanTreeView类的典型用法代码示例。如果您正苦于以下问题:Java BeanTreeView类的具体用法?Java BeanTreeView怎么用?Java BeanTreeView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BeanTreeView类属于org.openide.explorer.view包,在下文中一共展示了BeanTreeView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateFields
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
private void populateFields() {
Iterator<? extends DependencyNode> iter = result.allInstances().iterator();
if (iter.hasNext()) {
final DependencyNode root = iter.next();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
NodeVisitor vis = new NodeVisitor(Arrays.asList(new String[]{ Artifact.SCOPE_COMPILE, Artifact.SCOPE_PROVIDED, Artifact.SCOPE_RUNTIME, Artifact.SCOPE_TEST}));
root.accept(vis);
vis.getListOfDependencies();
explorerManager.setRootContext(new AbstractNode(createListChildren(vis.getListOfDependencies(), getLookup())));
treeExplorerManager.setRootContext(new AbstractNode(createTreeChildren(root, getLookup())));
((BeanTreeView)tvTree).expandAll();
}
});
} else {
}
}
示例2: 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);
}
}
示例3: ServicesTab
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
private ServicesTab() {
manager = new ExplorerManager();
manager.setRootContext(new ServicesNode());
ActionMap map = getActionMap();
map.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(manager));
map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(manager));
map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(manager));
map.put("delete", ExplorerUtils.actionDelete(manager, false));
associateLookup(ExplorerUtils.createLookup(manager, map));
view = new BeanTreeView();
view.setRootVisible(false);
setLayout(new BorderLayout());
add(view);
setName(ID);
setDisplayName(NbBundle.getMessage(ServicesTab.class, "LBL_Services"));
}
示例4: select
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
public Node[] select(String title, String rootTitle, Node root, NodeAcceptor acceptor, Component top) throws UserCancelException {
// XXX rootTitle and acceptor currently ignored
JDialog d = new JDialog();
d.setTitle(title);
d.setModal(true);
d.getContentPane().setLayout(new BorderLayout());
EP p = new EP();
p.getExplorerManager().setRootContext(root);
p.setLayout(new BorderLayout());
p.add(new BeanTreeView(), BorderLayout.CENTER);
d.getContentPane().add(p, BorderLayout.CENTER);
if (top != null) {
d.getContentPane().add(top, BorderLayout.NORTH);
}
d.pack();
d.setVisible(true);
Node[] nodes = p.getExplorerManager().getSelectedNodes();
d.dispose();
return nodes;
}
示例5: 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());
}
示例6: 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))
);
}
示例7: DMListPanel
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
public DMListPanel(MavenProject project) {
this.project = project;
btv = new BeanTreeView();
btv.setRootVisible(false);
btv.setDefaultActionAllowed(true);
//lv.setDefaultProcessor(this);
manager = new ExplorerManager();
manager.addPropertyChangeListener(this);
setLayout(new BorderLayout());
add(btv, BorderLayout.CENTER);
addAncestorListener(this);
AddDependencyPanel.this.artifactsLabel.setLabelFor(btv);
// disable tab if DM section not defined
RPofDMListPanel.post(this);
}
示例8: GoalsPanel
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
/** Creates new form POMInheritancePanel */
@Messages("HINT_Panel_hide=Click or press {0} to hide/show when the Navigator is active")
public GoalsPanel() {
initComponents();
treeView = (BeanTreeView)jScrollPane1;
preferences = NbPreferences.forModule(GoalsPanel.class).node("goalNavigator");
filtersPanel = new TapPanel();
filtersPanel.setOrientation(TapPanel.DOWN);
// tooltip
KeyStroke toggleKey = KeyStroke.getKeyStroke(KeyEvent.VK_T,
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
String keyText = Utilities.keyToString(toggleKey);
filtersPanel.setToolTipText(HINT_Panel_hide(keyText)); //NOI18N
JComponent buttons = createFilterButtons();
buttons.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 0));
filtersPanel.add(buttons);
if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) {
filtersPanel.setBackground(UIManager.getColor("NbExplorerView.background"));//NOI18N
}
add(filtersPanel, BorderLayout.SOUTH);
}
示例9: setUp
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
protected void setUp () {
System.setProperty("org.openide.util.Lookup", Lkp.class.getName()); // no lookup
p = new ExplorerPanel ();
em = p.getExplorerManager ();
TreeView tv = new BeanTreeView ();
p.add (tv);
Children ch = new Children.Array ();
nodes = new Node[10];
for (int i = 0; i < 10; i++) {
nodes[i] = new AbstractNode (Children.LEAF);
nodes[i].setName ("Node" + i);
}
ch.add (nodes);
Node root = new AbstractNode (ch);
em.setRootContext (root);
// check synchronixzation before
assertArrays ("INIT: getSelectedNodes equals getActivatedNodes.",
em.getSelectedNodes (), p.getActivatedNodes ());
}
示例10: 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();
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
);
}
示例11: nodeBasedView
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
private static Component nodeBasedView(Node root) {
Node root2;
if (Children.MUTEX == Mutex.EVENT) {
// #35833 branch.
root2 = root;
} else {
root2 = new EQReplannedNode(root);
}
ExpPanel p = new ExpPanel();
p.setLayout(new BorderLayout());
JComponent tree = new BeanTreeView();
p.add(tree, BorderLayout.CENTER);
p.getExplorerManager().setRootContext(root2);
try {
p.getExplorerManager().setSelectedNodes(new Node[] {root2});
} catch (PropertyVetoException pve) {
pve.printStackTrace();
}
Object key = "org.openide.actions.PopupAction";
KeyStroke ks = KeyStroke.getKeyStroke("shift F10");
tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks, key);
return p;
}
示例12: 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);
}
示例13: createContent
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
private void createContent ( Node biNode ) {
btv = new BeanTreeView ();
em = new ExplorerManager();
PropertySheetView psv = new PropertySheetView ();
try {
psv.setSortingMode (PropertySheetView.UNSORTED);
}
catch (java.beans.PropertyVetoException e) {
}
btv.setMinimumSize(new Dimension(300, 200));
JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, btv, psv);
em.setRootContext ( biNode );
em.setExploredContext( biNode );
btv.setDefaultActionAllowed( true );
setLayout (new BorderLayout());
add (BorderLayout.CENTER, sp);
initAccessibility();
}
示例14: getComponent
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
public JComponent getComponent() {
if (panel == null) {
final BeanTreeView view = new BeanTreeView();
view.setRootVisible(false);
view.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
class Panel extends JPanel implements ExplorerManager.Provider, Lookup.Provider {
// Make sure action context works correctly:
private final Lookup lookup = ExplorerUtils.createLookup(manager, new ActionMap());
{
setLayout(new BorderLayout());
add(view, BorderLayout.CENTER);
}
public ExplorerManager getExplorerManager() {
return manager;
}
public Lookup getLookup() {
return lookup;
}
}
panel = new Panel();
}
return panel;
}
示例15: getComponent
import org.openide.explorer.view.BeanTreeView; //导入依赖的package包/类
public JComponent getComponent() {
if (panel == null) {
final BeanTreeView view = new BeanTreeView();
view.setRootVisible(true);
view.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
class Panel extends JPanel implements ExplorerManager.Provider, Lookup.Provider {
// Make sure action context works correctly:
private final Lookup lookup = ExplorerUtils.createLookup(manager, new ActionMap());
{
setLayout(new BorderLayout());
add(view, BorderLayout.CENTER);
}
public ExplorerManager getExplorerManager() {
return manager;
}
public Lookup getLookup() {
return lookup;
}
}
panel = new Panel();
}
return panel;
}