Examples of StaticTextElement


Examples of org.olat.core.gui.formelements.StaticTextElement

  /**
   * @param defaultSubject
   */
  public void setSubject(final String defaultSubject) {
    if(readOnly){
      tsubject = new StaticTextElement(NLS_CONTACT_SUBJECT, defaultSubject);
    }else{
      tsubject = new TextElement(NLS_CONTACT_SUBJECT, defaultSubject, 255);
      tsubject.setMandatory(true);
    }
    addFormElement("tsubject", tsubject);
View Full Code Here

Examples of org.olat.core.gui.formelements.StaticTextElement

      if (defaultEmailTo.length() > (3 * emailCols)) {
        defaultEmailTo = defaultEmailTo.substring(0, 3 * emailCols - 1);
        defaultEmailTo += "\n. . . ";
      }
      if (formFieldAlreadyAdded) tto.setValue(defaultEmailTo);
      else tto = new StaticTextElement(NLS_CONTACT_TO, defaultEmailTo);
    } else {
      //recipients field editable
      if (!formFieldAlreadyAdded) ttoBig = new TextAreaElement(NLS_CONTACT_TO, 2, emailCols);
      //recipients field filled with addresses and even editable
      ttoBig.setValue(defaultEmailTo);
View Full Code Here

Examples of org.olat.core.gui.formelements.StaticTextElement

        ttoBig.setValue(tto.getValue());
        tto = null;
        //removeFormElement(tto);
        addFormElement("tto", ttoBig);
      } else {
        tto = new StaticTextElement(NLS_CONTACT_TO, ttoBig.getValue());
        ttoBig = null;
        //removeFormElement(ttoBig);
        addFormElement("tto", tto);
      }
    }
View Full Code Here

Examples of org.olat.core.gui.formelements.StaticTextElement

   
    displayName = new TextElement("cif.displayname", "", false, 255);
    addFormElement("cif_displayname", displayName);
   
    if(limitUsername != null) {
      author = new StaticTextElement("cif.author", limitUsername);
      author.setValue(limitUsername);
    } else {
      author = new TextElement("cif.author", "", false, 255);
    }
    addFormElement("cif_author", author);
View Full Code Here

Examples of org.olat.core.gui.formelements.StaticTextElement

  /**
   * Initialize form data based on repository entry.
   */
  public void init() {
    if (enableAuthorView) {
      addFormElement("cif_id", new StaticTextElement("cif.id", entry.getKey() != null ? entry.getKey().toString() : translate("cif.id.na")));
    }
    displayName = new TextElement("cif.displayname", entry.getDisplayname(), true, MAX_DISPLAYNAME);
    displayName.setMaxLength(100);
    addFormElement("cif_displayname", displayName);
    initialAuthor = new StaticTextElement("cif.initialAuthor", entry.getInitialAuthor());
    addFormElement("cif_initialAuthor", initialAuthor);
   
    // for empty TextAreas, put at least a space so that TextArea gets displayed correctly
    description = new TextAreaElement("cif.description", 4, 40, (entry.getDescription() != null) ? entry.getDescription() : " ");
    description.setMandatory(true);
    addFormElement("cif_description", description);
    resourceName = new StaticTextElement("cif.resourcename", (entry.getResourcename() == null) ? "-" : entry.getResourcename());
    resourceName.setMaxLength(100);
    addFormElement("cif_resourcename", resourceName);
   
    StringBuilder typeDisplayText = new StringBuilder(100);
    if (typeName != null) { // add image and typename code
View Full Code Here

Examples of org.olat.core.gui.formelements.StaticTextElement

  /**
   * Initialize form.
   */
  private void init() {
    login = new StaticTextElement("smf.login", authentication.getIdentity().getName());
    addFormElement("smf_login", login);
   
    password = new PasswordElement("smf.password", 255);
    addFormElement("smf_password", password);
   
View Full Code Here

Examples of org.olat.core.gui.formelements.StaticTextElement

   * @param name
   */
  public ChangeMessageForm(String name, Translator translator) {
    super(name, translator);
    //
    StaticTextElement userInfo = new StaticTextElement("form.chngmsg.infolabel", translate("form.chngmsg.info"));
    userMsg = new TextAreaElement("form.chngmsg.usermsg", 7, 80);
    chkbx = new CheckBoxElement("form.chngmsg.informlearners", true);
    addFormElement("userInfo", userInfo);
    addFormElement("userMsg", userMsg);
    addFormElement("learnerYes", chkbx);
View Full Code Here

Examples of org.olat.core.gui.formelements.StaticTextElement

  /**
   * Initialize the form.
   */
  public void init() {
    addFormElement("size", new StaticTextElement("fr.size",
        new Long(file.length() / 1024).toString() + " KB"));

    DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, getLocale());
    addFormElement("last", new StaticTextElement("fr.last", df.format(new Date(file.lastModified()))));
   
    String resType = res.getResourceableTypeName();
    if (resType.equals(TestFileResource.TYPE_NAME) || resType.equals(SurveyFileResource.TYPE_NAME)) addQTIDetails();
    else if (resType.equals(ImsCPFileResource.TYPE_NAME) || resType.equals(ScormCPFileResource.TYPE_NAME)) addIMSCPDetails();
   
View Full Code Here

Examples of org.olat.core.gui.formelements.StaticTextElement

   

    // extract title
    Element el_assess = (Element)doc.selectSingleNode("questestinterop/assessment");
    String title = el_assess.attributeValue("title");
    if (title != null) addFormElement("qti.title", new StaticTextElement("qti.title", title));
    else addFormElement("qti.title", new StaticTextElement("qti.title", "-"));
   
    // extract objectives
    HTMLTextAreaElement htmlTA = new HTMLTextAreaElement("qti.objectives", 10, 60);
    htmlTA.setReadOnly(true);
    Element el_objectives = (Element)doc.selectSingleNode("//questestinterop/assessment/objectives");
    if (el_objectives != null) {
      Element el_mat = (Element)el_objectives.selectSingleNode("material/mattext");
      if (el_mat != null)
        htmlTA.setValue(el_mat.getTextTrim());
    } else htmlTA.setValue("-");
    addFormElement("qti.objectives", htmlTA);
   
    // extract num of questions
    List items = doc.selectNodes("//item");
    if (items.size() > 0)
      addFormElement("qti.questions", new StaticTextElement("qti.questions", "" + items.size()));
    else addFormElement("qti.questions", new StaticTextElement("qti.questions", "-"));
   
    // extract time limit
    Element el_duration = (Element)el_assess.selectSingleNode("duration");
    if (el_duration != null) {
      long dur = QTIHelper.parseISODuration(el_duration.getTextTrim());
      long min = dur / 1024 / 60;
      long sec = (dur - (min * 60 * 1024)) / 1024;
      addFormElement("qti.timelimit", new StaticTextElement("qti.timelimit", min + "' " + sec + "''"));
    } else addFormElement("qti.timelimit", new StaticTextElement("qti.timelimit", "-"));

  }
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.