Package org.olat.core.gui.formelements

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


   
    addListener(listeningController);

    String[] skipKeys = new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() };
    String[] skipValues = new String[] { translate("yes"), translate("no") };
    sendMailSwitchElem = new StaticSingleSelectionElement("mailtemplateform.sendMailSwitchElem", skipKeys, skipValues);
    sendMailSwitchElem.select(Boolean.TRUE.toString(), true);
    addFormElement("sendMailSwitchElem", sendMailSwitchElem);
    ccSender = new CheckBoxElement(NLS_CONTACT_SEND_CP_FROM, true);
    addFormElement("tcpfrom", ccSender);
    String value = template.getSubjectTemplate();
View Full Code Here


    addFormElement("s1", s1);
   
    // online time visible switch
    String[] onlineTimeSwitchKeys = new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() };
    String[] onlineTimeSwitchValues = new String[] { translate("yes"), translate("no") };
    onlineTimeSwitch = new StaticSingleSelectionElement("form.onlinetime", onlineTimeSwitchKeys, onlineTimeSwitchValues);
    if (imPrefs.isOnlineTimeVisible()) onlineTimeSwitch.select(Boolean.TRUE.toString(), true);
    else onlineTimeSwitch.select(Boolean.FALSE.toString(), true);   
    addFormElement(ONLINETIME, onlineTimeSwitch);
   
    SpacerElement s2 = new SpacerElement(true, false);
    addFormElement("s2", s2);
   
    // course name visible
    String[] courseNameSwitchKeys = new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() };
    String[] courseNameSwitchValues = new String[] { translate("yes"), translate("no") };
    courseNameSwitch = new StaticSingleSelectionElement("form.coursename", courseNameSwitchKeys, courseNameSwitchValues);
    if (imPrefs.isAwarenessVisible()) courseNameSwitch.select(Boolean.TRUE.toString(), true);
    else courseNameSwitch.select(Boolean.FALSE.toString(), true);
    addFormElement(COURSENAME, courseNameSwitch);
   
    SpacerElement s3 = new SpacerElement(true, false);
View Full Code Here

        "1000px", "1020px", "1040px", "1060px", "1080px",
        "1100px", "1120px", "1140px", "1160px", "1180px",
        "1200px", "1220px", "1240px", "1260px", "1280px",
        "1300px", "1320px", "1340px", "1360px", "1380px" };
   
    heightEl = new StaticSingleSelectionElement("height.label", keys, values);
    addFormElement("height", heightEl);
    // preselect given height. Check first if this height is selectable,
    // otherwhise just use the auto height (in case this list is modified somewhen later)
    if (Arrays.asList(keys).contains(height)) {
      heightEl.select(height, true);
View Full Code Here

      String[] scormModesKeys = new String[] {ScormConstants.SCORM_MODE_NORMAL, ScormConstants.SCORM_MODE_BROWSE, ScormConstants.SCORM_MODE_NOCREDIT};
      String[] scormModesValues = new String[] {
          translate("form.scormmode.normal"),
          translate("form.scormmode.browse"),
          translate("form.scormmode.nocredit")};
      addFormElement(SCORM_MODES, new StaticSingleSelectionElement("form.scormmode", scormModesKeys, scormModesValues));
    }
    setSubmitKey("command.showscorm");
  }
View Full Code Here

          translate("cif.access.owners"),
          translate("cif.access.owners_authors"),
          translate("cif.access.users"),
          translate("cif.access.users_guests"),
        };
      access = new StaticSingleSelectionElement("cif.access", keys, values);
      access.select("" + entry.getAccess(), true);
      addFormElement("cif_access", access)
   
   
    addSubmitKey("submit","submit");
View Full Code Here

    }

    // FIXME: remove "" and fix package...
    String[] values = new String[] { cc.getCssLayoutRef(), "" + translate("form.layout.setsystemcss") };
    String[] keys = new String[] { KEY_NO, KEY_YES };
    layout = new StaticSingleSelectionElement("form.layout.cssfile", keys, values);
    if (cc.hasCustomCourseCSS()) layout.select(KEY_NO, true);
    else layout.select(KEY_YES, true);
    addFormElement("layout", layout);

    String name;
    String softkey = cc.getSharedFolderSoftkey();

    RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(softkey, false);
    if (re == null) {
      cc.setSharedFolderSoftkey(CourseConfig.VALUE_EMPTY_SHAREDFOLDER_SOFTKEY);
      name = translate("sf.notconfigured");
    } else {
      name = re.getDisplayname();
    }
    String[] sfvalues = new String[] { name, translate("sf.notconfigured") };
    String[] sfkeys = new String[] { KEY_NO, KEY_YES };
    sfolder = new StaticSingleSelectionElement("sf.resourcetitle", sfkeys, sfvalues);
    if (cc.hasCustomSharedFolder()) sfolder.select(KEY_NO, true);
    else sfolder.select(KEY_YES, true);
    addFormElement("sfolder", sfolder);

    efficencyStatement = new CheckBoxElement("chkbx.efficency.onoff", cc.isEfficencyStatementEnabled());
    addFormElement("efficencyStatement", efficencyStatement);

    calendar = new CheckBoxElement("chkbx.calendar.onoff", cc.isCalendarEnabled());
    addFormElement("calendar", calendar);

   
    /*
     * glossary show name instead of check box OLAT-2126
     */
    String glossName;
    String glossSoftKey = cc.getGlossarySoftKey();
    re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(glossSoftKey, false);
    if (re == null) {
      glossName = translate("glossary.no.glossary");
    } else {
      glossName = re.getDisplayname();
    }
   
    String[] glovalues = new String[] { glossName, translate("glossary.no.glossary") };
    glossary = new StaticSingleSelectionElement("glossary.isconfigured", sfkeys, glovalues);
    if (cc.hasGlossary()) glossary.select(KEY_NO, true);
    else glossary.select(KEY_YES, true);
    addFormElement("glossary", glossary);
   
   
