Package org.olat.core.gui.components.form.flexible.impl

Examples of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer


    }
   
    @Override
    protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {       
     
      FormLayoutContainer horizontalLayout = FormLayoutContainer.createHorizontalFormLayout("itemLayout", getTranslator());
      formLayout.add(horizontalLayout);
      textElement = uifactory.addTextElement("fileName", "zip.name", 20, "", horizontalLayout);
      textElement.setMandatory(true);     
      uifactory.addStaticTextElement("extension", null, translate("zip.extension"), horizontalLayout);
     
      FormLayoutContainer formButtons = FormLayoutContainer.createHorizontalFormLayout("formButton", getTranslator());
      formLayout.add(formButtons);
      createFile = new FormSubmit("submit","zip.button");
      formButtons.add(createFile);
      reset = new FormReset("reset","cancel");
      formButtons.add(reset);     
   
View Full Code Here


      buttons = FormLayoutContainer.createDefaultFormLayout("buttons", getTranslator());
    } else {
      buttons = FormLayoutContainer.createVerticalFormLayout("buttons", getTranslator());     
    }
    formLayout.add(buttons);
    FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
    buttons.add(buttonGroupLayout);
    uifactory.addFormSubmitButton("ul.upload", buttonGroupLayout);
    uifactory.addFormCancelButton("cancel", buttonGroupLayout, ureq, getWindowControl());
  }
View Full Code Here

    String[] csKeys = StringHelper.getMapKeysAsStringArray(charsets);
    charset = uifactory.addDropdownSingleselect("form.charset", formLayout, csKeys, csKeys, null);
    charset.select(currentCharset, true);

    // Submit and cancel buttons
    final FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("button_layout", getTranslator());
    formLayout.add(buttonLayout);
    uifactory.addFormSubmitButton("submit", buttonLayout);
    uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
  }
View Full Code Here

  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("pwdav.title");
   
    if(formLayout instanceof FormLayoutContainer) {
      FormLayoutContainer layoutContainer = (FormLayoutContainer)formLayout;
      layoutContainer.contextPut("webdavLink", FolderManager.getWebDAVLink());
     
      accessDataFlc = FormLayoutContainer.createDefaultFormLayout("flc_access_data", getTranslator());
      layoutContainer.add(accessDataFlc);
      uifactory.addStaticTextElement("pwdav.username", "pwdav.username", ureq.getIdentity().getName(), accessDataFlc);

      boolean hasOlatToken = false;
      boolean hasWebDAVToken = false;
      List<Authentication> authentications = ManagerFactory.getManager().getAuthentications(ureq.getIdentity());
      for(Authentication auth : authentications) {
        if(OLATAuthenticationController.PROVIDER_OLAT.equals(auth.getProvider())) {
          hasOlatToken = true;
        } else if(WebDAVAuthManager.PROVIDER_WEBDAV.equals(auth.getProvider())) {
          hasWebDAVToken = true;
        }
      }
     
      if(hasOlatToken) {
        String passwordPlaceholder = getTranslator().translate("pwdav.password.placeholder");
        uifactory.addStaticTextElement("pwdav.password", "pwdav.password", passwordPlaceholder, accessDataFlc);
      } else {
        String passwordPlaceholderKey = hasWebDAVToken ? "pwdav.password.set" : "pwdav.password.not_set";
        String passwordPlaceholder = getTranslator().translate(passwordPlaceholderKey);
        passwordStaticEl = uifactory.addStaticTextElement("pwdav.password", "pwdav.password", passwordPlaceholder, accessDataFlc);

        passwordEl = uifactory.addPasswordElement("pwdav.password.2", "pwdav.password", 64, "", accessDataFlc);
        passwordEl.setVisible(false);
        passwordEl.setMandatory(true);
        confirmPasswordEl = uifactory.addPasswordElement("pwdav.password.confirm", "pwdav.password.confirm", 64, "", accessDataFlc);
        confirmPasswordEl.setVisible(false);
        confirmPasswordEl.setMandatory(true);

        buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
        buttonGroupLayout.setRootForm(mainForm);
        accessDataFlc.add(buttonGroupLayout);
       
        if(hasWebDAVToken) {
          newButton = uifactory.addFormLink("pwdav.password.change", buttonGroupLayout, Link.BUTTON);
        } else {
          newButton = uifactory.addFormLink("pwdav.password.new", buttonGroupLayout, Link.BUTTON);
        }
        saveButton = uifactory.addFormSubmitButton("save", buttonGroupLayout);
        saveButton.setVisible(false);
        cancelButton = uifactory.addFormCancelButton("cancel", buttonGroupLayout, ureq, getWindowControl());
        cancelButton.setVisible(false);
      }
     
      layoutContainer.put("access_data", accessDataFlc.getComponent());
    }
  }
