public UserPropertyExtractor(TextResource textResource) {
super(textResource);
}
public Object getPropertyValue(Object target, String property) throws Exception {
User user = (User) target;
if ("enabled".equals(property)) {
boolean enabled = user.isEnabled();
if (enabled) return getText("action.activate");
else return getText("action.freeze");
}
if ("groups".equals(property)) {
return getPropertyIn(user.getMembers(), "group.name");
} else {
return super.getPropertyValue(target, property);
}
}