/** * Uses the delegate item provider to return the delegate value's children, with appropriate wrappers to ensure that * this wrapper is considered their parent. Each child is replaced by the corresponding wrapper from {@link * #childrenMap}, after updating it by calling {@link #updateChildren updateChildren}. */ @Override public Collection<?> getChildren(Object object) { updateChildren(); Collection<Object> result = new ArrayList<Object>(delegateChildren.size()); for (Object delegateChild : delegateChildren) { result.add(childrenMap.get(delegateChild)); } return result; }
@Override public Collection<?> getAffectedObjects() { List<Object> result = new ArrayList<Object>(super.getAffectedObjects()); updateChildren(); for (ListIterator<Object> i = result.listIterator(); i.hasNext(); ) { Object object = i.next(); if (object == getDelegateValue()) { i.set(DelegatingWrapperItemProvider.this); } else if (childrenMap != null) { Object wrapper = childrenMap.get(object); if (wrapper != null) { i.set(wrapper); } } } return result; } }