Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /* 
   * Copyright (C) 2010---2013 星星(wuweixing)<349446658@qq.com>
   * 
   * This file is part of Wabacus 
   * 
   * Wabacus is free software: you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 package com.wabacus.system.component.application.html;
 
 import java.util.List;
 
 
 public class HtmlTemplateApp extends AbsApplicationType
 {
     private HtmlComponentBean htmlConfigBean;
 
     public HtmlTemplateApp(AbsContainerType parentContainerType,IComponentConfigBean comCfgBean,ReportRequest rrequest)
     {
         super(parentContainerType,comCfgBean,rrequest);
         =(HtmlComponentBean)comCfgBean;
     }
     
     public void initUrl(IComponentConfigBean applicationConfigBean,ReportRequest rrequest)
     {}
 
     public void displayOnPage(AbsComponentTag displayTag)
     {
         {
             .println("&nbsp;");
             return;
         }
         if(.getTplBean()==null)
         {
             .println("&nbsp;");
             return;
         }
         StringBuffer tempBuf=new StringBuffer();
         String width=null;
         if(this.getParentContainerType()!=null)
         {
             width=this.getParentContainerType().getChildDisplayWidth(this.);
             if(width==null||width.trim().equals("")) width="100%";
             if(.getTop()!=null&&!.getTop().trim().equals(""))
             {
                 .println("<table  cellspacing='0' cellpadding='0' width=\""+width+"\" style=\"MARGIN:0;\">");
                 .println("<tr><td height=\""+.getTop()+"\">&nbsp;</td></tr></table>");
             }
             tempBuf.append("<table  cellspacing='0' cellpadding='0' width=\""+width+"\" id=\""+.getGuid()+"\"");
             if(.getHeight()!=null&&!.getHeight().trim().equals(""))
             {
                 tempBuf.append(" height=\""+.getHeight()+"\" ");
             }
             tempBuf.append("><tr><td valign=\"top\">");
             .println(tempBuf.toString());
         }
         .println("<span id=\"WX_CONTENT_"+.getGuid()+"\">");
         printlnHtmReallValue();
         .println("</span>");
         if(this.getParentContainerType()!=null)
         {
             .println("</td></tr></table>");
             if(this..getBottom()!=null&&!this..getBottom().trim().equals(""))
             {
                 .println("<table  cellspacing='0' cellpadding='0' width=\""+width+"\" style=\"MARGIN:0;\">");
                 .println("<tr><td height=\""+this..getBottom()+"\">&nbsp;</td></tr></table>");
             }
         }
     }
 
     public String getRealParenttitle()
     {
         String parenttitle=.getParenttitle();
         if(parenttitle==nullreturn "";
         return parenttitle.trim();
     }
 
    protected String getComponentTypeName()
    {
        return "application.html";
    }
    public void displayOnExportDataFile(Object templateObj,boolean isFirstime)
    {
        displayOnPage(null);
    }
    
    public void printApplication(List<PrintSubPageBeanlstPrintPagebeans)
    {
        {
            .println("&nbsp;");
            return;
        }
        if(this..getPrintwidth()!=null&&!this..getPrintwidth().trim().equals(""))
        {
            this..println("<div width=\""+this..getPrintwidth()+"\">");
        }
        printlnHtmReallValue();
        if(this..getPrintwidth()!=null&&!this..getPrintwidth().trim().equals(""))
        {
            this..println("</div>");
        }
    }
    
    private void printlnHtmReallValue()
    {
        AbsComponentType realDisplayComTypeObj=this;
        if(this..getBelongToCcbean()!=null)
        {//当前<html/>属于一个组件,则取到真正的组件类型对象,稍后可能会用自定义标签显示它们的内容
            realDisplayComTypeObj=(AbsComponentType).getComponentTypeObj(this..getBelongToCcbean(),null,false);
        }
        {
            .println(.getTplBean().getDisplayValue(,realDisplayComTypeObj));
        }else
        {
            String tplcontent=this..getTplBean().getContent();
            if(tplcontent==null||!Tools.isDefineKey("i18n",tplcontent.trim()))
            {
                .println(tplcontent);
            }else
            {
                Object obj=.getI18NObjectValue(tplcontent.trim());
                if(obj==null)
                {
                    .println("&nbsp;");
                }else
                {
                    if(!(obj instanceof TemplateBean))
                    {
                        .println(obj.toString());
                    }else
                    {
                        .println(((TemplateBean)obj).getDisplayValue(,realDisplayComTypeObj));
                    }
                }
            }
        }
    }
New to GrepCode? Check out our FAQ X