use of org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn in project syncope by apache.
the class SchemaTypePanel method getColumns.
@Override
protected List<IColumn<SchemaTO, String>> getColumns() {
final List<IColumn<SchemaTO, String>> columns = new ArrayList<>();
for (final String field : COL_NAMES.get(schemaType)) {
final Field clazzField = ReflectionUtils.findField(schemaType.getToClass(), field);
if (clazzField != null) {
if (clazzField.getType().equals(Boolean.class) || clazzField.getType().equals(boolean.class)) {
columns.add(new BooleanPropertyColumn<>(new ResourceModel(field), field, field));
} else {
final IColumn<SchemaTO, String> column = new PropertyColumn<SchemaTO, String>(new ResourceModel(field), field, field) {
private static final long serialVersionUID = 3282547854226892169L;
@Override
public String getCssClass() {
String css = super.getCssClass();
if ("key".equals(field)) {
css = StringUtils.isBlank(css) ? "col-xs-1" : css + " col-xs-1";
}
return css;
}
};
columns.add(column);
}
}
}
return columns;
}
use of org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn in project syncope by apache.
the class ProvisioningTaskDirectoryPanel method getFieldColumns.
@Override
protected List<IColumn<T, String>> getFieldColumns() {
List<IColumn<T, String>> columns = new ArrayList<>();
columns.add(new KeyPropertyColumn<>(new StringResourceModel("key", this), "key"));
columns.add(new PropertyColumn<>(new StringResourceModel("name", this), "name", "name"));
columns.add(new PropertyColumn<>(new StringResourceModel("description", this), "description", "description"));
if (reference == PullTaskTO.class) {
columns.add(new PropertyColumn<>(new StringResourceModel("destinationRealm", this), "destinationRealm", "destinationRealm"));
} else if (reference == PushTaskTO.class) {
columns.add(new PropertyColumn<>(new StringResourceModel("sourceRealm", this), "sourceRealm", "sourceRealm"));
}
columns.add(new DatePropertyColumn<>(new StringResourceModel("lastExec", this), "lastExec", "lastExec"));
columns.add(new DatePropertyColumn<>(new StringResourceModel("nextExec", this), "nextExec", "nextExec"));
columns.add(new PropertyColumn<>(new StringResourceModel("latestExecStatus", this), "latestExecStatus", "latestExecStatus"));
columns.add(new BooleanPropertyColumn<>(new StringResourceModel("active", this), "active", "active"));
columns.add(new AbstractColumn<T, String>(new Model<>(""), "running") {
private static final long serialVersionUID = -4008579357070833846L;
@Override
public void populateItem(final Item<ICellPopulator<T>> cellItem, final String componentId, final IModel<T> rowModel) {
JobTO jobTO = restClient.getJob(rowModel.getObject().getKey());
JobActionPanel panel = new JobActionPanel(componentId, jobTO, false, ProvisioningTaskDirectoryPanel.this, pageRef);
MetaDataRoleAuthorizationStrategy.authorize(panel, WebPage.ENABLE, String.format("%s,%s", StandardEntitlement.TASK_EXECUTE, StandardEntitlement.TASK_UPDATE));
cellItem.add(panel);
}
@Override
public String getCssClass() {
return "col-xs-1";
}
});
return columns;
}
Aggregations