use of com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor in project midpoint by Evolveum.
the class WorkItemsPanel method createTypeIconColumn.
public IColumn<WorkItemDto, String> createTypeIconColumn(final boolean object) {
// true = object, false = target
return new IconColumn<WorkItemDto>(createStringResource("")) {
@Override
protected IModel<String> createIconModel(IModel<WorkItemDto> rowModel) {
if (getObjectType(rowModel) == null) {
return null;
}
ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(rowModel);
String icon = guiDescriptor != null ? guiDescriptor.getBlackIcon() : ObjectTypeGuiDescriptor.ERROR_ICON;
return new Model<>(icon);
}
private ObjectTypeGuiDescriptor getObjectTypeDescriptor(IModel<WorkItemDto> rowModel) {
return ObjectTypeGuiDescriptor.getDescriptor(ObjectTypes.getObjectTypeFromTypeQName(getObjectType(rowModel)));
}
private QName getObjectType(IModel<WorkItemDto> rowModel) {
return object ? rowModel.getObject().getObjectType() : rowModel.getObject().getTargetType();
}
@Override
public void populateItem(Item<ICellPopulator<WorkItemDto>> item, String componentId, IModel<WorkItemDto> rowModel) {
super.populateItem(item, componentId, rowModel);
ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(rowModel);
if (guiDescriptor != null) {
item.add(AttributeModifier.replace("title", createStringResource(guiDescriptor.getLocalizationKey())));
item.add(new TooltipBehavior());
}
}
};
}
use of com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor in project midpoint by Evolveum.
the class ActionsExecutedObjectsTableLineDto method getObjectTypeLocalizationKey.
public String getObjectTypeLocalizationKey() {
ObjectTypes type = ObjectTypes.getObjectTypeFromTypeQName(entry.getObjectType());
ObjectTypeGuiDescriptor descriptor = ObjectTypeGuiDescriptor.getDescriptor(type);
if (descriptor != null) {
return descriptor.getLocalizationKey();
} else {
return null;
}
}
use of com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor in project midpoint by Evolveum.
the class QueryBasedHandlerDto method getObjectTypeKey.
public String getObjectTypeKey() {
QName objectType = taskDto.getExtensionPropertyRealValue(SchemaConstants.MODEL_EXTENSION_OBJECT_TYPE, QName.class);
ObjectTypeGuiDescriptor descriptor = ObjectTypeGuiDescriptor.getDescriptor(ObjectTypes.getObjectTypeFromTypeQName(objectType));
return descriptor != null ? descriptor.getLocalizationKey() : null;
}
use of com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor in project midpoint by Evolveum.
the class CertDecisionHelper method createTypeColumn.
public <T extends CertCaseOrWorkItemDto> IColumn<T, String> createTypeColumn(final WhichObject which, final PageBase page) {
IColumn column;
column = new IconColumn<CertCaseOrWorkItemDto>(page.createStringResource("")) {
@Override
protected DisplayType getIconDisplayType(IModel<CertCaseOrWorkItemDto> rowModel) {
ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(which, rowModel);
String icon = guiDescriptor != null ? guiDescriptor.getBlackIcon() : ObjectTypeGuiDescriptor.ERROR_ICON;
return GuiDisplayTypeUtil.createDisplayType(icon);
}
private ObjectTypeGuiDescriptor getObjectTypeDescriptor(WhichObject which, IModel<CertCaseOrWorkItemDto> rowModel) {
QName targetType = rowModel.getObject().getObjectType(which);
return ObjectTypeGuiDescriptor.getDescriptor(ObjectTypes.getObjectTypeFromTypeQName(targetType));
}
@Override
public void populateItem(Item<ICellPopulator<CertCaseOrWorkItemDto>> item, String componentId, IModel<CertCaseOrWorkItemDto> rowModel) {
super.populateItem(item, componentId, rowModel);
ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(which, rowModel);
if (guiDescriptor != null) {
item.add(AttributeModifier.replace("title", page.createStringResource(guiDescriptor.getLocalizationKey())));
item.add(new TooltipBehavior());
}
}
};
return column;
}
use of com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor in project midpoint by Evolveum.
the class ProcessInstancesPanel method createTypeIconColumn.
public IColumn<ProcessInstanceDto, String> createTypeIconColumn(final boolean object) {
// true = object, false = target
return new IconColumn<ProcessInstanceDto>(createStringResource("")) {
@Override
protected DisplayType getIconDisplayType(IModel<ProcessInstanceDto> rowModel) {
if (getObjectType(rowModel) == null) {
return GuiDisplayTypeUtil.createDisplayType("");
}
ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(rowModel);
String icon = guiDescriptor != null ? guiDescriptor.getBlackIcon() : ObjectTypeGuiDescriptor.ERROR_ICON;
return GuiDisplayTypeUtil.createDisplayType(icon);
}
private ObjectTypeGuiDescriptor getObjectTypeDescriptor(IModel<ProcessInstanceDto> rowModel) {
QName type = getObjectType(rowModel);
return ObjectTypeGuiDescriptor.getDescriptor(ObjectTypes.getObjectTypeFromTypeQName(type));
}
private QName getObjectType(IModel<ProcessInstanceDto> rowModel) {
return object ? rowModel.getObject().getObjectType() : rowModel.getObject().getTargetType();
}
@Override
public void populateItem(Item<ICellPopulator<ProcessInstanceDto>> item, String componentId, IModel<ProcessInstanceDto> rowModel) {
super.populateItem(item, componentId, rowModel);
ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(rowModel);
if (guiDescriptor != null) {
item.add(AttributeModifier.replace("title", createStringResource(guiDescriptor.getLocalizationKey())));
item.add(new TooltipBehavior());
}
}
};
}
Aggregations