arr = array.get(); if (arr == null) { arr = new ChildrenArray();
/** Clears the nodes */ private void clearNodes() { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer(" clearNodes()"); // NOI18N } ChildrenArray arr = array.get(); if (arr != null) { // clear the array arr.clear(); } }
/** Finds the children we are attached to. * @return children */ private Children getParentChildren() { Object p = this.parent; return (p instanceof ChildrenArray) ? ((ChildrenArray)p).getChildren() : (Children)p; }
/** * @return either nodes associated with this children or null if they are not created */ public Node[] testNodes() { ChildrenArray arr = array.get(); if (arr == null) { return null; } try { Children.PR.enterReadAccess(); return arr.nodes(); } finally { Children.PR.exitReadAccess(); } }
public void useNodes(Collection<Node> nodes) { // forces creation of the array ChildrenArray arr = getArray(null); arr.useNodes(this, nodes); // assign all there nodes the new children for (Node n : nodes) { n.assignTo(EntrySupportDefault.this.children, -1); n.fireParentNodeChange(null, children.parent); } }
public Collection<Node> nodes(boolean hasToExist) { // forces creation of the array assert !hasToExist || array.get() != null : "ChildrenArray is not initialized"; ChildrenArray arr = getArray(null); return arr.nodesFor(this, hasToExist); }
public boolean isInitialized() { ChildrenArray arr = array.get(); return inited && arr != null && arr.isInitialized(); }
/** Refreshes the nodes for given info. * @param info the info * @return the nodes */ public void useNodes (Children.Info info, Collection list) { info.length = list.size (); getMap().put (info, list); }
/** Forces finalization of nodes for given info. * Called from finalizer of Info. */ final void finalizeNodes () { ChildrenArray arr = (ChildrenArray)array.get (); if (arr != null) { arr.finalizeNodes (); } }
public void useNodes (Collection nodes) { // forces creation of the array ChildrenArray arr = getArray (null); arr.useNodes (this, nodes); // assign all there nodes the new children Iterator it = nodes.iterator (); while (it.hasNext ()) { Node n = (Node)it.next (); n.assignTo (Children.this, -1); n.fireParentNodeChange (null, parent); } }
public Collection nodes () { // forces creation of the array ChildrenArray arr = getArray (null); return arr.nodesFor (this); }
/** Method that can be used to test whether the children content has * ever been used or it is still not initalized. * @return true if children has been used before * @see #addNotify */ protected final boolean isInitialized () { ChildrenArray arr = (ChildrenArray)array.get (); return arr != null && arr.isInitialized (); }
/** Refreshes the nodes for given info. * @param info the info * @return the nodes */ public void useNodes (Children.Info info, Collection list) { info.length = list.size (); getMap().put (info, list); }
/** Forces finalization of nodes for given info. * Called from finalizer of Info. */ final void finalizeNodes () { ChildrenArray arr = (ChildrenArray)array.get (); if (arr != null) { arr.finalizeNodes (); } }
@Override public String toString() { return super.toString() + " " + getChildren(); //NOI18N } }
public void useNodes (Collection nodes) { // forces creation of the array ChildrenArray arr = getArray (null); arr.useNodes (this, nodes); // assign all there nodes the new children Iterator it = nodes.iterator (); while (it.hasNext ()) { Node n = (Node)it.next (); n.assignTo (Children.this, -1); n.fireParentNodeChange (null, parent); } }
/** Clears the nodes */ private void clearNodes () { ChildrenArray arr = (ChildrenArray)array.get (); //System.err.println(off + " clearNodes: " + getNode ()); if (arr != null) { // clear the array arr.clear (); } }
public Collection nodes () { // forces creation of the array ChildrenArray arr = getArray (null); return arr.nodesFor (this); }