public void selectTask(final TaskSummary summary, final Boolean close) {
   final DefaultPlaceRequest defaultPlaceRequest = new DefaultPlaceRequest("Task Details Multi");
   final PlaceStatus status = placeManager.getStatus(defaultPlaceRequest);
   boolean logOnly = false;
   if (summary.getStatus().equals("Completed") && summary.isLogOnly()) {
     logOnly = true;
   }
   if (status == PlaceStatus.CLOSE) {
     placeManager.goTo(defaultPlaceRequest);
     taskSelected.fire(
         new TaskSelectionEvent(
             selectedServerTemplate,
             summary.getDeploymentId(),
             summary.getTaskId(),
             summary.getTaskName(),
             summary.isForAdmin(),
             logOnly));
   } else if (status == PlaceStatus.OPEN && !close) {
     taskSelected.fire(
         new TaskSelectionEvent(
             selectedServerTemplate,
             summary.getDeploymentId(),
             summary.getTaskId(),
             summary.getTaskName(),
             summary.isForAdmin(),
             logOnly));
   } else if (status == PlaceStatus.OPEN && close) {
     placeManager.closePlace("Task Details Multi");
   }
 }
  public void getDomainSpecifDataForTasks(
      final int startRange,
      String filterValue,
      final List<TaskSummary> myTasksFromDataSet,
      boolean lastPageExactCount) {

    FilterSettings variablesTableSettings = view.getVariablesTableSettings(filterValue);
    variablesTableSettings.setTablePageSize(-1);
    variablesTableSettings.setServerTemplateId(selectedServerTemplate);

    dataSetQueryHelperDomainSpecific.setDataSetHandler(variablesTableSettings);
    dataSetQueryHelperDomainSpecific.setCurrentTableSettings(variablesTableSettings);
    dataSetQueryHelperDomainSpecific.setLastOrderedColumn(COLUMN_TASK_ID);
    dataSetQueryHelperDomainSpecific.setLastSortOrder(SortOrder.ASCENDING);

    List<Comparable> tasksIds = new ArrayList<Comparable>();
    for (TaskSummary task : myTasksFromDataSet) {
      tasksIds.add(task.getTaskId());
    }
    DataSetFilter filter = new DataSetFilter();
    ColumnFilter filter1 = equalsTo(COLUMN_TASK_VARIABLE_TASK_ID, tasksIds);
    filter.addFilterColumn(filter1);
    variablesTableSettings.getDataSetLookup().addOperation(filter);

    dataSetQueryHelperDomainSpecific.lookupDataSet(
        0,
        createDataSetDomainSpecificCallback(
            startRange,
            myTasksFromDataSet,
            variablesTableSettings.getDataSet(),
            lastPageExactCount));
  }
 public void filterTasks(String text) {
   if (text.equals("")) {
     if (allTaskSummaries != null) {
       dataProvider.getList().clear();
       dataProvider.setList(new ArrayList<TaskSummary>(allTaskSummaries));
       dataProvider.refresh();
     }
     if (currentDayTasks != null) {
       view.getTaskListMultiDayBox().clear();
       for (Day day : currentDayTasks.keySet()) {
         view.getTaskListMultiDayBox()
             .addTasksByDay(day, new ArrayList<TaskSummary>(currentDayTasks.get(day)));
       }
       view.getTaskListMultiDayBox().refresh();
     }
   } else {
     if (allTaskSummaries != null) {
       List<TaskSummary> tasks = new ArrayList<TaskSummary>(allTaskSummaries);
       List<TaskSummary> filteredTasksSimple = new ArrayList<TaskSummary>();
       for (TaskSummary ts : tasks) {
         if (ts.getName().toLowerCase().contains(text.toLowerCase())) {
           filteredTasksSimple.add(ts);
         }
       }
       dataProvider.getList().clear();
       dataProvider.setList(filteredTasksSimple);
       dataProvider.refresh();
     }
     if (currentDayTasks != null) {
       Map<Day, List<TaskSummary>> tasksCalendar =
           new HashMap<Day, List<TaskSummary>>(currentDayTasks);
       Map<Day, List<TaskSummary>> filteredTasksCalendar = new HashMap<Day, List<TaskSummary>>();
       view.getTaskListMultiDayBox().clear();
       for (Day d : tasksCalendar.keySet()) {
         if (filteredTasksCalendar.get(d) == null) {
           filteredTasksCalendar.put(d, new ArrayList<TaskSummary>());
         }
         for (TaskSummary ts : tasksCalendar.get(d)) {
           if (ts.getName().toLowerCase().contains(text.toLowerCase())) {
             filteredTasksCalendar.get(d).add(ts);
           }
         }
       }
       for (Day day : filteredTasksCalendar.keySet()) {
         view.getTaskListMultiDayBox()
             .addTasksByDay(day, new ArrayList<TaskSummary>(filteredTasksCalendar.get(day)));
       }
       view.getTaskListMultiDayBox().refresh();
     }
   }
 }
 public void claimTask(final TaskSummary task) {
   taskService
       .call(
           new RemoteCallback<Void>() {
             @Override
             public void callback(Void nothing) {
               view.displayNotification(constants.TaskClaimed(String.valueOf(task.getTaskId())));
               refreshGrid();
             }
           },
           new DefaultErrorCallback())
       .claimTask(selectedServerTemplate, task.getDeploymentId(), task.getTaskId());
   taskSelected.fire(
       new TaskSelectionEvent(
           selectedServerTemplate, task.getDeploymentId(), task.getTaskId(), task.getTaskName()));
 }
 @Override
 public Object getKey(TaskSummary item) {
   return item == null ? null : item.getId();
 }