public void reset(Date d) {

    startTimePicker.setHour("12"); // $NON-NLS-1$
    startTimePicker.setMinute("00"); // $NON-NLS-1$
    startTimePicker.setTimeOfDay(TimeUtil.TimeOfDay.AM);

    dateRangeEditor.reset(d);

    secondlyEditor.reset();
    minutelyEditor.reset();
    hourlyEditor.reset();
    dailyEditor.reset();
    weeklyEditor.reset();
    monthlyEditor.reset();
    yearlyEditor.reset();
  }
 public List<DayOfWeek> getSelectedDaysOfWeek() {
   ArrayList<DayOfWeek> selectedDaysOfWeek = new ArrayList<DayOfWeek>();
   if ((temporalState == TemporalValue.DAILY) && !dailyEditor.isEveryNDays()) {
     selectedDaysOfWeek.add(DayOfWeek.MON);
     selectedDaysOfWeek.add(DayOfWeek.TUE);
     selectedDaysOfWeek.add(DayOfWeek.WED);
     selectedDaysOfWeek.add(DayOfWeek.THU);
     selectedDaysOfWeek.add(DayOfWeek.FRI);
   } else if (temporalState == TemporalValue.WEEKLY) {
     selectedDaysOfWeek.addAll(weeklyEditor.getCheckedDays());
   } else if ((temporalState == TemporalValue.MONTHLY) && monthlyEditor.isNthDayNameOfMonth()) {
     selectedDaysOfWeek.add(monthlyEditor.getDayOfWeek());
   } else if ((temporalState == TemporalValue.YEARLY) && yearlyEditor.isNthDayNameOfMonthName()) {
     selectedDaysOfWeek.add(yearlyEditor.getDayOfWeek());
   }
   return selectedDaysOfWeek;
 }
 protected String getWeeklyCronString() throws RuntimeException {
   String cronStr;
   StringBuilder recurrenceSb = new StringBuilder();
   // WeeklyOn 0 33 6 1,3,5
   recurrenceSb
       .append(RecurrenceType.WeeklyOn)
       .append(SPACE)
       .append(getTimeOfRecurrence())
       .append(SPACE)
       .append(weeklyEditor.getCheckedDaysAsString(VALUE_OF_SUNDAY));
   try {
     cronStr = CronParser.recurrenceStringToCronString(recurrenceSb.toString());
   } catch (CronParseException e) {
     throw new RuntimeException(
         Messages.getString("schedule.invalidRecurrenceString", recurrenceSb.toString()));
   }
   return cronStr;
 }
  private void configureOnChangeHandler() {
    final RecurrenceEditor localThis = this;

    ICallback<IChangeHandler> handler =
        new ICallback<IChangeHandler>() {
          public void onHandle(IChangeHandler o) {
            localThis.changeHandler();
          }
        };

    startTimePicker.setOnChangeHandler(handler);
    dateRangeEditor.setOnChangeHandler(handler);

    secondlyEditor.setOnChangeHandler(handler);
    minutelyEditor.setOnChangeHandler(handler);
    hourlyEditor.setOnChangeHandler(handler);
    dailyEditor.setOnChangeHandler(handler);
    weeklyEditor.setOnChangeHandler(handler);
    monthlyEditor.setOnChangeHandler(handler);
    yearlyEditor.setOnChangeHandler(handler);
  }
 private void setWeeklyOnRecurrence(String[] recurrenceTokens) {
   setTemporalState(TemporalValue.WEEKLY);
   String days = recurrenceTokens[4];
   weeklyEditor.setCheckedDaysAsString(days, VALUE_OF_SUNDAY);
 }