use of org.gwtbootstrap3.client.ui.LinkedGroup in project kie-wb-common by kiegroup.
the class BusinessViewWidget method renderItems.
@Override
public void renderItems(FolderListing folderListing) {
tagSelector.loadContent(presenter.getActiveContentTags(), presenter.getCurrentTag());
itemsContainer.clear();
sortedFolderItems.clear();
for (final FolderItem content : folderListing.getContent()) {
if (!content.getType().equals(FolderItemType.FOLDER)) {
sortedFolderItems.add(content);
}
}
if (!sortedFolderItems.isEmpty()) {
final Map<ClientResourceType, Collection<FolderItem>> resourceTypeGroups = classifier.group(sortedFolderItems);
final TreeMap<ClientResourceType, Collection<FolderItem>> sortedResourceTypeGroups = new TreeMap<>(Sorters.RESOURCE_TYPE_GROUP_SORTER);
sortedResourceTypeGroups.putAll(resourceTypeGroups);
for (final Map.Entry<ClientResourceType, Collection<FolderItem>> entry : sortedResourceTypeGroups.entrySet()) {
final LinkedGroup itemsNavList = new LinkedGroup();
itemsNavList.getElement().getStyle().setMarginBottom(0, Style.Unit.PX);
final PanelCollapse collapse = new PanelCollapse();
final String collapseId = getCollapseId(entry.getKey());
final PanelCollapse oldCollapse = collapses.get(collapseId);
final boolean in = (oldCollapse != null) ? oldCollapse.isIn() : false;
collapse.setId(collapseId);
collapse.setIn(in);
final PanelBody body = new PanelBody();
body.getElement().getStyle().setPadding(0, Style.Unit.PX);
collapse.add(body);
body.add(itemsNavList);
for (FolderItem folderItem : entry.getValue()) {
itemsNavList.add(makeItemNavLink(entry.getKey(), folderItem));
}
itemsContainer.add(new Panel() {
{
add(makeTriggerWidget(entry.getKey(), collapse));
add(collapse);
}
});
collapses.put(collapseId, collapse);
}
} else {
itemsContainer.add(new Label(ProjectExplorerConstants.INSTANCE.noItemsExist()));
}
}
Aggregations