if ("token".equalsIgnoreCase(name)) {
columns.add(new TokenColumn("token"));
} else if (field != null && field.getType().equals(Date.class)) {
columns.add(new DatePropertyColumn<UserTO>(new ResourceModel(name, name), name, name));
} else {
columns.add(new PropertyColumn(new ResourceModel(name, name), name, name));
}
}
for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_ATTRIBUTES_VIEW)) {
columns.add(new UserAttrColumn(name, UserAttrColumn.SchemaType.schema));
}
for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW)) {
columns.add(new UserAttrColumn(name, UserAttrColumn.SchemaType.derivedSchema));
}
for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_VIRTUAL_ATTRIBUTES_VIEW)) {
columns.add(new UserAttrColumn(name, UserAttrColumn.SchemaType.virtualSchema));
}
// Add defaults in case of no selection
if (columns.isEmpty()) {
for (String name : DisplayAttributesModalPage.DEFAULT_SELECTION) {
columns.add(new PropertyColumn(new ResourceModel(name, name), name, name));
}
prefMan.setList(getRequest(), getResponse(), Constants.PREF_USERS_DETAILS_VIEW,
DisplayAttributesModalPage.DEFAULT_SELECTION);
}