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

Examples of org.olat.core.gui.components.form.flexible.FormItemContainer


    formLayout.add(allTranslateButton);
  }

  private void initSearchItemsElements(FormUIFactory formFactory, I18nManager i18nMgr, Controller listener, FormItemContainer formLayout,
      String[] bundlesKeys, String[] bundlesValues) {
    FormItemContainer searchLayoutContainer = (FormItemContainer) FormLayoutContainer.createDefaultFormLayout("searchLayoutContainer",
        getTranslator());
    formLayout.add(searchLayoutContainer);
    // Add search input field
    searchInput = formFactory.addTextElement("searchInput", "start.search.input", 100, "", searchLayoutContainer);
    // Add search selecton for searching in keys or values
    String[] searchKeyValueKeys = new String[] { KEYS_KEY, KEYS_VALUE };
    String[] searchKeyValueValues = new String[] { translate("generic.key"), translate("generic.value") };
    searchKeyValueSelection = formFactory.addRadiosHorizontal("searchKeyValueSelection","start.search.in", searchLayoutContainer, searchKeyValueKeys,
        searchKeyValueValues);
    searchKeyValueSelection.select(KEYS_VALUE, true);
    // Add search selecton for reference or target search
    String[] searchReferenceTargetKeys = new String[] { KEYS_REFERENCE, KEYS_TARGET };
    String[] searchReferenceTargetValues;
    if (customizingMode) {
      searchReferenceTargetValues = new String[] { translate("generic.customize.lang.reference"), translate("generic.customize.lang.target") };           
    } else {
      searchReferenceTargetValues = new String[] { translate("generic.lang.reference"), translate("generic.lang.target") };     
    }     
    searchReferenceTargetSelection = formFactory.addRadiosHorizontal("searchReferenceTargetSelection", "start.search.in",searchLayoutContainer,
        searchReferenceTargetKeys, searchReferenceTargetValues);
    searchReferenceTargetSelection.select(KEYS_TARGET, true);
    // Add search bundles selector : reuse keys from above
    searchBundlesSelection = formFactory.addDropdownSingleselect("searchBundlesSelection", searchLayoutContainer, bundlesKeys,
        bundlesValues, null);
    searchBundlesSelection.setLabel("generic.limit.bundles", null);
    searchBundlesSelection.addActionListener(this, FormEvent.ONCHANGE);
    searchBundlesSelection.select(ALL_BUNDLES_IDENTIFYER, true);
    // Add search bundles children switch
    searchBundlesIncludeBundlesChildrenSwitch = formFactory.addCheckboxesHorizontal("searchBundlesIncludeBundlesChildrenSwitch",
        "generic.limit.bundles.includeChildren", searchLayoutContainer, new String[] { KEYS_ENABLED }, new String[] { KEYS_EMPTY }, null);
    searchBundlesIncludeBundlesChildrenSwitch.select(KEYS_ENABLED, true);
    searchBundlesIncludeBundlesChildrenSwitch.addActionListener(listener, FormEvent.ONCLICK);
    searchBundlesIncludeBundlesChildrenSwitch.setEnabled(false);
    // Add priority sort switch
    searchBundlesPrioritySortSwitch = formFactory.addCheckboxesHorizontal("searchBundlesPrioritySortSwitch", "generic.sort.by.priority",
        searchLayoutContainer, new String[] { KEYS_ENABLED }, new String[] { KEYS_EMPTY }, null);
    searchBundlesPrioritySortSwitch.select(KEYS_ENABLED, true);
    searchBundlesPrioritySortSwitch.addActionListener(listener, FormEvent.ONCLICK);
    formLayout.add(searchBundlesPrioritySortSwitch);
    // Add button to trigger search
    FormItemContainer searchButtonLayoutContainer = (FormItemContainer) FormLayoutContainer.createHorizontalFormLayout(
        "searchButtonLayoutContainer", getTranslator());
    searchLayoutContainer.add(searchButtonLayoutContainer);
    searchListButton = new FormLinkImpl("searchListButton", "searchListButton", "generic.listButton", Link.BUTTON);
    searchButtonLayoutContainer.add(searchListButton);
    searchTranslateButton = new FormLinkImpl("searchTranslateButton", "searchTranslateButton", "generic.translateButton", Link.BUTTON);
    searchButtonLayoutContainer.add(searchTranslateButton);
  }
