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

Examples of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl


   * org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
   */
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // Add the translate all button
    allTranslateButtonTop = new FormLinkImpl("allTranslateButtonTop", "allTranslateButtonTop", "generic.translateAllButton", Link.BUTTON);
    formLayout.add(allTranslateButtonTop);
    allTranslateButtonBottom = new FormLinkImpl("allTranslateButtonBottom", "allTranslateButtonBottom", "generic.translateAllButton",
        Link.BUTTON);
    formLayout.add(allTranslateButtonBottom);
    // Add a translate button for each package
    String currentBundleName = null;
    int bundlesCount = 0;
    for (I18nItem item : i18nItems) {
      if (!item.getBundleName().equals(currentBundleName)) {
        currentBundleName = item.getBundleName();
        String linkName = "translateBundle_" + currentBundleName;
        String label = (customizingMode ? "generic.customize.translateButton" : "generic.translateButton");
        FormLink bundleTranslateButton = new FormLinkImpl(linkName, linkName, label, Link.BUTTON_SMALL);
        bundleTranslateButton.setUserObject(item); // use first item of bundle
        formLayout.add(bundleTranslateButton);
        bundlesCount++;
      }
    }
    // Add all the items to velocity
View Full Code Here


   */
  public FormItem getStepTitle(){
    if(i18nStepTitle == null){
      throw new AssertException("no i18n key set for step title, or getStepTitle() not overridden.");
    }
    FormLink fl = new FormLinkImpl(i18nStepTitle, i18nStepTitle);
    fl.setTranslator(getTranslator());
    return fl;
  }
View Full Code Here

  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    formLayout.add("stepLinks", stepTitleLinks);
    // steps/wizard navigation .. as start most of buttons are disabled
    // they must be enabled by the first step according to its rules
    // cancel button is not possible to disable
    prevButton = new FormLinkImpl("back");
    prevButton.setCustomEnabledLinkCSS("b_button b_wizard_button_prev");
    prevButton.setCustomDisabledLinkCSS("b_button b_wizard_button_prev");
    nextButton = new FormLinkImpl("next");
    nextButton.setCustomEnabledLinkCSS("b_button b_wizard_button_next");
    nextButton.setCustomDisabledLinkCSS("b_button b_wizard_button_next");
    finishButton = new FormLinkImpl("finish");
    finishButton.setCustomEnabledLinkCSS("b_button b_wizard_button_finish");
    finishButton.setCustomDisabledLinkCSS("b_button b_wizard_button_finish");
    cancelButton = new FormLinkImpl("cancel");
    cancelButton.setCustomEnabledLinkCSS("b_button b_wizard_button_cancel");
    cancelButton.setCustomDisabledLinkCSS("b_button b_wizard_button_cancel");
    closeLink = new FormLinkImpl("closeIcon", "close", "", Link.NONTRANSLATED);
    closeLink.setCustomEnabledLinkCSS("b_link_close");
    formLayout.add(prevButton);
    formLayout.add(nextButton);
    formLayout.add(finishButton);
    formLayout.add(cancelButton);
View Full Code Here

    columnValueSelection.add(rowPos, iselect.getName());
    // 3) Init values for this row, assume selection of attribute at position 0
    updateValueElementForAttribute(attribute.getKey(0), rowPos, null);

    // 4) Add the 'add' and 'remove' buttons
    FormLinkImpl addL = new FormLinkImpl("add_" + rowCreationCounter, "add." + rowPos, "+", Link.BUTTON_SMALL + Link.NONTRANSLATED);
    addL.setUserObject(Integer.valueOf(rowPos));
    flc.add(addL);
    columnAddRow.add(rowPos, addL.getName());
    //
    FormLinkImpl removeL = new FormLinkImpl("remove_" + rowCreationCounter, "remove." + rowPos, "-", Link.BUTTON_SMALL + Link.NONTRANSLATED);
    removeL.setUserObject(Integer.valueOf(rowPos));
    flc.add(removeL);
    columnRemoveRow.add(rowPos, removeL.getName());

    // new row created, increment counter for unique form element id's
    rowCreationCounter++;
  }
View Full Code Here

          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);
View Full Code Here

    /*
     * check for defaultcontext
     */
    boolean hasDefaultContext = getDefaultBGContext() != null;
    //
    chooseGroupsLink = new FormLinkImpl("choosegroups", "choose");
    chooseGroupsLink.setCustomEnabledLinkCSS("b_form_groupchooser");
   
    // prepare create groups link which is used instead of chooseGroupsLink in
    // the
    // case where no groups are configured in the groupmanagement
    createGroupsLink = new FormLinkImpl("choosegroups", "create");
    createGroupsLink.setCustomEnabledLinkCSS("b_form_groupchooser");
   
    // create groups if no groups in groupmanagement, and default context
    // available
    groupChooseSubContainer.add(hasDefaultContext && !hasGroups ? createGroupsLink : chooseGroupsLink);
   
    //
    areaChooseSubContainer = (FormLayoutContainer)FormLayoutContainer.createHorizontalFormLayout("areaChooseSubContainer", getTranslator());
    areaChooseSubContainer.setLabel("form.easy.area", null);
    groupSubContainer.add(areaChooseSubContainer);   

    easyAreaTE = uifactory.addTextElement("area", null, 1024, areaInitVal, areaChooseSubContainer);
    easyAreaTE.setExampleKey("form.easy.example.area", null);
   
    chooseAreasLink = new FormLinkImpl("chooseareas", "choose");
    chooseAreasLink.setCustomEnabledLinkCSS("b_form_groupchooser");

    // prepare create are link which is used instead of choose area link in the
    // case where no areas are configured in the groupmanagement
    createAreasLink = new FormLinkImpl("chooseareas", "create");
    createAreasLink.setCustomEnabledLinkCSS("b_form_groupchooser");

    areaChooseSubContainer.add(hasDefaultContext && !hasAreas ? createAreasLink : chooseAreasLink);
  }
View Full Code Here

    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);
View Full Code Here

    FormLayoutContainer horizontalL = FormLayoutContainer.createHorizontalFormLayout("horiz", getTranslator());
    formLayout.add(horizontalL);
    gotoDate = uifactory.addDateChooser("goto",null, "",horizontalL);//null because no label is desired.
    gotoDate.setMandatory(false);
    gotoDate.setDate(new Date());
    gotoDateLink = new FormLinkImpl("cal.search.gotodate.button");
    horizontalL.add(gotoDateLink);
 
View Full Code Here

      // column 5 : Date
      row.add(new Date());
      // column 6 : Boolean value => custom rendered with two images
      row.add((i % 2 == 0) ? Boolean.TRUE : Boolean.FALSE);
      // column 7: Action Link
      FormLinkImpl link = new FormLinkImpl("choose");
      link.setUserObject(Integer.valueOf(i));
      link.addActionListener(controller, FormEvent.ONCLICK);
      row.add(link);
     
      entries.add(row);
    }
  }
View Full Code Here

     *
     */
    if (bgContext != null) {
      // easy creation only possible if a default group context available
      if (inGroupMode) {
        createNew = new FormLinkImpl("create");
      } else {
        createNew = new FormLinkImpl("create");
      }
      //is a button
      createNew.setCustomEnabledLinkCSS("b_button");
      createNew.setCustomDisabledLinkCSS("b_button b_disabled");
      // create new group/area on the right side
View Full Code Here

TOP

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

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.