@Override protected boolean createKeys (final @Nonnull List<Object> toPopulate) { toPopulate.addAll(composite.findChildren().results()); return true; }
/******************************************************************************************************************* * * ******************************************************************************************************************/ private int computeCount() { if (!countComputed) { log.debug(">>>> computing children count..."); count = delegateComposite.findChildren().count(); countComputed = true; } return count; }
@Nonnegative public int count (final @Nonnull Object object) { int r = 1; if (object instanceof Composite) { for (final Object child : ((Composite<?, ?>)object).findChildren().results()) { r += count(child); } } return r; } }
@Nonnegative public int count (final @Nonnull Object object) { int r = 1; for (final Object child : EnhancedLookups.lookup(object, Composite.class, Composite.DEFAULT).findChildren().results()) { r += count(child); } return r; } }
@Nonnegative public int count (final @Nonnull Object object) { int r = 1; for (final Object child : lookup(object, Composite).findChildren().results()) { r += count(child); } return r; } }
@Nonnegative public int count (final @Nonnull Object object) { int r = 1; final Composite<?, ?> composite = lookup(object, Composite.class); if (composite != null) { for (final Object child : composite.findChildren().results()) { r += count(child); } } return r; }
@Override @Nonnull public Finder<Type> findChildren() { return delegate.findChildren().sort(sortController.getSortCriterion(), sortController.getSortDirection()); } }
@Nonnull public static <T, R> R accept (final @Nonnull T object, final @Nonnull Visitor<T, R> visitor) throws NotFoundException { visitor.visit(object); for (final Object child : lookup(object, Composite).findChildren().results()) { accept((T)child, visitor); } return visitor.getValue(); } }
@Override @Nonnull protected List<? extends PresentationModel> computeNeededResults() { final List<PresentationModel> result = new ArrayList<PresentationModel>(); int i = 0; try { for (; i < count(); i++) { result.add(NotFoundException.throwWhenNull(presentationModelMapByIndex.get(firstResult + i), "")); } } catch (NotFoundException e) // some objects not in the cache { final List<?> objects = delegateComposite.findChildren().from(firstResult).max(maxResults).results(); for (; i < count(); i++) { result.add(getPresentationModel(firstResult + i, objects.get(i))); } } return result; } };
public void loadNodes() { final List<Object> keys = new ArrayList<Object>(); final Node[] nn = delegateChildren.getNodes(); if ((nn.length == 1) && isWaitingNode(nn[0])) { keys.add(nn[0]); } else if (nn.length > 0) { for (final Object o : composite.findChildren().results()) { try { keys.add(findRepresentantOf(o)); } catch (NotFoundException e) { keys.add(o); } } } setKeys(keys); }
for (final Object child : ((As)owner).as(Composite).findChildren().results())
/******************************************************************************************************************* * * ******************************************************************************************************************/ protected void populateView() { log.info("populate() - presentation model: {}", presentationModel); try { if (presentationModel.as(Composite).findChildren().count() > 0) { view.populate(presentationModel); } else { view.notifyNoData(notification().withText(_, "noData")); } } catch (AsException e) { view.notifyNoData(notification().withText(_, "noData")); } view.unlock(); }