return createTable(context, collectionField != null, collection, summary, type);
}
public static Table createTable(final Context context, final boolean addSelector, final ObjectAdapter collection, final String summary, final ObjectSpecification elementType) {
final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
final List<ObjectAssociation> columnAssociations = elementType.getAssociations(Filters.and(WHEN_VISIBLE_IRRESPECTIVE_OF_WHERE, PROPERTIES));
final int len = columnAssociations.size();
final ComponentFactory factory = context.getComponentFactory();
final Table table = factory.createTable(len, addSelector);
table.setSummary(summary);
for (final ObjectAssociation columnAssociation : columnAssociations) {
table.addColumnHeader(columnAssociation.getName());
}
for (final ObjectAdapter rowAdapter : facet.iterable(collection)) {
getPersistenceSession().resolveImmediately(rowAdapter);
final String elementId = context.mapObject(rowAdapter);
table.addRowHeader(factory.createObjectIcon(rowAdapter, elementId, "icon"));
for (final ObjectAssociation columnAssociation : columnAssociations) {