Package org.olat.core.gui.formelements

Examples of org.olat.core.gui.formelements.DateElement


    // location (hide if in readonly mode and only free/busy flag)
    location = new TextElement("cal.search.location", 40);
    addFormElement("cal.search.location", location);
   
    // beginPeriod (hide if in readonly mode and only free/busy flag)
    beginPeriod = new DateElement("cal.search.beginPeriod", null, "dd.MM.yyyy");
    beginPeriod.setDateChooserDateFormat("%d.%m.%Y");
    beginPeriod.setExample(beginPeriod.getExample());
    addFormElement("cal.search.beginPeriod", beginPeriod);
   
    // endPeriod (hide if in readonly mode and only free/busy flag)
    endPeriod = new DateElement("cal.search.endPeriod", null, "dd.MM.yyyy");
    endPeriod.setDateChooserDateFormat("%d.%m.%Y");
    endPeriod.setExample(endPeriod.getExample());
    addFormElement("cal.search.endPeriod", endPeriod);
   
    // submit/cancel buttons
View Full Code Here


        if (isOLATAdmin || sLogV)
            addFormElement("logStat", logStat);
       
        addFormElement("spacer1", new SpacerElement());
       
        this.beginDate = new DateElement("logfilechooserform.begindate", locale);
        this.beginDate.setExample(Formatter.getInstance(locale).formatDate(new Date()));
        addFormElement("startdate", this.beginDate);
       
        this.endDate = new DateElement("logfilechooserform.enddate", locale);
        this.endDate.setExample(Formatter.getInstance(locale).formatDate(new Date()));
        addFormElement("enddate", this.endDate);
     
        setSubmitKey("logfilechooserform.archive");
      setCancelButton();
View Full Code Here

      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);
View Full Code Here

    addFormElement("status", createStatusSelectionElement());

    // creation date constraints
    addFormElement("space3", new SpacerElement(true, false));
    addFormElement("title.date", new TitleElement("search.form.title.date"));
    afterDate = new DateElement("search.form.afterDate", getLocale());
    addFormElement("afterDate", afterDate);
    beforeDate = new DateElement("search.form.beforeDate", getLocale());
    addFormElement("beforeDate", beforeDate);

    addSubmitKey("submit.search", "submit.search");
  }
View Full Code Here

      showResultsDateDependentButton.select(showResultsDateDependent ? "y" : "n", true);
      addFormElement("qti_showresult", showResultsDateDependentButton);

      // start date
      Date startDate = (Date) modConfig.get(IQEditController.CONFIG_KEY_RESULTS_START_DATE);
      startDateElement = new DateElement("qti.form.date.start", startDate, "dd.MM.yyyy HH:mm");
      startDateElement.setMandatory(showResultsDateDependent);
      startDateElement.setDateChooserTimeEnabled(true);
      startDateElement.setDateChooserDateFormat("%d.%m.%Y %H:%M");
      startDateElement.setExample(startDateElement.getExample());
      addFormElement("qti.form.date.start", startDateElement);

      // end date
      Date endDate = (Date) modConfig.get(IQEditController.CONFIG_KEY_RESULTS_END_DATE);
      endDateElement = new DateElement("qti.form.date.end", endDate, "dd.MM.yyyy HH:mm");
      // endDateElement.setMandatory(showResultsDateDependent);
      endDateElement.setDateChooserTimeEnabled(true);
      endDateElement.setDateChooserDateFormat("%d.%m.%Y %H:%M");
      endDateElement.setExample(endDateElement.getExample());
      addFormElement("qti.form.date.end", endDateElement);
View Full Code Here

   * @see org.olat.user.propertyhandlers.UserPropertyHandler#getFormElement(java.util.Locale, org.olat.core.id.User, java.lang.String, boolean)
   */
  public FormElement getFormElement(Locale locale, User user, String usageIdentifyer, boolean isAdministrativeUser) {
    // default is no element
    UserManager um = UserManager.getInstance();
    DateElement ui = null;
    ui = new DateElement(i18nFormElementLabelKey(), locale);
    updateFormElementFromUser(ui, user);
    if ( ! um.isUserViewReadOnly(usageIdentifyer, this) || isAdministrativeUser) {
      ui.setExample(Formatter.getInstance(locale).formatDate(new Date()));
    } else {
      ui.setReadOnly(true);
    }
    if (um.isMandatoryUserProperty(usageIdentifyer, this)) {
      ui.setMandatory(true);
    }
    return ui;
  }
View Full Code Here

  /**
   * @see org.olat.user.propertyhandlers.UserPropertyHandler#isValid(org.olat.core.gui.formelements.FormElement)
   */
  public boolean isValid(FormElement ui, Map formContext) {
   
    DateElement uiDate = (DateElement) ui;
   
    if (uiDate.getValue().length() == 0) {
      if (!ui.isMandatory()) return true;
      ui.setErrorKey(i18nFormElementLabelKey()+ ".error.empty");     
      return false;
    }
   
    return uiDate.validDate(i18nFormElementLabelKey()+ ".error");     
  }
View Full Code Here

TOP

Related Classes of org.olat.core.gui.formelements.DateElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.