use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIcon 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;
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIcon in project midpoint by Evolveum.
the class AjaxCompositedIconSubmitButton method onComponentTagBody.
@Override
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) {
StringBuilder sb = new StringBuilder();
CompositedIcon icon = this.icon;
if (icon.hasBasicIcon()) {
sb.append("<i class=\"").append(icon.getBasicIcon() != null ? icon.getBasicIcon().trim() : "").append("\"");
if (icon.hasBasicIconHtmlColor()) {
sb.append(" style=\"color: " + icon.getBasicIconHtmlColor() + ";\"");
}
sb.append("></i> ");
if (titleAsLabel) {
sb.append("<span class=\"operationalButtonLabel\">").append(title.getObject()).append("</span>");
}
}
if (icon.hasLayerIcons()) {
for (LayerIcon entry : icon.getLayerIcons()) {
if (entry == null) {
continue;
}
if (StringUtils.isNotEmpty(entry.getIconType().getCssClass())) {
sb.append("<i class=\"").append(entry.getIconType().getCssClass()).append("\"");
if (StringUtils.isNotEmpty(entry.getIconType().getColor())) {
sb.append(" style=\"color: ").append(entry.getIconType().getColor()).append(";\"");
}
sb.append(">").append(entry.hasLabel() ? entry.getLabelModel().getObject() : "").append("</i> ");
}
}
}
replaceComponentTagBody(markupStream, openTag, sb.toString());
}
Aggregations