/** 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() { return entrySupport().isInitialized(); }
/** Creates an immutable snapshot representing the current view of the nodes * in this children object. This is No attempt is made to extract incorrect or invalid * nodes from the list, as a result, the value may not be exactly the same * as returned by {@link #getNodes()}. * * @return immutable and unmodifiable list of nodes in this children object * @since 7.7 */ public final List<Node> snapshot() { return entrySupport().snapshot(); }
@Override EntrySupport entrySupport() { return getOriginal().entrySupport(); }
/** Get the number of nodes in the list * @param optimalResult whether to try to perform full initialization * or to simply delegate to {@link #getNodesCount()} * @return the count * @since org.openide.nodes 7.6 */ public int getNodesCount(boolean optimalResult) { checkSupport(); return entrySupport().getNodesCount(optimalResult); }
/** Getter for a child at a given position. If child with such index * does not exists it returns null. * * @param index the index of a node we want to know (non negative) * @return the node at given index or null * @since org.openide.nodes 7.5 */ public final Node getNodeAt(int index) { checkSupport(); return entrySupport().getNodeAt(index); }
/** Get the number of nodes in the list. * @return the count */ public final int getNodesCount() { checkSupport(); return entrySupport().getNodesCount(false); }
/** @return either nodes associated with this children or null if * they are not created */ private Node[] testNodes() { return getEntrySupport() == null ? null : entrySupport().testNodes(); }
/** Get a (sorted) array of nodes in this list. * If the children object is not yet initialized, * it will be (using {@link #addNotify}) before * the nodes are returned. * <p><strong>Warning:</strong> not all children * implementations do a complete calculation at * this point, see {@link #getNodes(boolean)} * @return array of nodes */ // private static String off = ""; // NOI18N public final Node[] getNodes() { checkSupport(); return entrySupport().getNodes(false); }
return entrySupport().getNodes(optimalResult);
private boolean checkSupportChanged() { FilterChildrenSupport support = (FilterChildrenSupport) entrySupport(); EntrySupport origSupport = original.getChildren().entrySupport(); if (support.originalSupport() != origSupport) { assert Children.MUTEX.isWriteAccess() : "Should be called only under write access"; // NOI18N changeSupport(null); return true; } else { return false; } }
EntrySupport origSupport = original.getChildren().entrySupport(); synchronized (org.openide.nodes.Children.class) { if (getEntrySupport() == support && support.originalSupport() != origSupport) { EntrySupport os = origChildren.entrySupport(); boolean osIsLazy = origChildren.isLazy();