private void setLastDayNameOfMonthNameRecurrence(String[] recurrenceTokens) {
   setTemporalState(TemporalValue.YEARLY);
   yearlyEditor.setNthDayNameOfMonthName();
   yearlyEditor.setMonthOfYear1(MonthOfYear.get(Integer.parseInt(recurrenceTokens[5]) - 1));
   yearlyEditor.setWeekOfMonth(WeekOfMonth.LAST);
   yearlyEditor.setDayOfWeek(DayOfWeek.get(Integer.parseInt(recurrenceTokens[4]) - 1));
 }
  /** @param repeatInSecs */
  public void inititalizeWithRepeatInSecs(int repeatInSecs) {

    TemporalValue currentVal;
    long repeatTime;
    if (TimeUtil.isSecondsWholeDay(repeatInSecs)) {
      repeatTime = TimeUtil.secsToDays(repeatInSecs);
      currentVal = TemporalValue.DAILY;
      dailyEditor.setRepeatValue(Long.toString(repeatTime));
    } else {
      SimpleRecurrencePanel p = null;
      if (TimeUtil.isSecondsWholeHour(repeatInSecs)) {
        repeatTime = TimeUtil.secsToHours(repeatInSecs);
        currentVal = TemporalValue.HOURS;
      } else if (TimeUtil.isSecondsWholeMinute(repeatInSecs)) {
        repeatTime = TimeUtil.secsToMinutes(repeatInSecs);
        currentVal = TemporalValue.MINUTES;
      } else {
        // the repeat time is seconds
        repeatTime = repeatInSecs;
        currentVal = TemporalValue.SECONDS;
      }
      p = (SimpleRecurrencePanel) temporalPanelMap.get(currentVal);
      p.setValue(Long.toString(repeatTime));
    }
    setTemporalState(currentVal);
  }
  private void selectScheduleTypeEditor(ScheduleType scheduleType) {
    // if we are switching to cron type, then hide the start time panel
    if ((isBlockoutDialog == false) && (startTimePanel != null)) {
      if (scheduleType == ScheduleType.CRON) {
        startTimePanel.setVisible(false);
      } else {
        startTimePanel.setVisible(true);
      }
    }

    // hide all panels
    for (Map.Entry<ScheduleType, Panel> me : scheduleTypeMap.entrySet()) {
      me.getValue().setVisible(false);
    }
    // show the selected panel
    Panel p = scheduleTypeMap.get(scheduleType);
    p.setVisible(true);

    TemporalValue tv = scheduleTypeToTemporalValue(scheduleType);
    if (null != tv) {
      // force the recurrence editor to display the appropriate ui
      recurrenceEditor.setTemporalState(tv);
    }
  }
 private void setEveryMonthNameNRecurrence(String[] recurrenceTokens) {
   setTemporalState(TemporalValue.YEARLY);
   yearlyEditor.setEveryMonthOnNthDay();
   yearlyEditor.setDayOfMonth(recurrenceTokens[4]);
   yearlyEditor.setMonthOfYear0(MonthOfYear.get(Integer.parseInt(recurrenceTokens[5]) - 1));
 }
 private void setLastDayNameOfMonthRecurrence(String[] recurrenceTokens) {
   setTemporalState(TemporalValue.MONTHLY);
   monthlyEditor.setNthDayNameOfMonth();
   monthlyEditor.setWeekOfMonth(WeekOfMonth.LAST);
   monthlyEditor.setDayOfWeek(DayOfWeek.get(Integer.parseInt(recurrenceTokens[4]) - 1));
 }
 private void setDayNOfMonthRecurrence(String[] recurrenceTokens) {
   setTemporalState(TemporalValue.MONTHLY);
   monthlyEditor.setDayNOfMonth();
   String dayNOfMonth = recurrenceTokens[4];
   monthlyEditor.setDayOfMonth(dayNOfMonth);
 }
 private void setWeeklyOnRecurrence(String[] recurrenceTokens) {
   setTemporalState(TemporalValue.WEEKLY);
   String days = recurrenceTokens[4];
   weeklyEditor.setCheckedDaysAsString(days, VALUE_OF_SUNDAY);
 }
 private void setEveryWeekdayRecurrence(String[] recurrenceTokens) {
   setTemporalState(TemporalValue.DAILY);
   dailyEditor.setEveryWeekday();
 }