use of org.broadleafcommerce.openadmin.dto.TabMetadata in project BroadleafCommerce by BroadleafCommerce.
the class BasicEntityMetadataProvider method buildTabMetadata.
protected TabMetadata buildTabMetadata(AdminTabPresentation tabPresentation, Class<?> owningClass, Map<String, TabMetadata> metadata) {
TabMetadata constructedTab = getTabFromMetadata(tabPresentation.name(), metadata);
TabMetadata tab;
Map<String, GroupMetadata> groupMetadataMap;
if (constructedTab != null) {
tab = constructedTab;
groupMetadataMap = tab.getGroupMetadata();
} else {
tab = new TabMetadata();
groupMetadataMap = new HashMap<>();
tab.setTabName(tabPresentation.name());
tab.setTabOrder(tabPresentation.order());
tab.setOwningClass(owningClass.getCanonicalName());
}
for (AdminGroupPresentation groupPresentation : tabPresentation.groups()) {
if (getGroupFromMetadata(groupPresentation.name(), metadata) == null) {
groupMetadataMap.put(groupPresentation.name(), buildGroupMetadata(groupPresentation, owningClass, metadata));
}
}
tab.setGroupMetadata(groupMetadataMap);
return tab;
}
Aggregations