location.setValue(event.getLocation());
}
addFormElement("cal.form.location", location);
// start
begin = new DateElement("cal.form.begin", event.getBegin(), "dd.MM.yyyy HH:mm");
begin.setMandatory(true);
begin.setDateChooserTimeEnabled(true);
begin.setDateChooserDateFormat("%d.%m.%Y %H:%M");
begin.setExample(begin.getExample());
addFormElement("cal.form.begin", begin);
// end
end = new DateElement("cal.form.end", event.getEnd(), "dd.MM.yyyy HH:mm");
end.setMandatory(true);
end.setDateChooserTimeEnabled(true);
end.setDateChooserDateFormat("%d.%m.%Y %H:%M");
begin.setExample(end.getExample());
addFormElement("cal.form.end", end);
allDayEvent = new CheckBoxElement("cal.form.allday", event.isAllDayEvent());
addFormElement("cal.form.allday", allDayEvent);
spacer = new SpacerElement(true, false);
addFormElement("spacer1", spacer);
// recurrence
String currentRecur = CalendarUtils.getRecurrence(event.getRecurrenceRule());
VisibilityDependsOnSelectionRule rule;
String[] keysRecurrence = new String[] {
RECURRENCE_NONE,
KalendarEvent.DAILY,
KalendarEvent.WORKDAILY,
KalendarEvent.WEEKLY,
KalendarEvent.BIWEEKLY,
KalendarEvent.MONTHLY,
KalendarEvent.YEARLY
};
String[] valuesRecurrence = new String[] {
translate("cal.form.recurrence.none"),
translate("cal.form.recurrence.daily"),
translate("cal.form.recurrence.workdaily"),
translate("cal.form.recurrence.weekly"),
translate("cal.form.recurrence.biweekly"),
translate("cal.form.recurrence.monthly"),
translate("cal.form.recurrence.yearly")
};
chooseRecurrence = new StaticSingleSelectionElement("cal.form.recurrence", keysRecurrence, valuesRecurrence);
if(currentRecur != null && !currentRecur.equals("")) {
chooseRecurrence.select(currentRecur, true);
} else {
chooseRecurrence.select(RECURRENCE_NONE, true);
}
addFormElement("cal.form.recurrence", chooseRecurrence);
// recurrence end date
recurrenceEnd = new DateElement("cal.form.recurrence.end", null, "dd.MM.yyyy");
recurrenceEnd.setDateChooserDateFormat("%d.%m.%Y");
recurrenceEnd.setExample(translate("cal.form.recurrence.end.example"));
Date recurEnd = CalendarUtils.getRecurrenceEndDate(event.getRecurrenceRule());
if(recurEnd != null) recurrenceEnd.setDate(recurEnd);
addFormElement("cal.form.recurrence.end", recurrenceEnd);