View Full Code Here


      return parentContainer;
    }
   
    public boolean visit(FormItem comp, UserRequest ureq) {
      if (comp instanceof FormItemContainer) {
        FormItemContainer new_name = (FormItemContainer) comp;
        if(new_name.getFormComponents().containsValue(child)){
          parentContainer = (FormItemContainer)comp;
          return false;
        }
      }
      return true;
View Full Code Here

  private class FormDependencyRulesInitComponentVisitor implements FormComponentVisitor {

    public boolean visit(FormItem comp, UserRequest ureq) {
      if (comp instanceof FormItemContainer) {
        FormItemContainer fic = (FormItemContainer)comp;
        Map<String, FormItem> pairs = fic.getFormComponents();
        //go to next container if no elements inside
        if(pairs == null || pairs.size()==0) return true;
        //otherwise iterate overall elements and evaluate dependency rules
        Iterable<FormItem> elms= pairs.values();
        for (FormItem item : elms) {
          fic.evalDependencyRuleSetFor(ureq, item);
        }
      }
      return true;
    }
View Full Code Here

  private void doVisit(FormItem node, UserRequest ureq) {
    if (!visitChildrenFirst) {
      if (!v.visit(node, ureq)) return;
    }
    if (node instanceof FormItemContainer) { // visit children
      FormItemContainer co = (FormItemContainer) node;
      Map<String, FormItem> children = co.getFormComponents();
      Set<FormItem> formItems = new HashSet<FormItem>(children.values());
      for (Iterator<FormItem> iter = formItems.iterator(); iter.hasNext();) {
        doVisit(iter.next(), ureq);
      }
    }
View Full Code Here

    // Trigger fieldset and title
    setFormTitle("ul.header");
   
    this.flc.contextPut("showMetadata", showMetadata);
    // Add file element
    FormItemContainer fileUpload;
    // the layout of the file upload depends on the metadata. if they're
    // shown, align the file upload element
    if (showMetadata) {
      fileUpload = FormLayoutContainer.createDefaultFormLayout(
          "file_upload", getTranslator());
    } else {
      fileUpload = FormLayoutContainer.createVerticalFormLayout("file_upload", getTranslator());     
    }
    formLayout.add(fileUpload);
    //
    fileEl = uifactory.addFileElement("fileEl", "ul.file", fileUpload);
    setMaxUploadSizeKB(this.uploadLimitKB);
    fileEl.setMandatory(true, "NoFileChoosen");
    if (mimeTypes != null && mimeTypes.size() > 0) {
      fileEl.limitToMimeType(mimeTypes, "WrongMimeType", new String[]{mimeTypes.toString()});         
    }
    // Check remaining quota
    if (remainingQuotKB == 0) {
      fileEl.setEnabled(false);
      fileEl.setErrorKey("QuotaExceeded", null);
    }
    //
    // Add path element
    if (showTargetPath) {     
      String path = "/ " + uploadVFSContainer.getName();
      VFSContainer container = uploadVFSContainer.getParentContainer();
      while (container != null) {
        path = "/ " + container.getName() + " " + path;
        container = container.getParentContainer();
      }
      pathEl = uifactory.addStaticTextElement("ul.target", path,fileUpload);
    }
   
    if (showMetadata) {
      metaDataCtr = new MetaInfoFormController(ureq, getWindowControl(),
          mainForm);
      formLayout.add("metadata", metaDataCtr.getFormItem());
      listenTo(metaDataCtr);
    }
    //
    // Add cancel and submit in button group layout
    FormItemContainer buttons;
    if (showMetadata) {
      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

    @Override
    @SuppressWarnings("unused")
    protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
      PackageTranslator pt = (PackageTranslator) Util.createPackageTranslator(PropPupForm.class, getLocale(), getTranslator());
     
      FormItemContainer fic = FormLayoutContainer.createCustomFormLayout("access", pt, this.velocity_root+"/publish_courseaccess.html");
      formLayout.add(fic);
      String[] keys = new String[] {
          "" + RepositoryEntry.ACC_OWNERS,
          "" + RepositoryEntry.ACC_OWNERS_AUTHORS,
          "" + RepositoryEntry.ACC_USERS,
View Full Code Here

      Set<FormItem> targets;
      // Main layout is a vertical layout without left side padding. To format
      // the checkboxes properly we need a default layout for the remaining form
      // elements
      FormItemContainer innerFormLayout = FormLayoutContainer.createDefaultFormLayout("innerFormLayout", getTranslator());
      formLayout.add(innerFormLayout);

      // add input field for password
      Map configuration = BaseSecurityModule.getConfiguration();
      Boolean canChangePwd = (Boolean) configuration.get(BaseSecurityModule.CONFIG_USERMANAGER_CAN_MODIFY_PWD);
View Full Code Here

      String[] addremoveTranslated = new String[] { translate("role.add"), translate("role.remove") };

      // Main layout is a vertical layout without left side padding. To format
      // the checkboxes properly we need a default layout for the remaining form
      // elements
      FormItemContainer innerFormLayout = FormLayoutContainer.createDefaultFormLayout("innerFormLayout", getTranslator());
      formLayout.add(innerFormLayout);

      // check user rights:
      boolean iAmOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
      identity = ureq.getIdentity();
View Full Code Here

   * @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer, org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
   */
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // wrapper container that generates standard layout for the form elements
    FormItemContainer themeAdminFormContainer = FormLayoutContainer.createDefaultFormLayout("themeAdminFormContainer", getTranslator());
    formLayout.add(themeAdminFormContainer);
   
   
    String[] keys = getThemes();
    String enabledTheme = Settings.getGuiThemeIdentifyer();
View Full Code Here

//    status = formUIf.addTextElement("status", 256, metadata.getStatus(), "cpmd.flexi.status", formLayout);
//    date = formUIf.addDateChooser("date", metadata.getDate(), formLayout);
//    format = formUIf.addTextElement("format", 256, metadata.getFormat(), "cpmd.flexi.format", formLayout);
//    author = formUIf.addTextElement("author", 256, metadata.getAuthor(), "cpmd.flexi.author", formLayout);

    FormItemContainer buttonContainer = FormLayoutContainer.createHorizontalFormLayout("buttonContainer", getTranslator());
    formLayout.add(buttonContainer);

    // Submit buttons
    lSave = new FormLinkImpl("lSave", "lSave", "submit", Link.BUTTON);
    lSave.addActionListener(this, FormEvent.ONCLICK);

    lSaveandclose = new FormLinkImpl("lSaveandclose", "lSaveandclose", "saveandclose", Link.BUTTON);

    lSaveandclose.addActionListener(this, FormEvent.ONCLICK);
    buttonContainer.add(lSave);
    buttonContainer.add(lSaveandclose);

  }
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.form.flexible.FormItemContainer

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.