ListGridField idField = new ListGridField("id", MSG.common_title_id());
idField.setType(ListGridFieldType.INTEGER);
idField.setWidth(50);
IconField originField = new IconField("cannedExpression");
originField.setCellFormatter(new CellFormatter() {
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
String icon = "global/User_16.png";
if (value!=null) {
icon = "global/Plugin_16.png";
}
return "<img class='tableImage' src=\"" + ImageManager.getFullImagePath(icon) + "\" />";
}
});
originField.setShowHover(true);
originField.setHoverCustomizer(new HoverCustomizer() {
public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
String expr = record.getAttribute("cannedExpression");
String displayName = MSG.view_dynagroup_originHoverUser();
if (expr!=null) {
displayName = MSG.view_dynagroup_originHoverPlugin(expr.replaceAll(":.*", ""));
}
return displayName;
}
});
ListGridField nameField = new ListGridField("name", MSG.common_title_name(), 150);
nameField.setCellFormatter(new EscapedHtmlCellFormatter());
ListGridField descriptionField = new ListGridField("description", MSG.common_title_description());
descriptionField.setCellFormatter(new EscapedHtmlCellFormatter());
ListGridField expressionField = new ListGridField("expression", MSG.view_dynagroup_expressionSet(), 250);
expressionField.setCellFormatter(new CellFormatter() {
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
return value.toString().replaceAll("\\n", "<br/>");
}
});