use of com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconColumn in project midpoint by Evolveum.
the class AssignmentPanel method createAssignmentIconColumn.
private IColumn<PrismContainerValueWrapper<AssignmentType>, String> createAssignmentIconColumn() {
return new CompositedIconColumn<>(Model.of("")) {
@Override
protected CompositedIcon getCompositedIcon(IModel<PrismContainerValueWrapper<AssignmentType>> rowModel) {
AssignmentType assignment = rowModel.getObject().getRealValue();
LOGGER.trace("Create icon for AssignmentType: " + assignment);
PrismObject<? extends FocusType> object = loadTargetObject(assignment);
if (object != null) {
return WebComponentUtil.createCompositeIconForObject(object.asObjectable(), new OperationResult("create_assignment_composited_icon"), getPageBase());
}
String displayType = WebComponentUtil.createDefaultBlackIcon(AssignmentsUtil.getTargetType(assignment));
CompositedIconBuilder iconBuilder = new CompositedIconBuilder();
iconBuilder.setBasicIcon(displayType, IconCssStyle.IN_ROW_STYLE);
return iconBuilder.build();
}
};
}
use of com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconColumn in project midpoint by Evolveum.
the class AbstractAssignmentTypePanel method createAssignmentIconColumn.
private IColumn<PrismContainerValueWrapper<AssignmentType>, String> createAssignmentIconColumn() {
return new CompositedIconColumn<>(Model.of("")) {
@Override
protected CompositedIcon getCompositedIcon(IModel<PrismContainerValueWrapper<AssignmentType>> rowModel) {
AssignmentType assignment = rowModel.getObject().getRealValue();
LOGGER.trace("Create icon for AssignmentType: " + assignment);
PrismObject<? extends FocusType> object = loadTargetObject(assignment);
if (object != null) {
return WebComponentUtil.createCompositeIconForObject(object.asObjectable(), new OperationResult("create_assignment_composited_icon"), getPageBase());
}
String displayType = WebComponentUtil.createDefaultBlackIcon(AssignmentsUtil.getTargetType(assignment));
CompositedIconBuilder iconBuilder = new CompositedIconBuilder();
iconBuilder.setBasicIcon(displayType, IconCssStyle.IN_ROW_STYLE);
return iconBuilder.build();
}
};
}
use of com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconColumn in project midpoint by Evolveum.
the class FocusProjectionsTabPanel method initBasicColumns.
private List<IColumn<PrismContainerValueWrapper<ShadowType>, String>> initBasicColumns() {
IModel<PrismContainerDefinition<ShadowType>> shadowDef = Model.of(getShadowDefinition());
List<IColumn<PrismContainerValueWrapper<ShadowType>, String>> columns = new ArrayList<>();
columns.add(new CheckBoxHeaderColumn<>());
columns.add(new CompositedIconColumn<PrismContainerValueWrapper<ShadowType>>(Model.of("")) {
private static final long serialVersionUID = 1L;
@Override
protected CompositedIcon getCompositedIcon(IModel<PrismContainerValueWrapper<ShadowType>> rowModel) {
if (rowModel == null || rowModel.getObject() == null || rowModel.getObject().getRealValue() == null) {
return new CompositedIconBuilder().build();
}
ShadowType shadow = createShadowType(rowModel);
return WebComponentUtil.createAccountIcon(shadow, getPageBase(), true);
}
});
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_NAME, ColumnType.LINK, getPageBase()) {
private static final long serialVersionUID = 1L;
@Override
protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ShadowType>> rowModel) {
getMultivalueContainerListPanel().itemDetailsPerformed(target, rowModel);
target.add(getFeedbackPanel());
}
});
columns.add(new PrismReferenceWrapperColumn<>(shadowDef, ShadowType.F_RESOURCE_REF, ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_OBJECT_CLASS, ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_KIND, ColumnType.STRING, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-1";
}
});
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_INTENT, ColumnType.STRING, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-1";
}
});
columns.add(new PrismContainerWrapperColumn<ShadowType>(shadowDef, ShadowType.F_PENDING_OPERATION, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-2";
}
@Override
protected <IW extends ItemWrapper> Component createColumnPanel(String componentId, IModel<IW> rowModel) {
IW object = rowModel.getObject();
if (object == null) {
return new WebMarkupContainer(componentId);
}
List<PrismValueWrapper<PendingOperationType>> values = object.getValues();
List<PendingOperationType> pendingOperations = new ArrayList<>();
values.forEach(value -> pendingOperations.add(value.getRealValue()));
return new PendingOperationPanel(componentId, (IModel<List<PendingOperationType>>) () -> pendingOperations);
}
});
columns.add(new InlineMenuButtonColumn(createShadowMenu(), getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-1";
}
});
return columns;
}
Aggregations