ListGrid listGrid = getListGrid();
listGrid.setFields(fieldId, fieldDateCreated, fieldLastUpdated, fieldStatus, fieldUser);
addTableAction(MSG.common_button_delete(), MSG.common_msg_areYouSure(), ButtonColor.RED,
new AbstractTableAction(this.groupPerms.isInventory() ? TableActionEnablement.ANY
: TableActionEnablement.NEVER) {
@Override
public void executeAction(final ListGridRecord[] selection, Object actionValue) {
if (selection == null || selection.length == 0) {
return;
}
ConfigurationGWTServiceAsync service = GWTServiceLookup.getConfigurationService();
Integer groupId = HistoryGroupPluginConfigurationTable.this.group.getId();
Integer[] updateIds = new Integer[selection.length];
int i = 0;
for (ListGridRecord record : selection) {
updateIds[i++] = record.getAttributeAsInt(DataSource.Field.ID);
}
service.deleteGroupPluginConfigurationUpdate(groupId, updateIds, new AsyncCallback<Void>() {
@Override
public void onSuccess(Void result) {
refresh();
Message message = new Message(MSG.view_group_pluginConfig_table_deleteSuccessful(String
.valueOf(selection.length)), Message.Severity.Info, EnumSet
.of(Message.Option.Transient));
CoreGUI.getMessageCenter().notify(message);
}
@Override
public void onFailure(Throwable caught) {
refreshTableInfo();
CoreGUI.getErrorHandler().handleError(MSG.view_group_pluginConfig_table_deleteFailure(),
caught);
}
});
}
});
addTableAction(MSG.view_group_pluginConfig_table_viewSettings(), ButtonColor.BLUE, new AbstractTableAction(
TableActionEnablement.SINGLE) {
@Override
public void executeAction(ListGridRecord[] selection, Object actionValue) {
CoreGUI.goToView(LinkManager.getGroupPluginConfigurationUpdateHistoryLink(
EntityContext.forGroup(HistoryGroupPluginConfigurationTable.this.group), null)
+ "/" + selection[0].getAttribute(DataSource.Field.ID) + "/Settings");
refreshTableInfo();
}
});
addTableAction(MSG.view_group_pluginConfig_table_viewMemberHistory(), new AbstractTableAction(
TableActionEnablement.SINGLE) {
@Override
public void executeAction(ListGridRecord[] selection, Object actionValue) {
CoreGUI.goToView(LinkManager.getGroupPluginConfigurationUpdateHistoryLink(
EntityContext.forGroup(HistoryGroupPluginConfigurationTable.this.group), null)