/** @param added added or removed * @param indices list of integers with indexes that changed */ protected void fireSubNodesChangeIdx(boolean added, int[] idxs, Entry sourceEntry, List<Node> current, List<Node> previous) { if (children.parent != null && children.getEntrySupport() == this) { children.parent.fireSubNodesChangeIdx(added, idxs, sourceEntry, current, previous); } }
/** * Initializes entry support. */ EntrySupport entrySupport() { synchronized (Children.class) { if (getEntrySupport() == null) { LOG.finer("Initializing entrySupport"); EntrySupport es = lazySupport ? new EntrySupportLazy(this) : new EntrySupportDefault(this); setEntrySupport(es); postInitializeEntrySupport(es); } return getEntrySupport(); } }
/** @return either nodes associated with this children or null if * they are not created */ private Node[] testNodes() { return getEntrySupport() == null ? null : entrySupport().testNodes(); }
/** Notifies that a set of nodes has been add to * children. It is necessary that the system is already * in consistent state, so any callbacks will return * valid values. * * @param nodes list of removed nodes */ void notifyAdd(Collection<Node> nodes) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("notifyAdd: " + nodes); } // notify about parent change for (Node n : nodes) { n.assignTo(children, -1); n.fireParentNodeChange(null, children.parent); } Node[] arr = nodes.toArray(new Node[nodes.size()]); Node n = children.parent; if (n != null && children.getEntrySupport() == this) { n.fireSubNodesChange(true, arr, null); } }
/** Finalized. */ final void finalizedChildrenArray(Reference caller) { assert caller.get() == null : "Should be null"; // usually in removeNotify setKeys is called => better require write access try { Children.PR.enterWriteAccess(); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.fine("previous array: " + array + " caller: " + caller); // NOI18N } synchronized (LOCK) { if (array == caller && children.getEntrySupport() == this) { // really finalized and not reconstructed mustNotifySetEnties = false; array = EMPTY; inited = false; children.callRemoveNotify(); assert array == EMPTY; } } } finally { Children.PR.exitWriteAccess(); } }
if (children.parent != null) { if (children.getEntrySupport() == this) { children.parent.fireSubNodesChange(false, arr, current);
try { Children.PR.enterReadAccess(); if (this != children.getEntrySupport()) {
if (zero) { setState(state, state.changeInited(false).changeThread(null).changeProgress(false)); if (children.getEntrySupport() == this) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("callRemoveNotify() " + this); // NOI18N