private Column initDueDateColumn() {
   // Time
   Column<RequestSummary, String> dueDateColumn =
       new Column<RequestSummary, String>(new TextCell()) {
         @Override
         public String getValue(RequestSummary object) {
           return DateUtils.getDateTimeStr(object.getTime());
         }
       };
   dueDateColumn.setSortable(true);
   dueDateColumn.setDataStoreName(COLUMN_TIMESTAMP);
   return dueDateColumn;
 }
 private Column initJobTypeColumn() {
   // Job type
   Column<RequestSummary, String> jobTypeColumn =
       new Column<RequestSummary, String>(new TextCell()) {
         @Override
         public String getValue(RequestSummary object) {
           return object.getCommandName();
         }
       };
   jobTypeColumn.setSortable(true);
   jobTypeColumn.setDataStoreName(COLUMN_COMMANDNAME);
   return jobTypeColumn;
 }
 private Column initDescriptionColumn() {
   // start time
   Column<ProcessInstanceSummary, String> descriptionColumn =
       new Column<ProcessInstanceSummary, String>(new TextCell()) {
         @Override
         public String getValue(ProcessInstanceSummary object) {
           return object.getProcessInstanceDescription();
         }
       };
   descriptionColumn.setSortable(true);
   descriptionColumn.setDataStoreName("log.processInstanceDescription");
   return descriptionColumn;
 }
 private Column initJobNameColumn() {
   // Job name
   Column<RequestSummary, String> jobNameColumn =
       new Column<RequestSummary, String>(new TextCell()) {
         @Override
         public String getValue(RequestSummary object) {
           return object.getKey();
         }
       };
   jobNameColumn.setSortable(true);
   jobNameColumn.setDataStoreName(COLUMN_BUSINESSKEY);
   return jobNameColumn;
 }
  private Column initInitiatorColumn() {
    Column<ProcessInstanceSummary, String> processInitiatorColumn =
        new Column<ProcessInstanceSummary, String>(new TextCell()) {
          @Override
          public String getValue(ProcessInstanceSummary object) {
            return object.getInitiator();
          }
        };
    processInitiatorColumn.setSortable(true);
    processInitiatorColumn.setDataStoreName("log.identity");

    return processInitiatorColumn;
  }
  private Column initStatusColumn() {
    // Status
    Column<RequestSummary, String> statusColumn =
        new Column<RequestSummary, String>(new TextCell()) {
          @Override
          public String getValue(RequestSummary object) {
            return object.getStatus();
          }
        };
    statusColumn.setSortable(true);
    statusColumn.setDataStoreName(COLUMN_STATUS);

    return statusColumn;
  }
  private Column initJobIdColumn() {
    // Id
    Column<RequestSummary, Number> jobIdColumn =
        new Column<RequestSummary, Number>(new NumberCell()) {
          @Override
          public Number getValue(RequestSummary object) {
            return object.getJobId();
          }
        };
    jobIdColumn.setSortable(true);
    jobIdColumn.setDataStoreName(COLUMN_ID);

    return jobIdColumn;
  }
  private Column initProcessVersionColumn() {
    // Process Version.
    Column<ProcessInstanceSummary, String> processVersionColumn =
        new Column<ProcessInstanceSummary, String>(new TextCell()) {
          @Override
          public String getValue(ProcessInstanceSummary object) {
            return object.getProcessVersion();
          }
        };
    processVersionColumn.setSortable(true);
    processVersionColumn.setDataStoreName("log.processVersion");

    return processVersionColumn;
  }
  private Column initStartDateColumn() {
    // start time
    Column<ProcessInstanceSummary, String> startTimeColumn =
        new Column<ProcessInstanceSummary, String>(new TextCell()) {
          @Override
          public String getValue(ProcessInstanceSummary object) {
            Date startTime = object.getStartTime();
            if (startTime != null) {
              DateTimeFormat format = DateTimeFormat.getFormat("dd/MM/yyyy HH:mm");
              return format.format(startTime);
            }
            return "";
          }
        };
    startTimeColumn.setSortable(true);
    startTimeColumn.setDataStoreName("log.start");

    return startTimeColumn;
  }
  private Column initProcessStateColumn() {
    // Process State
    Column<ProcessInstanceSummary, String> processStateColumn =
        new Column<ProcessInstanceSummary, String>(new TextCell()) {
          @Override
          public String getValue(ProcessInstanceSummary object) {
            String statusStr = constants.Unknown();
            switch (object.getState()) {
              case ProcessInstance.STATE_ACTIVE:
                statusStr = constants.Active();
                break;
              case ProcessInstance.STATE_ABORTED:
                statusStr = constants.Aborted();
                break;
              case ProcessInstance.STATE_COMPLETED:
                statusStr = constants.Completed();
                break;
              case ProcessInstance.STATE_PENDING:
                statusStr = constants.Pending();
                break;
              case ProcessInstance.STATE_SUSPENDED:
                statusStr = constants.Suspended();
                break;

              default:
                break;
            }

            return statusStr;
          }
        };
    processStateColumn.setSortable(true);
    processStateColumn.setDataStoreName("log.status");

    return processStateColumn;
  }
  private Column<RequestSummary, RequestSummary> initActionsColumn() {
    List<HasCell<RequestSummary, ?>> cells = new LinkedList<HasCell<RequestSummary, ?>>();
    List<String> allStatuses = new ArrayList<String>();
    allStatuses.add("QUEUED");
    allStatuses.add("DONE");
    allStatuses.add("CANCELLED");
    allStatuses.add("ERROR");
    allStatuses.add("RETRYING");
    allStatuses.add("RUNNING");
    cells.add(
        new ActionHasCell(
            constants.Details(),
            allStatuses,
            new Delegate<RequestSummary>() {
              @Override
              public void execute(RequestSummary job) {
                presenter.showJobDetails(job);
              }
            }));

    List<String> activeStatuses = new ArrayList<String>();
    activeStatuses.add("QUEUED");
    activeStatuses.add("RETRYING");
    activeStatuses.add("RUNNING");
    cells.add(
        new ActionHasCell(
            constants.Cancel(),
            activeStatuses,
            new Delegate<RequestSummary>() {
              @Override
              public void execute(RequestSummary job) {
                if (Window.confirm(constants.CancelJob())) {
                  presenter.cancelRequest(job.getJobId());
                }
              }
            }));

    List<String> requeueStatuses = new ArrayList<String>();
    requeueStatuses.add("ERROR");
    requeueStatuses.add("RUNNING");
    cells.add(
        new ActionHasCell(
            constants.Requeue(),
            requeueStatuses,
            new Delegate<RequestSummary>() {
              @Override
              public void execute(RequestSummary job) {
                if (Window.confirm(constants.RequeueJob())) {
                  presenter.requeueRequest(job.getJobId());
                }
              }
            }));

    CompositeCell<RequestSummary> cell = new CompositeCell<RequestSummary>(cells);
    Column<RequestSummary, RequestSummary> actionsColumn =
        new Column<RequestSummary, RequestSummary>(cell) {
          @Override
          public RequestSummary getValue(RequestSummary object) {
            return object;
          }
        };
    actionsColumn.setDataStoreName(COL_ID_ACTIONS);
    return actionsColumn;
  }