use of com.evolveum.midpoint.xml.ns._public.common.common_3.AdministrativeAvailabilityStatusType in project midpoint by Evolveum.
the class ResourceSummaryPanel method getSummaryTagComponentList.
@Override
protected List<SummaryTag<ResourceType>> getSummaryTagComponentList() {
AvailabilityStatusType availability = ResourceTypeUtil.getLastAvailabilityStatus(getModelObject());
AdministrativeAvailabilityStatusType administrativeAvailability = ResourceTypeUtil.getAdministrativeAvailabilityStatus(getModelObject());
List<SummaryTag<ResourceType>> summaryTagList = new ArrayList<>();
SummaryTag<ResourceType> summaryTag = new SummaryTag<ResourceType>(ID_SUMMARY_TAG, getModel()) {
private static final long serialVersionUID = 1L;
@Override
protected void initialize(ResourceType object) {
if (AdministrativeAvailabilityStatusType.MAINTENANCE == administrativeAvailability) {
setIconCssClass(GuiStyleConstants.CLASS_ICON_RESOURCE_MAINTENANCE);
setLabel(ResourceSummaryPanel.this.getString(administrativeAvailability));
return;
}
if (availability == null) {
setIconCssClass(GuiStyleConstants.CLASS_ICON_RESOURCE_UNKNOWN);
setLabel(getString("ResourceSummaryPanel.UNKNOWN"));
return;
} else {
setLabel(ResourceSummaryPanel.this.getString(availability));
switch(availability) {
case UP:
setIconCssClass(GuiStyleConstants.CLASS_ICON_ACTIVATION_ACTIVE);
break;
case DOWN:
setIconCssClass(GuiStyleConstants.CLASS_ICON_ACTIVATION_INACTIVE);
break;
case BROKEN:
setIconCssClass(GuiStyleConstants.CLASS_ICON_RESOURCE_BROKEN);
break;
}
}
}
};
summaryTagList.add(summaryTag);
return summaryTagList;
}
Aggregations