/** * Gets the item Id collection from the container. * * @return the Collection of item ids. */ @Override public Collection<?> getItemIds() { return items.getItemIds(); }
@Override public Collection<?> getItemIds() { return container.getItemIds(); }
protected Collection<?> getAggregationItemIds() { return items.getItemIds(); }
@Override public void containerItemSetChange(ItemSetChangeEvent event) { // Delete all of the checkboxes, they will be regenerated during Table.containerItemSetChange() m_checkboxes.clear(); // Remove any selected item IDs that are no longer present in the container Iterator<Integer> itr = m_selectedCheckboxes.iterator(); while(itr.hasNext()) { if (!event.getContainer().getItemIds().contains(itr.next())) { itr.remove(); } } // Remove any not selected item IDs that are no longer present in the container itr = m_notSelectedCheckboxes.iterator(); while(itr.hasNext()) { if (!event.getContainer().getItemIds().contains(itr.next())) { itr.remove(); } } } }
@Override protected Collection<?> getAggregationItemIds() { if (hasGroups()) { return rootGroups().stream() .flatMap(groupId -> getGroupItemIds(groupId).stream()) .collect(Collectors.toList()); } else { return items.getItemIds(); } }
/** * Constructs a new hierarchical wrapper for an existing Container. Works * even if the to-be-wrapped container already implements the * <code>Container.Hierarchical</code> interface. * * @param toBeWrapped * the container that needs to be accessed hierarchically * @see #updateHierarchicalWrapper() */ public ContainerHierarchicalWrapper(Container toBeWrapped) { container = toBeWrapped; hierarchical = container instanceof Container.Hierarchical; // Check arguments if (container == null) { throw new NullPointerException("Null can not be wrapped"); } // Create initial order if needed if (!hierarchical) { noChildrenAllowed = new HashSet<Object>(); parent = new Hashtable<Object, Object>(); children = new Hashtable<Object, LinkedList<Object>>(); roots = new LinkedHashSet<Object>(container.getItemIds()); } updateHierarchicalWrapper(); }
parent = new Hashtable<Object, Object>(); children = new Hashtable<Object, LinkedList<Object>>(); roots = new LinkedHashSet<Object>(container.getItemIds()); } else { Collection<?> itemIds = container.getItemIds(); Comparator<Object> basedOnOrderFromWrappedContainer = new ListedItemsFirstComparator( itemIds); final Collection<?> ids = container.getItemIds(); for (final Object id : ids) { if (!s.contains(id)) {
final Collection<?> ids = container.getItemIds();
protected void updateFooterAggregation() { if (!isFooterVisible()) { setFooterVisible(true); } Map<Object, Object> aggregations = ((AggregationContainer) items).aggregate(new Context(items.getItemIds())); for (final Object columnId : _visibleColumns()) { if (columnId == null || isColumnCollapsed(columnId) || !aggregations.containsKey(columnId)) { continue; } String value = (String) aggregations.get(columnId); setColumnFooter(columnId, value); } }
@Override protected void paintAdditionalData(PaintTarget target) throws PaintException { if (reqFirstRowToPaint == -1 && items instanceof AggregationContainer && isAggregatable() && !((AggregationContainer) items).getAggregationPropertyIds().isEmpty() && isShowTotalAggregation() && AggregationStyle.TOP.equals(getAggregationStyle())) { paintAggregationRow(target, ((AggregationContainer) items).aggregate(new Context(items.getItemIds()))); } // paint cuba-ids if (getCubaId() != null) { ArrayList<String> visibleColOrder = new ArrayList<>(); for (Object columnId : _visibleColumns()) { if (!isColumnCollapsed(columnId)) { visibleColOrder.add(columnId.toString()); } } target.addAttribute("colcubaids", visibleColOrder.toArray()); } }
@Test public void createsNodeTypeSelectFieldWithAllAvailablePrimaryNodeTypes() throws Exception { // WHEN final ComboBox field = (ComboBox) nodeTypeSelectFieldFactory.createField(); // THEN assertThat(field.getContainerDataSource().getItemIds(), Matchers.<Object>contains("bar", "foo")); }
return new ArrayList<Object>(container.getItemIds());