View Full Code Here

      for (int i = 0; i < writeableCalendars.size(); i++) {
        KalendarRenderWrapper cw = (KalendarRenderWrapper)writeableCalendars.get(i);
        calendarKeys[i] = cw.getKalendar().getCalendarID();
        calendarValues[i] = cw.getKalendarConfig().getDisplayName();
      }
      chooseCalendar = new StaticSingleSelectionElement("cal.form.chooseCalendar", calendarKeys, calendarValues);
      // preselect calendar if available
      chooseCalendar.select(choosenWrapper.getKalendar().getCalendarID(), true);
      addFormElement("cal.form.chooseCalendar", chooseCalendar);
    } else {
      // display calendar name
      calendarName = new StaticTextElement("cal.form.calendarname", choosenWrapper.getKalendarConfig().getDisplayName());
      addFormElement("cal.form.calendarname", calendarName);
    }
   
    // subject (hide if in readonly mode and only free/busy flag)
    subject = new TextAreaElement("cal.form.subject", 3, 40);
    subject.setMandatory(true);
    if (readOnly && event.getClassification() == KalendarEvent.CLASS_X_FREEBUSY) {
      subject.setValue(getTranslator().translate("cal.form.subject.hidden"));
    } else {
      subject.setValue(event.getSubject());
    }
    addFormElement("cal.form.subject", subject);
   
    // location (hide if in readonly mode and only free/busy flag)
    location = new TextAreaElement("cal.form.location", 3, 40);
    location.setMandatory(false);
    if (readOnly && event.getClassification() == KalendarEvent.CLASS_X_FREEBUSY) {
      location.setValue(getTranslator().translate("cal.form.location.hidden"));
    } else {
      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);
    rule = new VisibilityDependsOnSelectionRule(chooseRecurrence, recurrenceEnd, RECURRENCE_NONE, false, "", true);
    addVisibilityDependsOnSelectionRule(rule);
    addFormElement("spacer2", spacer);

    // classification
    String[] keys = new String[] {"0", "1", "2"};
    String[] values = new String[] {
        getTranslator().translate("cal.form.class.private"),
        getTranslator().translate("cal.form.class.freebusy"),
        getTranslator().translate("cal.form.class.public")
    };
   
    classification = new StaticSingleSelectionElement("cal.form.class", keys, values);
    switch (event.getClassification()) {
      case KalendarEvent.CLASS_PRIVATE: classification.select("0", true); break;
      case KalendarEvent.CLASS_X_FREEBUSY: classification.select("1", true); break;
      case KalendarEvent.CLASS_PUBLIC: classification.select("2", true); break;
      default: classification.select("0", true);
View Full Code Here

    addFormElement("link", link);
   
    // radio
    String[] keys = new String[] { "1", "2", "3", "4" };
    String[] lables = new String[] { "red", "green", "blue", "yellow" };
    StaticSingleSelectionElement pulldown = new StaticSingleSelectionElement("guidemo.form.pulldown", keys, lables);
    addFormElement("pulldown", pulldown);

    keys = new String[] { "1", "2" };
    lables = new String[] { "yes", "no" };
    RadioButtonGroupElement radio = new RadioButtonGroupElement(true, "guidemo.form.radio1", keys, lables);
View Full Code Here

      translator.translate("cif.access.owners"),
      translator.translate("cif.access.owners_authors"),
      translator.translate("cif.access.users"),
      translator.translate("cif.access.users_guests"),
    };
    access = new StaticSingleSelectionElement("access.form.label", keys, values);
    access.select("" + entry.getAccess(), true);
    addFormElement("cif_access", access)
   
   
    addSubmitKey("submit", "submit");
View Full Code Here

          translate("cif.access.owners"),
          translate("cif.access.owners_authors"),
          translate("cif.access.users"),
          translate("cif.access.users_guests"),
        };
      access = new StaticSingleSelectionElement("cif.access", keys, values);
      access.select("" + entry.getAccess(), true);
      addFormElement("cif_access", access)
    }
   
    addSubmitKey("submit", "submit");
View Full Code Here

TOP

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

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.