private void updateInventoryTabContent(final ResourceComposite resourceComposite, final Resource resource,
Set<ResourceTypeFacet> facets) {
ResourceType type = this.resourceComposite.getResource().getResourceType();
boolean visible = !type.getChildResourceTypes().isEmpty();
ViewFactory viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
return viewWithoutHeader(ResourceCompositeSearchView.getChildrenOf(resourceComposite));
}
};
updateSubTab(this.inventoryTab, this.inventoryChildren, visible, true, viewFactory);
visible = !type.getChildResourceTypes().isEmpty();
viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
return viewWithoutHeader(new ChildHistoryView(resourceComposite));
}
};
updateSubTab(this.inventoryTab, this.inventoryChildHistory, visible, true, viewFactory);
visible = facets.contains(ResourceTypeFacet.PLUGIN_CONFIGURATION);
viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
return new PluginConfigurationEditView(resourceComposite);
}
};
updateSubTab(this.inventoryTab, this.inventoryConn, visible, true, viewFactory);
// same test, use above setting for 'visible'
viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
return viewWithoutHeader( new PluginConfigurationHistoryListView(resourceComposite.getResourcePermission().isInventory(),
resourceComposite.getResource().getId()));
}
};
updateSubTab(this.inventoryTab, this.inventoryConnHistory, visible, true, viewFactory);
final boolean canModifyMembership = globalPermissions.contains(Permission.MANAGE_INVENTORY);
updateSubTab(this.inventoryTab, this.inventoryGroups, true, true, new ViewFactory() {
@Override
public Canvas createView() {
return viewWithoutHeader(ResourceGroupListView.getGroupsOf(resource.getId(), canModifyMembership));
}
});
boolean enabled = globalPermissions.contains(Permission.MANAGE_SETTINGS);
viewFactory = (!enabled) ? null : new ViewFactory() {
@Override
public Canvas createView() {
return new ResourceAgentView(resourceId);
}
};