Package org.olat.core.gui.formelements

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


        renderTextElement(f, (TextElement) fe, sb, ubu);
      } else if (fe instanceof CheckBoxElement) {
        CheckBoxElement cbe = (CheckBoxElement) fe;
        renderCheckBox(f, cbe, sb, translator);
      } else if (fe instanceof RadioButtonGroupElement) {
        RadioButtonGroupElement rbe = (RadioButtonGroupElement) fe;
        renderRadioButtonGroup(f, rbe, translator, sb);
      } else if (fe instanceof SingleSelectionElement) {
        SingleSelectionElement se = (SingleSelectionElement) fe;
        renderDropDown(f, se, sb);
      } else if (fe instanceof MultipleSelectionElement) {
View Full Code Here


    super(name, translator);

    // on online user list visible 
    String[] ynKeys = new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() };
    String[] ynValue = new String[] { translate("yes"), translate("no") };
    toogleVisibility = new RadioButtonGroupElement(false, "form.onlinelist", ynKeys, ynValue);
    if (imPrefs.isVisibleToOthers()) toogleVisibility.select(Boolean.TRUE.toString(), true);
    else toogleVisibility.select(Boolean.FALSE.toString(), true);
    addFormElement(ONLINELIST, toogleVisibility);
   
    SpacerElement s1 = new SpacerElement(true, false);
View Full Code Here

            translate("presence.away"),
            translate("presence.xa"),
            translate("presence.dnd"),
            translate("presence.unavailable")};
   
    statusList = new RadioButtonGroupElement(true, "form.defaultstatus", keys, values);
    statusList.select(imPrefs.getRosterDefaultStatus(), true);
    addFormElement(STATUSLIST, statusList);
     
    addSubmitKey("save","save");
    setCancelButton();
View Full Code Here

    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);
    radio.select("1", true);
    addFormElement("radio1", radio);
   
    keys = new String[] { "1", "2" };
    lables = new String[] { "yes", "no" };
    radio = new RadioButtonGroupElement(false, "guidemo.form.radio2", keys, lables);
    radio.select("2", true);
    addFormElement("radio2", radio);

    // checkbox
    keys = new String[] { "1", "2", "3", "4" };
    lables = new String[] { "square", "circle", "rectangle", "triangle" };
View Full Code Here

        Boolean.FALSE.toString()};
    String[] values = new String[] {
        translate("yes"),
        translate("no")};

    allowRelativeLinks = new RadioButtonGroupElement(true, "allowRelativeLinks", keys, values);
    if (allowRelativeLinksConfig != null && allowRelativeLinksConfig.booleanValue()) {
      allowRelativeLinks.select(Boolean.TRUE.toString(), true);
    } else {
      allowRelativeLinks.select(Boolean.FALSE.toString(), true);
    }
View Full Code Here

    // create chooser and add to form
    String[] keys = new String[] { KEY_START_WIZARD, KEY_START_WIZARD_ESEM, KEY_COURSE_EDIT, KEY_DETAILS_VIEW };
    String[] labels = new String[] { translator.translate("csc.startwizard"), translator.translate("cwc.linklistwizard"), translator.translate("csc.courseedit"),
        translator.translate("csc.detailsview") };
    chooser = new RadioButtonGroupElement(true, "csc.label", keys, labels);
    chooser.select(KEY_START_WIZARD, true);
    addFormElement("checkbox", chooser);

    // add submit and cancel buttons
    addSubmitKey("cmd.forward");
View Full Code Here

    } else {
      keys = new String[] { KEY_START_WIZARD, KEY_START_WIZARD_ESEM, KEY_COURSE_EDIT, KEY_DETAILS_VIEW };
      labels = new String[] { translator.translate("csc.startwizard"), translator.translate("cwc.linklistwizard"), translator.translate("csc.courseedit"),
        translator.translate("csc.detailsview") };
    }
    chooser = new RadioButtonGroupElement(true, "csc.label", keys, labels);
    chooser.select(keys[0], true);
    addFormElement("checkbox", chooser);

    // add submit and cancel buttons
    addSubmitKey("cmd.forward");
