Package org.olat.core.gui.formelements

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


    addFormElement("radio2", radio);

    // checkbox
    keys = new String[] { "1", "2", "3", "4" };
    lables = new String[] { "square", "circle", "rectangle", "triangle" };
    StaticMultipleSelectionElement checkbox = new StaticMultipleSelectionElement("guidemo.form.checkbox", keys, lables, true);
    addFormElement("checkbox", checkbox);
   
    spacer = new SpacerElement();
    addFormElement("spacer", spacer);
   
View Full Code Here


        translate(BlogFileResource.TYPE_NAME),
        translate(GlossaryResource.TYPE_NAME),
        translate(FileResource.GENERIC_TYPE_NAME)
    };

    types = new StaticMultipleSelectionElement("cif.type", keys, values, true);
    if (limitTypes != null) {
      // it is possible that limitTypes has one element with null value
      if (limitTypes[0] != null) {
        for (int i = 0; i < limitTypes.length; i++) {
          String limitType = limitTypes[i];
View Full Code Here

    // add a deleted dummy node at last position
    if (addDeletedNodeIdent) {
      nodeKeys[allNodesList.size()] = DELETED_NODE_IDENTIFYER;
      nodeValues[allNodesList.size()] = translate("scform.deletedNode");
    }
    StaticMultipleSelectionElement mse = new StaticMultipleSelectionElement(elemId, nodeKeys, nodeValues, false);
    // preselect nodes from configuration
    if (scoreCalculator != null && selectedNodeList != null) {
      for (Iterator iter = selectedNodeList.iterator(); iter.hasNext();) {
        String nodeIdent = (String) iter.next();
        boolean found = false;
        for (Iterator nodeIter = allNodesList.iterator(); nodeIter.hasNext();) {
          CourseNode node = (CourseNode) nodeIter.next();
          if (node.getIdent().equals(nodeIdent)) {
            found = true;
          }
        }
        if (found) {
          mse.select(nodeIdent, true);
        } else {
          mse.select(DELETED_NODE_IDENTIFYER, true);
        }
      }
    }   
    return mse;
  }
View Full Code Here

        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);
      String[] keysWaiting = new String[waitingListIdentities.size()];
      String[] valuesWaiting = new String[waitingListIdentities.size()];
      for (int i = 0; i < waitingListIdentities.size(); i++) {
        keysWaiting[i] = waitingListIdentities.get(i).getKey().toString();
        valuesWaiting[i] = waitingListIdentities.get(i).getName().toString();
      }
      multiSelectionWaitingKeys = new StaticMultipleSelectionElement(null, keysWaiting, valuesWaiting, waitingListIdentities.size()>0?true:false);
      // WaitingList is enabled => show checkbox
      addFormElement("radioButtonWaiting", radioButtonWaiting);
      addFormElement("multiSelectionWaitingKeys", multiSelectionWaitingKeys);
     
      // rule waitings
View Full Code Here

TOP

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

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.