public void executeAction(ListGridRecord[] selection, Object actionValue) {
acknowledge(selection);
}
});
if (canSupportDeleteAndAcknowledgeAll()) {
addTableAction(MSG.common_button_ack_all(), MSG.view_alerts_ack_confirm_all(), new TableAction() {
public boolean isEnabled(ListGridRecord[] selection) {
ListGrid grid = getListGrid();
ResultSet resultSet = (null != grid) ? grid.getResultSet() : null;
return (hasWriteAccess && grid != null && resultSet != null && !resultSet.isEmpty());
}
public void executeAction(ListGridRecord[] selection, Object actionValue) {
acknowledgeAll();
}
});
}
addTableAction(MSG.common_button_delete(), MSG.view_alerts_delete_confirm(), ButtonColor.RED,
new ResourceAuthorizedTableAction(AlertHistoryView.this, TableActionEnablement.ANY, (hasWriteAccess ? null
: Permission.MANAGE_ALERTS), new RecordExtractor<Integer>() {
public Collection<Integer> extract(Record[] records) {
List<Integer> result = new ArrayList<Integer>(records.length);
for (Record record : records) {
result.add(record.getAttributeAsInt("resourceId"));
}
return result;
}
}) {
public void executeAction(ListGridRecord[] selection, Object actionValue) {
delete(selection);
}
});
if (canSupportDeleteAndAcknowledgeAll()) {
addTableAction(MSG.common_button_delete_all(), MSG.view_alerts_delete_confirm_all(), ButtonColor.RED,
new TableAction() {
public boolean isEnabled(ListGridRecord[] selection) {
ListGrid grid = getListGrid();
ResultSet resultSet = (null != grid) ? grid.getResultSet() : null;
return (hasWriteAccess && grid != null && resultSet != null && !resultSet.isEmpty());
}
public void executeAction(ListGridRecord[] selection, Object actionValue) {
deleteAll();
}
});
}
if (!context.isSubsystemView() && showNewDefinitionButton) {
addTableAction(MSG.common_button_new() + " " + MSG.common_title_definition(), ButtonColor.BLUE,
new TableAction() {
public boolean isEnabled(ListGridRecord[] selection) {
// todo: this.permissions.isAlert()
return hasWriteAccess;
}