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

Examples of org.olat.core.gui.components.form.flexible.elements.FormLink


    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


      TranslationToolI18nItemEditCrumbController i18nItemEditCrumbCtr = new TranslationToolI18nItemEditCrumbController(ureq,
          getWindowControl(), i18nItems, referenceLocale, customizingMode);
      activateAndListenToChildCrumbController(i18nItemEditCrumbCtr);

    } else if (source instanceof FormLink) {
      FormLink link = (FormLink) source;
      TranslationToolI18nItemEditCrumbController i18nItemEditCrumbCtr = new TranslationToolI18nItemEditCrumbController(ureq,
          getWindowControl(), i18nItems, referenceLocale, customizingMode);
      activateAndListenToChildCrumbController(i18nItemEditCrumbCtr);
      // Set item from link as to be activated item
      I18nItem firstBundleItem = (I18nItem) link.getUserObject();
      i18nItemEditCrumbCtr.initialzeI18nitemAsCurrentItem(ureq, firstBundleItem);
    }
  }
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

  @Override
  protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source instanceof FormLink) {
      // a delete link has been pressed, remove textElement and synonym
      FormLink delButton = (FormLink) source;
      String synonymToDelete = (String) delButton.getUserObject();
      glossItemSynonyms.remove(synonymToDelete);
      createOrUpdateSynonymLayout(this.flc, glossItemSynonyms);
   
  }
View Full Code Here

      synonymTextElementList.add(tmpSynonymTE);
    }

    // add delete-links for existing synonyms
    for (int linkNum = 1; linkNum < glossItemSynonymsToUse.size() + 1; linkNum++) {
      FormLink tmpRemoveButton = formUIf.addFormLink(CMD_DELETE_SYNONYM + linkNum, tmpLayout, Link.BUTTON_XSMALL);
      tmpRemoveButton.setUserObject(glossItemSynonymsToUse.get(linkNum - 1));
      tmpRemoveButton.setI18nKey("synonym.link.delete");
    }

    // add input field for new synonym
    newSynonymField = formUIf.addTextElement("synonym.inputfield", "glossary.term.synonym", 100, "", tmpLayout);
    newSynonymField.setVisible(true);
View Full Code Here

    // 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();
      FormLink tmpLink = formUIf.addFormLink(CMD_DELETE_ATTACHMENT + attNr, tmpLayout, Link.BUTTON_XSMALL);
      if (!(forumCallback.mayEditMessageAsModerator() || ((userIsMsgCreator) && (msgHasChildren == false)))) {
        tmpLink.setEnabled(false)
        tmpLink.setVisible(false);
      }
      tmpLink.setUserObject(tmpFile);
      tmpLink.setI18nKey("attachments.remove.string");
      attNr++;
    }
  }