View Full Code Here

    if (!(forumCallback.mayEditMessageAsModerator() && message.getParent() == null)) {
      stickyCheckBox.setVisible(false);
    }

    // save and cancel buttons
    FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    formLayout.add(buttonLayout);
    uifactory.addFormSubmitButton("msg.save", buttonLayout);
    uifactory.addFormCancelButton("msg.cancel", buttonLayout, ureq, getWindowControl());

    // show message replying to, if in reply modus
    if (editMode.equals(EDITMODE_REPLYMSG)) {
      FormLayoutContainer replyMsgLayout = FormLayoutContainer.createCustomFormLayout("replyMsg", getTranslator(), Util
          .getPackageVelocityRoot(this.getClass())
          + "/msg-preview.html");
      uifactory.addSpacerElement("spacer1", formLayout, false);
      formLayout.add(replyMsgLayout);
      replyMsgLayout.setLabel("label.replytomsg", new String[] { replyMessage.getTitle() });
      Identity identity = replyMessage.getCreator();
      replyMsgLayout.contextPut("identity", identity);
      replyMsgLayout.contextPut("messageBody", replyMessage.getBody());
      replyMsgLayout.contextPut("message", replyMessage);
      portraitCtr = new DisplayPortraitController(ureq, getWindowControl(), identity, true, true);
      replyMsgLayout.put("portrait", portraitCtr.getInitialComponent());
    }

  }
