/** * @deprecated Do not use! Just call {@link #setKeys(Collection)} with a larger set. */ @Deprecated @Override public boolean add(Node[] arr) { if (lazySupport) { fallbackToDefaultSupport(); } return super.add(arr); }
@Override void postInitializeEntrySupport(EntrySupport es) { if (!lazySupport) { if (getNodesEntry() == null) { nodesEntry = createNodesEntry(); } es.setEntries(Collections.singleton(getNodesEntry()), true); } else if (getNodesEntry() != null) { nodesEntry = null; } }
/** List of elements. */ public Collection nodes () { Collection c = getCollection (); if (c.isEmpty ()) { return Collections.EMPTY_LIST; } else { return new ArrayList (c); } } }
new JavaChildren(sourceGroupNodes[0])); } else { Children children = new Children.Array(); children.add(sourceGroupNodes);
Children.Array array = new Children.Array(); array.add(new Node[]{openProjectsNode, repoNode}); explorerManager.setRootContext(new AbstractNode(array)); final BeanTreeView beanTreeView = (BeanTreeView) jScrollPane1;
(trackingSettings, editors, "TrackingWorker"); Children children = new Children.Array(); children.add(new Node[] { cameraNode, projectorNode, objectFinderNode, markerDetectorNode, alignerNode, handMouseNode, virtualBallNode,
Children fileChildren = new Children.Array(); fileChildren.add(rootNodes); Node byFilesNode = new FolderNode(fileChildren); Children categories = new Children.Array();
Children.Array children = new Children.Array(); children.add(nodes.toArray(new Node[nodes.size()])); AbstractNode root = new AbstractNode(children); manager.setRootContext(root);
Children fileChildren = new Children.Array(); fileChildren.add(rootNodes); Node byFilesNode = new FolderNode(fileChildren); Children categories = new Children.Array();
targetNS, Children.LEAF, decorator); childNode.setDisplayName(entry.getSource()); Children.Array children = new Children.Array(); children.add(new Node[] { childNode }); return new Node[] { new RetrievedFileNode(entry, targetNS, children, decorator)
List<Node> allNodes = new ArrayList<Node>(); for (int i = 0; i < projects.length; i++) { AbstractNode node = new AbstractNode(new Children.Array(), projects[i].getLookup()); allNodes.add(node);
private Node getTemplatesRootNode() { try { FileObject shellFolder = FileUtil.getConfigFile("org-netbeans-modules-swingapp/appshells"); // NOI18N DataObject dobj = DataObject.find(shellFolder); return new FilterNode(dobj.getNodeDelegate(), new FilterNode.Children(dobj.getNodeDelegate()) { @Override protected Node[] createNodes(Node key) { try { String className = (String)fileFromNode(key).getAttribute("requiredClass"); // NOI18N if (className != null) { ClassLoader classLoader = Lookup.getDefault().lookup(ClassLoader.class); classLoader.loadClass(className); } return new Node[] { copyNode(key) }; } catch (ClassNotFoundException ex) { Logger.getLogger(getClass().getName()).log(Level.INFO, ex.getLocalizedMessage(), ex); } return new Node[0]; } }); } catch (Exception ex) { // should not happen, but... ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); return new AbstractNode(new Children.Array()); } }
private Node createRootNode(List<NBVersionInfo> infos) { Node node = null; Map<String, List<NBVersionInfo>> map = new HashMap<String, List<NBVersionInfo>>(); for (NBVersionInfo nbvi : infos) { String key = nbvi.getGroupId() + " : " + nbvi.getArtifactId(); List<NBVersionInfo> get = map.get(key); if (get == null) { get = new ArrayList<NBVersionInfo>(); map.put(key, get); } get.add(nbvi); } Set<String> keySet = map.keySet(); if (keySet.size() > 0) { Children.Array array = new Children.Array(); List<String> keyList = new ArrayList<String>(keySet); Collections.sort(keyList); node = new AbstractNode(array); for (String key : keyList) { array.add(new Node[]{new ArtifactNode(key, map.get(key))}); } } else { Node empty = createEmptyNode(); Children.Array array = new Children.Array(); array.add(new Node[]{empty}); node = new AbstractNode(array); } return node; }
protected Node[] createNodes(Object key) { if (key == WaitNode.WAIT_KEY) { return WaitNode.createNode(); } else if (key instanceof String) { List<FileObject> fobjs = nsFilesMap.get(key); if (fobjs != null && !fobjs.isEmpty()) { Node[] filterNodes = new Node[fobjs.size()]; int i = 0; for (FileObject fobj:fobjs) { try { Node node = DataObject.find(fobj).getNodeDelegate(); filterNodes[i++] = decorator.createExternalReferenceNode(node); } catch (DataObjectNotFoundException donfe) { } } Children.Array children = new Children.Array(); children.add(filterNodes); Node node = new NamespaceNode(children, (String) key, decorator); return new Node[] { node }; } } return new Node[] { }; }
/** * Initializes the children of this node. */ private void initChildren() { Children.Array children = (Children.Array)getChildren(); List<String> properties = new ArrayList<String>(); List<MatchedRuleNode> nodes = new ArrayList<MatchedRuleNode>(); for (Rule rule : matchedStyles.getMatchedRules()) { if (Utilities.showInCSSStyles(rule)) { nodes.add(createMatchedRuleNode(node, rule, properties, true)); } } Node currentNode = node; for (InheritedStyleEntry entry : matchedStyles.getInheritedRules()) { currentNode = currentNode.getParentNode(); if (currentNode == null) { break; // Issue 235611 } for (Rule rule : entry.getMatchedRules()) { if (Utilities.showInCSSStyles(rule) && containsInheritedProperties(rule)) { nodes.add(createMatchedRuleNode(currentNode, rule, properties, false)); } } } children.add(nodes.toArray(new MatchedRuleNode[nodes.size()])); }
/** * Initializes the children of this node. */ private void initChildren() { Set<String> properties = new HashSet<String>(); Children.Array children = (Children.Array)getChildren(); List<MatchedPropertyNode> nodes = new ArrayList<MatchedPropertyNode>(); for (Rule rule : matchedStyles.getMatchedRules()) { if (Utilities.showInCSSStyles(rule)) { addChildrenFor(rule, nodes, properties, true); } } for (InheritedStyleEntry entry : matchedStyles.getInheritedRules()) { for (Rule rule : entry.getMatchedRules()) { if (Utilities.showInCSSStyles(rule)) { addChildrenFor(rule, nodes, properties, false); } } } children.add(nodes.toArray(new MatchedPropertyNode[nodes.size()])); }
protected NamedBeanNode(final SectionNodeView sectionNodeView, final DDBinding binding, final String beanNameProperty, final String beanTitle, final String iconBase, final ASDDVersion version) { super(sectionNodeView, new Children.Array(), binding.getSunBean(), version, beanTitle, iconBase); this.binding = binding; this.beanNameProperty = beanNameProperty; binding.getSunBean().addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { String oldDisplayName = getDisplayName(); String newDisplayName = generateTitle(); if (!oldDisplayName.equals(newDisplayName)) { setDisplayName(newDisplayName); setName(newDisplayName); firePropertyChange(Node.PROP_DISPLAY_NAME, oldDisplayName, newDisplayName); } } }); setName(beanTitle); helpProvider = true; }
ReferencesNode(SectionNodeView sectionNodeView, Ejb ejb, final ASDDVersion version) { super(sectionNodeView, new Children.Array(), ejb, version, NbBundle.getMessage(ReferencesNode.class, "LBL_ReferencesHeader"), ICON_BASE_REFERENCES_NODE); this.helpProvider = true; // References addChild(new EjbRefGroupNode(sectionNodeView, ejb, version)); addChild(new ResourceRefGroupNode(sectionNodeView, ejb, version)); addChild(new ResourceEnvRefGroupNode(sectionNodeView, ejb, version)); if(ASDDVersion.SUN_APPSERVER_8_0.compareTo(version) <= 0) { SunDescriptorDataObject dataObject = (SunDescriptorDataObject) sectionNodeView.getDataObject(); J2EEBaseVersion j2eeVersion = dataObject.getJ2eeModuleVersion(); if(j2eeVersion == null || j2eeVersion.compareSpecification(J2EEVersion.J2EE_1_4) >= 0) { addChild(new ServiceRefGroupNode(sectionNodeView, ejb, version)); if(ASDDVersion.SUN_APPSERVER_9_0.compareTo(version) <= 0) { if(j2eeVersion == null || j2eeVersion.compareSpecification(J2EEVersion.JAVAEE_5_0) >= 0) { addChild(new MessageDestinationRefGroupNode(sectionNodeView, ejb, version)); } } } } }
/** This method can be called by subclasses that * directly modify the nodes collection to update the * state of the nodes appropriatelly. * This method should be called under * MUTEX.writeAccess. */ final void refreshImpl () { if ( isInitialized() ) { Array.this.refreshEntry (getNodesEntry ()); super.getArray (null).nodes (); } else if ( nodes != null ) { for( Iterator it = nodes.iterator(); it.hasNext(); ) { Node n = (Node)it.next(); n.assignTo( this, -1 ); } } }
/** This method can be called by subclasses that * directly modify the nodes collection to update the * state of the nodes appropriatelly. * This method should be called under * MUTEX.writeAccess. */ final void refreshImpl () { if ( isInitialized() ) { Array.this.refreshEntry (getNodesEntry ()); super.getArray (null).nodes (); } else if ( nodes != null ) { for( Iterator it = nodes.iterator(); it.hasNext(); ) { Node n = (Node)it.next(); n.assignTo( this, -1 ); } } }