View Full Code Here

          fileUpload.getUploadFile().delete();
          fileUpload.showError(true);
        }
      }
    } else if (source instanceof FormLink) {
      FormLink activeLink = (FormLink) source;
      // attachment delete button may have been pressed
      Object userObj = activeLink.getUserObject();
      if (userObj != null) {
        setEditPermissions(ureq, message);
        if (userObj instanceof VFSLeaf) {
          VFSLeaf file = (VFSLeaf) userObj;
          if (forumCallback.mayEditMessageAsModerator() || ((userIsMsgCreator) && (msgHasChildren == false))) {
View Full Code Here

  private void addDateLinkAndFileItems(FormItemContainer form) {
    // Date picker
    final DateChooser date = uifactory.addDateChooser("dateChooser", "guidemo.form.date", null, form);

    // Link
    final FormLink link = uifactory.addFormLink("link", form);
    link.setLabel("guidemo.form.link", null);

    // File Chooser
    // There is a multipart parameter problem with that element.
    file = uifactory.addFileElement("file", "advanced_form.file", form);
  }
View Full Code Here

        + "/rich_text_and_edit_link.html");
    masteryEditLayout.setLabel("item_feedback_mastery", null);
    overallFeedbackLayout.add(masteryEditLayout);
    RichTextElement masteryFeedback = uifactory.addRichTextElementForStringData("richTextElement", "item_feedback_mastery", masteryMat
        .renderAsHtml(mediaBaseUrl), 4, -1, true, true, baseContainer, null, masteryEditLayout, ureq.getUserSession(), getWindowControl());
    FormLink editLink = uifactory.addFormLink("editLink", masteryEditLayout, Link.NONTRANSLATED + Link.LINK_CUSTOM_CSS);
    ((Link) editLink.getComponent()).setCustomDisplayText("");
    ((Link) editLink.getComponent()).setCustomEnabledLinkCSS("b_small_icon b_edit_icon qti_edit_link");
    registerFeedbackElement(masteryMat, masteryFeedback, editLink);

    // One Failure Layout
    FormLayoutContainer failureEditLayout = FormLayoutContainer.createCustomFormLayout("failureEditLayout", getTranslator(), Util
        .getPackageVelocityRoot(this.getClass())
        + "/rich_text_and_edit_link.html");
    failureEditLayout.setLabel("item_feedback_fail", null);
    overallFeedbackLayout.add(failureEditLayout);
    RichTextElement failureFeedback = uifactory.addRichTextElementForStringData("richTextElement", "item_feedback_fail", failureMat
        .renderAsHtml(mediaBaseUrl), 4, -1, true, true, baseContainer, null, failureEditLayout, ureq.getUserSession(), getWindowControl());
    failureFeedback.setLabel("item_feedback_fail", null);
    FormLink failureLink = uifactory.addFormLink("editLink", failureEditLayout, Link.NONTRANSLATED + Link.LINK_CUSTOM_CSS);
    ((Link) failureLink.getComponent()).setCustomDisplayText("");
    ((Link) failureLink.getComponent()).setCustomEnabledLinkCSS("b_small_icon b_edit_icon");
    registerFeedbackElement(failureMat, failureFeedback, failureLink);

    // Feedback for each response when single or multiple choice question
    List<Material> responses = new ArrayList<Material>();
    boolean hasResponseLevelHints = false;
    if (item.getQuestion().getType() <= Question.TYPE_MC) {
      int i = 1;
      for (Object obj : item.getQuestion().getResponses()) {
        ChoiceResponse response = (ChoiceResponse) obj;
        // response-level feedback
        Material responseFeedbackMat = QTIEditHelper.getFeedbackOlatRespMaterial(item, response.getIdent());
        responseFeedbackMat = responseFeedbackMat == null ? new Material() : responseFeedbackMat;
        identities.put(responseFeedbackMat, response.getIdent());
        RichTextElement responseHintText = uifactory.addRichTextElementForStringData("feedback_" + i, null, responseFeedbackMat
            .renderAsHtml(mediaBaseUrl), 4, -1, true, true, baseContainer, null, responseLevelHintsLayout, ureq.getUserSession(),
            getWindowControl());
        FormLink link = uifactory.addFormLink("link_" + i, responseLevelHintsLayout, Link.NONTRANSLATED + Link.LINK_CUSTOM_CSS);
        ((Link) link.getComponent()).setCustomDisplayText("");
        ((Link) link.getComponent()).setCustomEnabledLinkCSS("b_small_icon b_edit_icon");
        registerFeedbackElement(responseFeedbackMat, responseHintText, link);
        // get response for displaying
        Material responseMat = response.getContent();
        responses.add(responseMat);
        i++;
View Full Code Here

    hideDidYouMeanWords();
   
    didYouMeanLinks = new ArrayList<FormLink>(didYouMeansWords.size());
    int wordNumber = 0;
    for (String word : didYouMeansWords) {
      FormLink l = uifactory.addFormLink(CMD_DID_YOU_MEAN_LINK + wordNumber++, word, null, flc, Link.NONTRANSLATED);
      l.setUserObject(word);
      didYouMeanLinks.add(l);
    }
    flc.contextPut("didYouMeanLinks", didYouMeanLinks);
    flc.contextPut("hasDidYouMean", Boolean.TRUE);
  }
View Full Code Here

TOP

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

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.