View Full Code Here

          /*
           * create error with link to fix it
           */
          String vc_errorPage = velocity_root + "/erroritem.html";
          FormLayoutContainer errorGroupItemLayout = (FormLayoutContainer) FormLayoutContainer.createCustomFormLayout("errorgroupitem",
              getTranslator(), vc_errorPage);

          boolean hasDefaultContext = getDefaultBGContext() != null;
          if (hasDefaultContext) {
            groupChooseSubContainer.setErrorComponent(errorGroupItemLayout, this.flc);
            // FIXING LINK ONLY IF A DEFAULTCONTEXT EXISTS
            fixGroupError = new FormLinkImpl("error.fix", "create");
            // link
            fixGroupError.setCustomEnabledLinkCSS("b_button");
            errorGroupItemLayout.add(fixGroupError);

            fixGroupError.setErrorKey(labelKey, params);
            fixGroupError.showError(true);
            fixGroupError.showLabel(false);
            // hinty to pass the information if one group is
            // missing or if 2 or more groups are missing
            // (see fixGroupErrer.getUserObject to understand)
            // e.g. if userobject String[].lenght == 1 -> one group only
            // String[].lenght > 1 -> show bulkmode creation group
            if (missingGroups.size() > 1) {
              fixGroupError.setUserObject(new String[] { csvMissGrps, "dummy" });
            } else {
              fixGroupError.setUserObject(new String[] { csvMissGrps });
            }
          } else {
            // fix helper link not possible -> errortext only
            groupChooseSubContainer.setErrorKey(labelKey, params);
          }
          /*
           *
           */
          groupChooseSubContainer.showError(true);
        } else {
          // no more errors
          groupChooseSubContainer.clearError();
        }
      }
      if (!easyAreaTE.isEmpty()) {
        // check whether areas exist
        activeAreaSelection = easyAreaTE.getValue().split(",");
        boolean exists = false;
        Set<String> missingAreas = new HashSet<String>();
        for (int i = 0; i < activeAreaSelection.length; i++) {
          String trimmed = activeAreaSelection[i].trim();
          exists = courseEditorEnv.existsArea(trimmed);
          if (!exists) {
            missingAreas.add(trimmed);
          }
        }
        if (missingAreas.size() > 0) {
          retVal = false;
          String labelKey = missingAreas.size() == 1 ? "error.notfound.name" : "error.notfound.names";
          String csvMissAreas = StringHelper.formatAsCSVString(missingAreas);
          String[] params = new String[] { "-", csvMissAreas };

          /*
           * create error with link to fix it
           */
          String vc_errorPage = velocity_root + "/erroritem.html";
          FormLayoutContainer errorAreaItemLayout = (FormLayoutContainer) FormLayoutContainer.createCustomFormLayout("errorareaitem",
              getTranslator(), vc_errorPage);
          boolean hasDefaultContext = getDefaultBGContext() != null;
          if (hasDefaultContext) {
            areaChooseSubContainer.setErrorComponent(errorAreaItemLayout, this.flc);
            // FXINGIN LINK ONLY IF DEFAULT CONTEXT EXISTS
            fixAreaError = new FormLinkImpl("error.fix", "create");// erstellen
            // link
            fixAreaError.setCustomEnabledLinkCSS("b_button");
            errorAreaItemLayout.add(fixAreaError);

            fixAreaError.setErrorKey(labelKey, params);
            fixAreaError.showError(true);
            fixAreaError.showLabel(false);
            // hint to pass the information if one area is
View Full Code Here

      final Collator c = Collator.getInstance(getLocale());
      public int compare(final Object o1, final Object o2) {
        return c.compare(((VFSItem)o1).getName(), ((VFSItem)o2).getName());
      }});   
   
    FormLayoutContainer tmpLayout;
    if (attachLayout == null) {
      tmpLayout = FormLayoutContainer.createCustomFormLayout("attachLayout", getTranslator(), Util.getPackageVelocityRoot(this.getClass())
          + "/attachments-editview.html");
      formLayout.add(tmpLayout);
    } else {
      tmpLayout = (FormLayoutContainer) attachLayout;
    }
    tmpLayout.contextPut("attachments", attachments);
    tmpLayout.contextPut("myself", this);

    // add delete links for each attachment if user is allowed to see them
    int attNr = 1;
    for (Iterator<VFSItem> iterator = attachments.iterator(); iterator.hasNext();) {
      VFSItem tmpFile = iterator.next();
View Full Code Here

    sdate.setExampleKey("form.easy.example.bdate", null);
    sdate.setDateChooserDateFormat("%d.%m.%Y %H:%M");
    sdate.setDateChooserTimeEnabled(true);
    sdate.setMandatory(true);
   
    FormLayoutContainer groupLayout = FormLayoutContainer.createHorizontalFormLayout("groupChooser", getTranslator());
    groupLayout.setLabel("form.group", null);
    formLayout.add(groupLayout);
    group = uifactory.addTextElement("group", null, 255, "", groupLayout);
    groupChooserLink = uifactory.addFormLink("choose", groupLayout,"b_form_genericchooser");
 
   
    FormLayoutContainer areaLayout = FormLayoutContainer.createHorizontalFormLayout("areaChooser", getTranslator());
    areaLayout.setLabel("form.area", null);
    formLayout.add(areaLayout);
    area = uifactory.addTextElement("area", null, 255, "", areaLayout);
    areaChooserLink = uifactory.addFormLink("choose", areaLayout,"b_form_genericchooser");
   
   
    String[] keys = {
        ROLE_STUDENT,
        ROLE_GUEST,
        ROLE_COURSECOACH,
        ROLE_COURSEADMIN,
        ROLE_GLOBALAUTHOR
    };
    String[] values = new String[keys.length];
    for (int i = 0; i < keys.length; i++) {
      values[i]=translate(keys[i]);
    }
    roles = uifactory.addRadiosVertical("roles", "form.roles", formLayout, keys, values);
    roles.select(ROLE_STUDENT, true);
   
    FormLayoutContainer attrlayout = FormLayoutContainer.createVerticalFormLayout("attributes", getTranslator());
    formLayout.add(attrlayout);
    attrlayout.setLabel("form.attributes", null);
       
    for (int i=0; i<NUMATTR; i++) {
      FormLayoutContainer attrgrp = FormLayoutContainer.createHorizontalFormLayout("attrgrp"+i, getTranslator());
      attrlayout.add(attrgrp);

      TextElement name = uifactory.addTextElement("attrname"+i, null, 255, "", attrgrp);
      name.setDisplaySize(12);
      TextElement value = uifactory.addTextElement("attrvalue"+i, "form.equals", 255, "", attrgrp);
View Full Code Here

    initForm(ureq);   
  }
 
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FormLayoutContainer verticalL = FormLayoutContainer.createVerticalFormLayout("verticalL", getTranslator());
    formLayout.add(verticalL);
    loops = uifactory.addIntegerElement("loops.dirs", "filesystemtest.loops.label", 1, verticalL);
    maxNbrDirs = uifactory.addIntegerElement("maxnbr.dirs", "filesystemtest.maxnbr.dirs.label", 100, verticalL);
    maxNbrFiles = uifactory.addIntegerElement("maxnbr.files", "filesystemtest.maxnbr.files.label", 100, verticalL);
    nbrCharInFile = uifactory.addIntegerElement("nbr.char.in.file", "filesystemtest.nbrCharInFile.label", 100, verticalL);
View Full Code Here

    InstantMessagingModule.setIDLE_POLLTIME(idlePollTime.getIntValue());
  }

  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FormLayoutContainer mainLayout = FormLayoutContainer.createDefaultFormLayout("mainLayout", getTranslator());
    formLayout.add(mainLayout);
   
    String imServerName = InstantMessagingModule.getAdapter().getConfig().getServername();
    String imAdminUsername = InstantMessagingModule.getAdapter().getConfig().getAdminUsername();
    String imAdminPw = InstantMessagingModule.getAdapter().getConfig().getAdminPassword();
   
   
    flc.contextPut("IMServerAdminGUI", imServerName);
    flc.contextPut("IMServerAdminUsername", imAdminUsername);
    flc.contextPut("IMServerAdminPw", imAdminPw);
   
   
    checkPlugin = new FormLinkImpl("imadmin.plugin.check");
    checkPlugin.setCustomEnabledLinkCSS("b_button");
    formLayout.add(checkPlugin);
   
    reconnectAdminUser = new FormLinkImpl("imadmin.plugin.admin.reconnect");
    reconnectAdminUser.setCustomEnabledLinkCSS("b_button");
    formLayout.add(reconnectAdminUser);
   
   
    //doSyncButton = LinkFactory.createButton("imadmin.sync.cmd.dosync", imAdminVC, this);
    doSyncButton = new FormLinkImpl("imadmin.sync.cmd.dosync");
    doSyncButton.setCustomEnabledLinkCSS("b_button");
    doSyncButton.setCustomDisabledLinkCSS("b_button b_button_disabled");
    formLayout.add(doSyncButton);
   
    idlePollTime = uifactory.addIntegerElement("idlepolltime", "imadming.idlepolltime", InstantMessagingModule.getIDLE_POLLTIME(), mainLayout);
    idlePollTime.setExampleKey("imadming.idlepolltime.default", new String[]{""+InstantMessagingModule.getAdapter().getConfig().getIdlePolltime()});
    idlePollTime.showExample(true);
   
    chatPollTime = uifactory.addIntegerElement("chatpolltime", "imadming.chatpolltime", InstantMessagingModule.getCHAT_POLLTIME(), mainLayout);
    chatPollTime.setExampleKey("imadming.chatpolltime.default", new String[]{""+InstantMessagingModule.getAdapter().getConfig().getChatPolltime()});
    chatPollTime.showExample(true);
   
    submit = new FormSubmit("subm","submit");
   
    mainLayout.add(idlePollTime);
    mainLayout.add(chatPollTime);
    mainLayout.add(submit);
   
  }
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer

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.