Examples of RichTextElement


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

   * @return The rich text element instance
   */
  public RichTextElement addRichTextElementForStringDataMinimalistic(String name, final String i18nLabel, String initialHTMLValue, final int rows,
      final int cols, boolean externalToolbar, FormItemContainer formLayout, UserSession usess, WindowControl wControl) {
    // Create richt text element with bare bone configuration
    RichTextElement rte = new RichTextElementImpl(name, initialHTMLValue, rows, cols, formLayout.getRootForm());
    setLabelIfNotNull(i18nLabel, rte);
    // Now configure editor
    rte.getEditorConfiguration().setConfigProfileFormEditorMinimalistic(usess, externalToolbar, wControl.getWindowBackOffice().getWindow().getGuiTheme());     
    // Add to form and finish
    formLayout.add(rte);
    return rte;
  }
View Full Code Here

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

   */
  public RichTextElement addRichTextElementForStringData(String name, final String i18nLabel, String initialHTMLValue, final int rows,
      final int cols, boolean externalToolbar, boolean fullProfile, VFSContainer baseContainer, CustomLinkTreeModel customLinkTreeModel,
      FormItemContainer formLayout, UserSession usess, WindowControl wControl) {
    // Create richt text element with bare bone configuration
    RichTextElement rte = new RichTextElementImpl(name, initialHTMLValue, rows, cols, formLayout.getRootForm());
    setLabelIfNotNull(i18nLabel, rte);
    // Now configure editor
    rte.getEditorConfiguration().setConfigProfileFormEditor(fullProfile, usess, externalToolbar, wControl.getWindowBackOffice().getWindow().getGuiTheme(), baseContainer, customLinkTreeModel);     
    // Add to form and finish
    formLayout.add(rte);
    return rte;
  }
View Full Code Here

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

      VFSContainer baseContainer, String relFilePath,
      CustomLinkTreeModel customLinkTreeModel,
      FormItemContainer formLayout, UserSession usess,
      WindowControl wControl) {
    // Create richt text element with bare bone configuration
    RichTextElement rte = new RichTextElementImpl(name, initialValue, rows,
        cols, formLayout.getRootForm());
    setLabelIfNotNull(i18nLabel, rte);
    // Now configure editor
    rte.getEditorConfiguration().setConfigProfileFileEditor(usess,
        externalToolbar,
        wControl.getWindowBackOffice().getWindow().getGuiTheme(),
        baseContainer, relFilePath, customLinkTreeModel);
    // Add to form and finish
    formLayout.add(rte);
View Full Code Here

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

          } else {
            QTIEditHelper.setFeedbackOlatResp(item, html, identities.get(mat));
          }

          // update view
          RichTextElement text = textElements.get(mat);
          //the html code is embbeded in the panel and as not a proper baseurl
          text.setValue(mat.renderAsHtml(mediaBaseUrl));
          // serialize document
          qtiPackage.serializeQTIDocument();
        }
        // dispose controllers
        dialogCtr.deactivate();
View Full Code Here

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

    FormLayoutContainer masteryEditLayout = FormLayoutContainer.createCustomFormLayout("masteryEditLayout", getTranslator(), Util
        .getPackageVelocityRoot(this.getClass())
        + "/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");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.