Package org.openqreg.util

Examples of org.openqreg.util.LanguageHandler


   * @see se.ucr.element.StandardVariable#createJS(se.ucr.element.ElementParameter)
   */
  @Override
  public String createJS(ElementParameter elemParam) {
    StringBuffer out = new StringBuffer();
    LanguageHandler lang = LanguageHandler.getInstance();
    String langID = elemParam.getLangId();

    out.append("inputAttributes['");
    out.append(name);
    out.append("'] = new Input('");
    // id
    out.append(name);
    out.append("'");

    //dataId
    out.append(", '");
    out.append(dataId);
    out.append("'");
   
    // subType
    out.append(", 'select'");
    // mandatory
    out.append(", ");
    out.append(mandatory);
    // dado
    out.append(", ");
    out.append(disableOnDisableAll);
    // description
    out.append(", '");
    out.append(lang.getTranslation(langID, getDescriptionID()));
    // helptext
    out.append("', '");
    out.append(lang.getTranslation(langID, getHelpTextID()));
    // min
    out.append("', null");
    // max
    out.append(", null");
    // wMin
View Full Code Here


   * @see se.ucr.element.StandardVariable#createJournalHTML(se.ucr.element.ElementParameter)
   */
  @Override
  public String createJournalHTML(ElementParameter elemParam) {
    StringBuffer out = new StringBuffer();
    LanguageHandler lang = LanguageHandler.getInstance();

    InputObjectTexts obj = lang.getInputObjectTexts(elemParam.getLangId(),
        getName(), getListBoxId());
    Map<Integer, ListOption> listOptions = obj.getListOptions();

    if (listOptions != null) {
      FetchData fetch = elemParam.getFetch();
View Full Code Here

   * @see se.ucr.element.StandardVariable#createPaperFormHTML(se.ucr.element.ElementParameter)
   */
  @Override
  public String createPaperFormHTML(ElementParameter elemParam) {
    StringBuffer out = new StringBuffer();
    LanguageHandler lang = LanguageHandler.getInstance();

    InputObjectTexts obj = lang.getInputObjectTexts(elemParam.getLangId(),
        getName(), getListBoxId());
    Calendar checkDate1 = elemParam.getCalendar();
    out.append("<div class=\"PFoptionstable\">\n");
    int col = 0;
    if (null != obj.getListOptions()
View Full Code Here

   * @see se.ucr.xml.XMLSchema#getXMLSchemaRule(String removeFromId)
   */
  @Override
  public String getXMLSchemaRule(String removeFromId) {
    StringBuffer out = new StringBuffer();
    LanguageHandler lang = LanguageHandler.getInstance();

    out.append("<xs:element name=\"");
    // out.append(this.getId().substring(this.getId().indexOf("_")+1).toUpperCase());
    out.append(this.getId().replaceFirst(removeFromId, "").toUpperCase());
    out.append("\">");
    out.append(nl);
    out.append("<xs:simpleType>");
    out.append(nl);
    out.append("<xs:restriction base=\"xs:string\">");
    out.append(nl);
    // TreeMap tr = lang.getListBoxTree(1,this.getId());
    // iter = lang.getListBoxTree(1,this.getId()).values().iterator();

    // TODO get available language from languagehandler
    Iterator<ListOption> iter = lang.getListBoxTree("sv", this.getId())
        .values().iterator();
    // skips first empty choice in listboxes
    if (iter.hasNext()) {
      iter.next();
    }
View Full Code Here

   * @see se.ucr.element.StandardVariable#createJS(se.ucr.element.ElementParameter)
   */
  @Override
  public String createJS(ElementParameter elemParam) {
    StringBuffer out = new StringBuffer();
    LanguageHandler lang = LanguageHandler.getInstance();
    String langID = elemParam.getLangId();

    out.append("inputAttributes['");
    out.append(name);
    out.append("'] = new Input('");
    // id
    out.append(name);
    out.append("'");

    //dataId
    out.append(", '");
    out.append(dataId);
    out.append("'");
   
    // subType
    out.append(", '").append(getSubType()).append("'");
    // mandatory
    out.append(", ");
    out.append(mandatory);
    // dado
    out.append(", ");
    out.append(disableOnDisableAll);
    // description
    out.append(", '");
    out.append(lang.getTranslation(langID, getDescriptionID()));
    // helptext
    out.append("', '");
    out.append(lang.getTranslation(langID, getHelpTextID()));
    // min
    out.append("', null");
    // max
    out.append(", null");
    // wMin
View Full Code Here

      out.append(fetch.getValueAsString(this.getName()));
      out.append("</span>");
    // else, print out 'Ok�nt' if the _MISS checkbox is checked
    } else if (fetch.containsValue(this.getName() + "_MISS")
        && "1".equals(fetch.getValueAsString(this.getName() + "_MISS"))) {
      LanguageHandler lang = LanguageHandler.getInstance();
      String langID = elemParam.getLangId();
      out.append("<span class=\"").append(getStylesheet()).append("\">");
      out.append(lang.getTranslation(langID, "CHECKBOXMISSCHECK_D"));
      out.append("</span>");
    }
    return out.toString();
  }
View Full Code Here

      out.append(fetch.getValueAsString(this.getName()));
      out.append("</span>");
    // else, print out 'Ok�nt' if the _MISS checkbox is checked
    } else if (fetch.containsValue(this.getName() + "_MISS")
        && "1".equals(fetch.getValueAsString(this.getName() + "_MISS"))) {
      LanguageHandler lang = LanguageHandler.getInstance();
      String langID = elemParam.getLangId();
      out.append("<span class=\"").append(getStylesheet()).append("\">");
      out.append(lang.getTranslation(langID, "CHECKBOXMISSCHECK_D"));
      out.append("</span>");
    } else {
      for (int i = 1; i <= getMaxNrOfCharacters(); i++) {
        if (i != getMaxNrOfCharacters() && i == (getMaxNrOfCharacters() - getNrOfDecimals())) {
          out.append(",");
View Full Code Here

   */
  @Override
  public String createPaperFormHTML(ElementParameter elemParam) {
    StringBuffer out = new StringBuffer();
    String langID = elemParam.getLangId();
    LanguageHandler lang = LanguageHandler.getInstance();
   
    String helpText = "<b>" + lang.getTranslation(langID, getDescriptionID()) + "</b><br/><br/>"
        + lang.getTranslation(langID, getHelpTextID());

    out.append("<span onmouseover=\"showHelpBox('").append(helpText).append("')\"> ");
    out.append("<input class=\"").append(getStylesheet()).append("\" name=\"").append(getName()).append("\" ");
    out.append("type =\"checkbox\" ");

View Full Code Here

   * @return Returns the a pice of HTML containing the variable and all
   *         nessecary javascripts
   */
  @Override
  public String createHTML(ElementParameter elemParam) {
    LanguageHandler lang = LanguageHandler.getInstance();
    String langID = elemParam.getLangId();
    StringBuffer out = new StringBuffer();
//    out.append("<span onmouseover=\"\">");
    if(getTextlocation() != null){
      if("left".equals(getTextlocation().toLowerCase())){
        out.append("<label for=\"");
        out.append(getName());
        out.append("_CHECK\">");
        out.append(lang.getTranslation(langID, getDescriptionID()));
        out.append("</label>");
      }
    }
    out.append("<input ");
    if (!"".equals(getStylesheet())) {
      out.append(" class=\"" + getStylesheet() + "\" ");
    }
    out.append("id=\"" + getName() + "_CHECK\"  ");
    out.append("type=\"checkbox\" ");
    if (null != elemParam.getFetch()
        && null != elemParam.getFetch().getValueAsString(this.name)
        && "1".equals(elemParam.getFetch().getValueAsString(this.name))) {
      out.append("value=\"1\" ");
    }else {
      out.append("value=\"0\" ");
    }
    //scripts
    for(ScriptBean vsBean : scripts.values()) {
      out.append(vsBean.getScriptname()+"=\"" + vsBean.getScriptvalue() + "\" ");
    }
    if (null != elemParam.getFetch().getValueAsString(this.name)
        && "1".equals(elemParam.getFetch().getValueAsString(this.name))) {
      out.append("checked ");
    }
    out.append("></input>");
    if (getTextlocation() != null) {
      if ("right".equals(getTextlocation().toLowerCase())) {
        out.append("<label for=\"");
        out.append(getName());
        out.append("_CHECK\">");
        out.append(lang.getTranslation(langID, getDescriptionID()));
        out.append("</label>");
      }
    }
    if (mandatory) {
      out.append("*");
 
View Full Code Here

   * @see se.ucr.element.StandardVariable#createJS(se.ucr.element.ElementParameter)
   */
  @Override
  public String createJS(ElementParameter elemParam) {
    StringBuffer out = new StringBuffer();
    LanguageHandler lang = LanguageHandler.getInstance();
    String langID = elemParam.getLangId();

    out.append("inputAttributes['");
    out.append(name+"_CHECK");
    out.append("'] = new Input('");
    // id
    out.append(name+"_CHECK");
    out.append("'");

    //dataId
    out.append(", '");
    out.append(dataId);
    out.append("'");
   
    // subType
    out.append(", 'checkbox'");
    // mandatory
    out.append(", ");
    out.append(mandatory);
    // dado
    out.append(", ");
    out.append(disableOnDisableAll);
    // description
    out.append(", '");
    out.append(lang.getTranslation(langID, getDescriptionID()));
    // helptext
    out.append("', '");
    out.append(lang.getTranslation(langID, getHelpTextID()));
    // min
    out.append("', null");
    // max
    out.append(", null");
    // wMin
View Full Code Here

TOP

Related Classes of org.openqreg.util.LanguageHandler

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.