use of org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn in project midpoint by Evolveum.
the class PageAccounts method createAccountsColumns.
private List<IColumn> createAccountsColumns() {
List<IColumn> columns = new ArrayList<>();
columns.add(new PropertyColumn(createStringResource("PageAccounts.accounts.oid"), SelectableBean.F_VALUE + ".oid"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.name"), ShadowType.F_NAME.getLocalPart(), SelectableBean.F_VALUE + ".name"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.kind"), ShadowType.F_KIND.getLocalPart(), SelectableBean.F_VALUE + ".kind"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.intent"), ShadowType.F_INTENT.getLocalPart(), SelectableBean.F_VALUE + ".intent"));
columns.add(new PropertyColumn<QName, String>(createStringResource("PageAccounts.accounts.objectClass"), ShadowType.F_OBJECT_CLASS.getLocalPart(), SelectableBean.F_VALUE + ".objectClass.localPart"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.synchronizationSituation"), ShadowType.F_SYNCHRONIZATION_SITUATION.getLocalPart(), SelectableBean.F_VALUE + ".synchronizationSituation"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.synchronizationTimestamp"), ShadowType.F_SYNCHRONIZATION_TIMESTAMP.getLocalPart(), SelectableBean.F_VALUE + ".synchronizationTimestamp"));
// columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.result"),
// ShadowType.F_RESULT.getLocalPart(), SelectableBean.F_VALUE + ".result.status"));
columns.add(new LinkColumn<SelectableBean>(createStringResource("PageAccounts.accounts.result")) {
@Override
protected IModel<String> createLinkModel(final IModel<SelectableBean> rowModel) {
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
OperationResultType result = getResult(rowModel);
if (result == null) {
return "";
}
return createStringResource("OperationResultStatusType." + result.getStatus()).getObject();
}
};
}
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
showShadowResult(target, rowModel);
}
});
columns.add(new LinkColumn<SelectableBean>(createStringResource("PageAccounts.accounts.owner")) {
@Override
protected IModel<String> createLinkModel(final IModel<SelectableBean> rowModel) {
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
FocusType focus = loadShadowOwner(rowModel);
return WebComponentUtil.getName(focus);
}
};
}
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
ownerDetailsPerformed(target, rowModel);
}
});
return columns;
}
Aggregations