public void enableTools() {
    List<Schedule> scheduleList = schedulesListCtrl.getSelectedSchedules();

    boolean suspendEnabled = false, resumeEnabled = false;

    boolean resolvedSuspended = false, resolvedEnabled = false;

    for (Schedule schedule : scheduleList) {
      if (!resolvedSuspended
          && !schedule.getTriggerState().equalsIgnoreCase(SUSPENDED_SCHEDULER_STATE)) {
        suspendEnabled = true;
        resolvedSuspended = true;
      }

      if (!resolvedEnabled
          && !schedule.getTriggerState().equalsIgnoreCase(NORMAL_SCHEDULER_STATE)) {
        resumeEnabled = true;
        resolvedEnabled = true;
      }
    }

    int numSelectedItems = scheduleList.size();

    enableWidget(schedulerToolbar.getCreateBtn(), true);
    enableWidget(schedulerToolbar.getUpdateBtn(), 1 == numSelectedItems);
    enableWidget(schedulerToolbar.getDeleteBtn(), numSelectedItems > 0);
    enableWidget(schedulerToolbar.getSuspendBtn(), suspendEnabled);
    enableWidget(schedulerToolbar.getResumeBtn(), resumeEnabled);
    enableWidget(schedulerToolbar.getRunNowBtn(), numSelectedItems > 0);
    enableWidget(schedulerToolbar.getRefreshBtn(), true);
  }
  private void initFilterList() {
    String currentFilter = schedulerToolbar.getFilterValue();
    currentFilter = (null == currentFilter) ? SchedulerToolbar.ALL_GROUPS_FILTER : currentFilter;

    Set<String> groupNames = new HashSet<String>();
    List<Schedule> scheduleList = schedulesModel.getScheduleList();
    for (int ii = 0; ii < scheduleList.size(); ++ii) {
      Schedule s = scheduleList.get(ii);
      String groupName = s.getJobGroup();
      if (!groupNames.contains(groupName)) {
        groupNames.add(groupName);
      }
    }
    schedulerToolbar.clearFilters();

    schedulerToolbar.addFilterItem(SchedulerToolbar.ALL_GROUPS_FILTER);
    for (String name : groupNames) {
      schedulerToolbar.addFilterItem(name);
    }
    schedulerToolbar.setFilterValue(currentFilter);
  }
 private List<Schedule> getFilteredSchedulesList(List<Schedule> scheduleList) {
   List<Schedule> filteredList = null;
   String filterVal = schedulerToolbar.getFilterValue();
   if (!SchedulerToolbar.ALL_GROUPS_FILTER.equals(filterVal)) {
     filteredList = new ArrayList<Schedule>();
     for (int ii = 0; ii < scheduleList.size(); ++ii) {
       Schedule s = scheduleList.get(ii);
       if (s.getJobGroup().equals(filterVal)) {
         filteredList.add(s);
       }
     }
   } else {
     filteredList = scheduleList;
   }
   return filteredList;
 }
  public void init(
      SchedulesListController pSchedulesListController,
      SolutionRepositoryActionSequenceListEditorController solRepActionSequenceEditorController) {

    if (!isInitialized) {
      this.schedulesListController = pSchedulesListController;
      this.solRepActionSequenceEditorController = solRepActionSequenceEditorController;

      final SchedulerToolbarController localThis = this;

      schedulerToolbar.setOnCreateListener(
          new ICallback<Widget>() {
            public void onHandle(Widget w) {
              localThis.handleCreateSchedule();
            }
          });

      schedulerToolbar.setOnUpdateListener(
          new ICallback<Widget>() {
            public void onHandle(Widget w) {
              localThis.handleUpdateSchedule();
            }
          });

      schedulerToolbar.setOnDeleteListener(
          new ICallback<Widget>() {
            public void onHandle(Widget w) {
              localThis.handleDeleteSchedules();
            }
          });

      schedulerToolbar.setOnResumeListener(
          new ICallback<Widget>() {
            public void onHandle(Widget w) {
              localThis.handleResumeSchedules();
            }
          });

      schedulerToolbar.setOnSuspendListener(
          new ICallback<Widget>() {
            public void onHandle(Widget w) {
              localThis.handlePauseSchedules();
            }
          });

      schedulerToolbar.setOnRunNowListener(
          new ICallback<Widget>() {
            public void onHandle(Widget w) {
              localThis.handleRunNowSchedules();
            }
          });

      schedulerToolbar.setOnRefreshListener(
          new ICallback<Widget>() {
            public void onHandle(Widget w) {
              loadJobsTable();
              // TODO sbarkdull reload sol rep model/view
            }
          });

      schedulerToolbar.setOnFilterListChangeListener(
          new ICallback<String>() {
            public void onHandle(String s) {
              updateSchedulesTable();
            }
          });

      ICallback<SolutionRepositoryActionSequenceListEditor> loadingCompleteHandler =
          new ICallback<SolutionRepositoryActionSequenceListEditor>() {
            public void onHandle(SolutionRepositoryActionSequenceListEditor o) {
              localThis.handleLoadingComplete();
            }
          };
      scheduleCreatorDialog
          .getSolutionRepositoryActionSequenceEditor()
          .setOnLoadingCompleteHandler(loadingCompleteHandler);

      loadJobsTable(); // TODO sbarkdull  belongs in SchedulesListController
      enableTools();

      isInitialized = true;
    }
  }