return (count >= 1 && hasControlPermission());
}
public void executeAction(ListGridRecord[] selection, Object actionValue) {
int numCancelRequestsSubmitted = 0;
OperationGWTServiceAsync opService = GWTServiceLookup.getOperationService();
for (ListGridRecord toBeCanceled : selection) {
// only cancel those selected operations that are currently in progress
if (OperationRequestStatus.INPROGRESS.name().equals(
toBeCanceled.getAttribute(AbstractOperationHistoryDataSource.Field.STATUS))) {
numCancelRequestsSubmitted++;
final int historyId = toBeCanceled.getAttributeAsInt(OperationHistoryDataSource.Field.ID);
opService.cancelOperationHistory(historyId, false, new AsyncCallback<Void>() {
public void onSuccess(Void result) {
Message msg = new Message(MSG.view_operationHistoryList_cancelSuccess(String
.valueOf(historyId)), Severity.Info, EnumSet.of(Option.BackgroundJobResult));
CoreGUI.getMessageCenter().notify(msg);
};