String url = LinkManager.getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
return LinkManager.getHref(url, o.toString());
}
});
fieldResource.setShowHover(true);
fieldResource.setHoverCustomizer(new HoverCustomizer() {
public String hoverHTML(Object value, ListGridRecord listGridRecord, int rowNum, int colNum) {
return AncestryUtil.getResourceHoverHTML(listGridRecord, 0);
}
});
ListGridField fieldAncestry = AncestryUtil.setupAncestryListGridField();
ListGridField fieldDateCreated = new ListGridField(DataSource.Field.DATECREATED,
MSG.common_title_dateCreated());
TimestampCellFormatter.prepareDateField(fieldDateCreated);
ListGridField fieldLastUpdated = new ListGridField(DataSource.Field.LASTUPDATED,
MSG.common_title_lastUpdated());
TimestampCellFormatter.prepareDateField(fieldLastUpdated);
ListGridField fieldStatus = new ListGridField(DataSource.Field.STATUS, MSG.common_title_status());
ListGridField fieldUser = new ListGridField(DataSource.Field.USER, MSG.common_title_user());
fieldResource.setWidth("30%");
fieldAncestry.setWidth("*");
fieldDateCreated.setWidth(150);
fieldLastUpdated.setWidth(150);
fieldStatus.setWidth("10%");
fieldUser.setWidth("10%");
fieldResource.setType(ListGridFieldType.LINK);
fieldResource.setTarget("_self");
fieldStatus.setType(ListGridFieldType.ICON);
HashMap<String, String> statusIcons = new HashMap<String, String>(4);
statusIcons.put(ConfigurationUpdateStatus.SUCCESS.name(),
ImageManager.getPluginConfigurationIcon(ConfigurationUpdateStatus.SUCCESS));
statusIcons.put(ConfigurationUpdateStatus.FAILURE.name(),
ImageManager.getPluginConfigurationIcon(ConfigurationUpdateStatus.FAILURE));
statusIcons.put(ConfigurationUpdateStatus.INPROGRESS.name(),
ImageManager.getPluginConfigurationIcon(ConfigurationUpdateStatus.INPROGRESS));
statusIcons.put(ConfigurationUpdateStatus.NOCHANGE.name(),
ImageManager.getPluginConfigurationIcon(ConfigurationUpdateStatus.NOCHANGE));
fieldStatus.setValueIcons(statusIcons);
fieldStatus.addRecordClickHandler(new RecordClickHandler() {
@Override
public void onRecordClick(RecordClickEvent event) {
new ErrorMessageWindow(MSG.view_group_pluginConfig_members_statusDetails(), "<pre>"
+ getStatusHtmlString(event.getRecord()) + "</pre>").show();
}
});
fieldStatus.setShowHover(true);
fieldStatus.setHoverCustomizer(new HoverCustomizer() {
@Override
public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
String html = getStatusHtmlString(record);
if (html.length() > 80) {
// this was probably an error stack trace, snip it so the tooltip isn't too big