cronModeLayout.show();
}
}
private DynamicForm createRepeatForm() {
final EnhancedDynamicForm repeatForm = new EnhancedDynamicForm(this.isReadOnly);
repeatForm.setNumCols(6);
repeatForm.setColWidths(140, 130, 130, 130, 130);
TreeSet<TimeUnit> supportedUnits = new TreeSet<TimeUnit>();
supportedUnits.add(TimeUnit.SECONDS);
supportedUnits.add(TimeUnit.MINUTES);
supportedUnits.add(TimeUnit.HOURS);
supportedUnits.add(TimeUnit.DAYS);
supportedUnits.add(TimeUnit.WEEKS);
supportedUnits.add(TimeUnit.MONTHS);
supportedUnits.add(TimeUnit.YEARS);
DurationItem repeatIntervalItem = new DurationItem(FIELD_REPEAT_INTERVAL,
MSG.widget_jobTriggerEditor_field_repeatInterval_now(), supportedUnits, false, this.isReadOnly);
repeatIntervalItem.setRequired(true);
repeatIntervalItem.setContextualHelp(MSG.widget_jobTriggerEditor_fieldHelp_repeatInterval());
RadioGroupItem recurrenceTypeItem = new RadioGroupItem(FIELD_RECURRENCE_TYPE);
recurrenceTypeItem.setRequired(true);
recurrenceTypeItem.setShowTitle(false);
LinkedHashMap<String, String> recurrenceTypeValueMap = new LinkedHashMap<String, String>();
recurrenceTypeValueMap.put("for", MSG.widget_jobTriggerEditor_value_for());
recurrenceTypeValueMap.put("until", MSG.widget_jobTriggerEditor_value_until());
recurrenceTypeValueMap.put("indefinitely", MSG.widget_jobTriggerEditor_value_indefinitely());
recurrenceTypeItem.setValueMap(recurrenceTypeValueMap);
supportedUnits = new TreeSet<TimeUnit>();
supportedUnits.add(TimeUnit.SECONDS);
supportedUnits.add(TimeUnit.MINUTES);
supportedUnits.add(TimeUnit.HOURS);
supportedUnits.add(TimeUnit.DAYS);
supportedUnits.add(TimeUnit.WEEKS);
supportedUnits.add(TimeUnit.MONTHS);
supportedUnits.add(TimeUnit.YEARS);
final DurationItem repeatDurationItem = new DurationItem(FIELD_REPEAT_DURATION, null, supportedUnits, true,
this.isReadOnly);
repeatDurationItem.setShowTitle(false);
repeatDurationItem.setVisible(false);
repeatDurationItem.setContextualHelp(MSG.widget_jobTriggerEditor_fieldHelp_repeatDuration());
final DateTimeItem endTimeItem = createDateTimeItem(FIELD_END_TIME);
endTimeItem.setShowTitle(false);
endTimeItem.setVisible(false);
SpacerItem spacerItem = new SpacerItem();
recurrenceTypeItem.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent event) {
String recurrenceType = (String) event.getValue();
changeRecurrenceType(recurrenceType, endTimeItem, repeatDurationItem);
}
});
repeatForm.setFields(repeatIntervalItem, recurrenceTypeItem, repeatDurationItem, endTimeItem, spacerItem);
repeatForm.setVisible(false);
return repeatForm;
}