View Full Code Here

    };
    StaticHTMLTextElement expl = new StaticHTMLTextElement(NLS_DESCRIPTION_LABEL, translate(NLS_DESCRIPTION_PREAMBLE), 32600);
    addFormElement("expl", expl);
   
    String loadedConfig = convertConfigToNewStyle(config);
    selectables = new RadioButtonGroupElement(true, NLS_DISPLAY_CONFIG_EXTERN, selectableValues, selectableLabels);
    selectables.select(loadedConfig, true);
    selectables.setNoLabel(true);
    selectables.setHTMLIsAllowed(true);
    addFormElement("selectables",  selectables);
    addFormElement("s3", new SpacerElement(false, true));
View Full Code Here

    if (!isRightGroup()) {
      if (isMultiSelectionOwnerKeys()) {
        String[] radioKeysOwners = { NLS_RADIO_ALL, NLS_RADIO_NOTHING, NLS_RADIO_CHOOSE };
        String[] radioValuesOwners = { translator.translate("sendtochooser.form.radio.owners.all"),
            translator.translate("sendtochooser.form.radio.owners.nothing"), translator.translate("sendtochooser.form.radio.owners.choose") };
        radioButtonOwner = new RadioButtonGroupElement(true, "sendtochooser.form.radio.owners", radioKeysOwners, radioValuesOwners);
        radioButtonOwner.select(NLS_RADIO_ALL, true);

        // Owner MultiSelection
        SecurityGroup owners = businessGroup.getOwnerGroup();
        List<Identity> ownerList = scrtMngr.getIdentitiesOfSecurityGroup(owners);
        String[] keysOwner = new String[ownerList.size()];
        String[] valuesOwner = new String[ownerList.size()];
        for (int i = 0; i < ownerList.size(); i++) {
          keysOwner[i] = ownerList.get(i).getKey().toString();
          valuesOwner[i] = ownerList.get(i).getName().toString();
        }
        multiSelectionOwnerKeys = new StaticMultipleSelectionElement(null, keysOwner, valuesOwner, ownerList.size() > 0 ? true : false);

        addFormElement("radioButtonOwner", radioButtonOwner);
        addFormElement("multiSelectionOwnerKeys", multiSelectionOwnerKeys);

        // rule owner
        rule = new VisibilityDependsOnSelectionRule(radioButtonOwner, multiSelectionOwnerKeys, "choose", true, null, true);
        addVisibilityDependsOnSelectionRule(rule);
      } else {
        String[] radioKeysOwners = { NLS_RADIO_ALL, NLS_RADIO_NOTHING };
        String[] radioValuesOwners = { translator.translate("sendtochooser.form.radio.owners.all"),
            translator.translate("sendtochooser.form.radio.owners.nothing") };
        radioButtonOwner = new RadioButtonGroupElement(true, "sendtochooser.form.radio.owners", radioKeysOwners, radioValuesOwners);
        radioButtonOwner.select(NLS_RADIO_ALL, true);

        addFormElement("radioButtonOwner", radioButtonOwner);
      }
    }
    if (isMultiSelectionPartipKeys()) {
      if (isRightGroup()) {
        String[] radioKeysPartip = { NLS_RADIO_ALL, NLS_RADIO_CHOOSE };
        String[] radioValuesPartip = { translator.translate("sendtochooser.form.radio.partip.rightgroup.all"), translator.translate("sendtochooser.form.radio.partip.rightgroup.choose") };
        radioButtonPartip = new RadioButtonGroupElement(true, "sendtochooser.form.radio.rightgroup", radioKeysPartip, radioValuesPartip);
        radioButtonPartip.select(NLS_RADIO_ALL, true);
        // Participator MultiSelection
        SecurityGroup participants = businessGroup.getPartipiciantGroup();
        List<Identity> participantsList = scrtMngr.getIdentitiesOfSecurityGroup(participants);
        String[] keysPartip = new String[participantsList.size()];
        String[] valuesPartip = new String[participantsList.size()];
        for (int i = 0; i < participantsList.size(); i++) {
          keysPartip[i] = participantsList.get(i).getKey().toString();
          valuesPartip[i] = participantsList.get(i).getName().toString();
        }
        multiSelectionPartipKeys = new StaticMultipleSelectionElement(null, keysPartip, valuesPartip, participantsList.size() > 0 ? true
            : false);
        addFormElement("radioButtonPartip", radioButtonPartip);
        addFormElement("multiSelectionPartipKeys", multiSelectionPartipKeys);
        // rule partips
        rule = new VisibilityDependsOnSelectionRule(radioButtonPartip, multiSelectionPartipKeys, "choose", true, null, true);
        addVisibilityDependsOnSelectionRule(rule);
      } else {
        String[] radioKeysPartip = { NLS_RADIO_ALL, NLS_RADIO_NOTHING, NLS_RADIO_CHOOSE };
        String[] radioValuesPartip = { translator.translate("sendtochooser.form.radio.partip.all"),
            translator.translate("sendtochooser.form.radio.partip.nothing"), translator.translate("sendtochooser.form.radio.partip.choose") };
        radioButtonPartip = new RadioButtonGroupElement(true, "sendtochooser.form.radio.partip", radioKeysPartip, radioValuesPartip);
        radioButtonPartip.select(NLS_RADIO_ALL, true);
        // Participator MultiSelection
        SecurityGroup participants = businessGroup.getPartipiciantGroup();
        List<Identity> participantsList = scrtMngr.getIdentitiesOfSecurityGroup(participants);
        String[] keysPartip = new String[participantsList.size()];
        String[] valuesPartip = new String[participantsList.size()];
        for (int i = 0; i < participantsList.size(); i++) {
          keysPartip[i] = participantsList.get(i).getKey().toString();
          valuesPartip[i] = participantsList.get(i).getName().toString();
        }
        multiSelectionPartipKeys = new StaticMultipleSelectionElement(null, keysPartip, valuesPartip, participantsList.size() > 0 ? true
            : false);
        addFormElement("radioButtonPartip", radioButtonPartip);
        addFormElement("multiSelectionPartipKeys", multiSelectionPartipKeys);
        // rule partips
        rule = new VisibilityDependsOnSelectionRule(radioButtonPartip, multiSelectionPartipKeys, "choose", true, null, true);
        addVisibilityDependsOnSelectionRule(rule);
      }
    } else {
      if (isRightGroup()) {
        String[] radioKeysPartip = { NLS_RADIO_ALL };
        String[] radioValuesPartip = { translator.translate("sendtochooser.form.radio.partip.all.rightgroup") };
        radioButtonPartip = new RadioButtonGroupElement(true, "sendtochooser.form.radio.partip.rightgroup", radioKeysPartip, radioValuesPartip);
        radioButtonPartip.select(NLS_RADIO_ALL, true);
        addFormElement("radioButtonPartip", radioButtonPartip);
      } else {
        String[] radioKeysPartip = { NLS_RADIO_ALL, NLS_RADIO_NOTHING };
        String[] radioValuesPartip = { translator.translate("sendtochooser.form.radio.partip.all"),
            translator.translate("sendtochooser.form.radio.partip.nothing") };
        radioButtonPartip = new RadioButtonGroupElement(true, "sendtochooser.form.radio.partip", radioKeysPartip, radioValuesPartip);
        radioButtonPartip.select(NLS_RADIO_ALL, true);
        addFormElement("radioButtonPartip", radioButtonPartip);
      }
    }   

    if ( isAdmin && businessGroup.getWaitingListEnabled().booleanValue()) {
      String[] radioKeysWaitings = { NLS_RADIO_ALL, NLS_RADIO_NOTHING, NLS_RADIO_CHOOSE };
      String[] radioValuesWaitings = {translator.translate("sendtochooser.form.radio.waitings.all"), translator.translate("sendtochooser.form.radio.waitings.nothing"), translator.translate("sendtochooser.form.radio.waitings.choose")};
      radioButtonWaiting = new RadioButtonGroupElement(true, "sendtochooser.form.radio.waitings", radioKeysWaitings, radioValuesWaitings);
      radioButtonWaiting.select(NLS_RADIO_ALL, true);
     
      // Waitings MultiSelection
      SecurityGroup waitingList = businessGroup.getWaitingGroup();
      List<Identity> waitingListIdentities = scrtMngr.getIdentitiesOfSecurityGroup(waitingList);
View Full Code Here

    addFormElement("addsepval", idata);
   
    String[] keys = new String[] {"tab","comma"};
    String[] values = new String[] {translate("form.step1.delimiter.tab"),translate("form.step1.delimiter.comma")};
   
    delimiter = new RadioButtonGroupElement(true, "form.step1.delimiter", keys, values);
    delimiter.select("tab", true);
    addFormElement("delimiter", delimiter);

    addSubmitKey("next"); // wizard style
  }
View Full Code Here

TOP

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

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.