View Javadoc

1   /***
2    * Copyright (c) 2003 held jointly by the individual authors.            
3    *                                                                          
4    * This library is free software; you can redistribute it and/or modify it    
5    * under the terms of the GNU Lesser General Public License as published      
6    * by the Free Software Foundation; either version 2.1 of the License, or 
7    * (at your option) any later version.                                            
8    *                                                                            
9    * This library is distributed in the hope that it will be useful, but 
10   * WITHOUT ANY WARRANTY; with out even the implied warranty of 
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
12   * GNU Lesser General Public License for more details.                                                  
13   *                                                                           
14   * You should have received a copy of the GNU Lesser General Public License   
15   * along with this library;  if not, write to the Free Software Foundation,   
16   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.              
17   *                                                                            
18   * > http://www.gnu.org/copyleft/lesser.html                                  
19   * > http://www.opensource.org/licenses/lgpl-license.php
20   */
21  package net.mlw.vlh.web.tag.support;
22  
23  import java.util.Map;
24  
25  import net.mlw.vlh.ValueListInfo;
26  import net.mlw.vlh.web.tag.TableInfo;
27  
28  /***
29   * @author Matthew L. Wilson, Andrej Zachar
30   * @version $Revision: 1.4 $ $Date: 2005/11/23 14:37:14 $
31   */
32  public class ExcelDisplayProvider implements DisplayProvider
33  {
34     /***
35      * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getMimeType()
36      */
37     public String getMimeType()
38     {
39        return "application/vnd.ms-excel";
40     }
41  
42     /***
43      * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getHeaderRowPreProcess()
44      */
45     public String getHeaderRowPreProcess()
46     {
47        return "";
48     }
49  
50     /***
51      * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getHeaderCellPreProcess()
52      */
53     public String getHeaderCellPreProcess(ColumnInfo columnInfo, ValueListInfo info)
54     {
55        return "";
56     }
57  
58     /***
59      * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getHeaderLabel(net.mlw.vlh.web.tag.ColumnInfo, net.mlw.vlh.web.tag.TableInfo,
60      * net.mlw.vlh.ValueListInfo)
61      */
62     public String getHeaderLabel(ColumnInfo columnInfo, TableInfo tableInfo, ValueListInfo info, Map includeParameters)
63     {
64        return columnInfo.getTitle();
65     }
66  
67     /***
68      * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getHeaderCellPostProcess()
69      */
70     public String getHeaderCellPostProcess()
71     {
72        return "\t";
73     }
74  
75     /***
76      * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getHeaderRowPostProcess()
77      */
78     public String getHeaderRowPostProcess()
79     {
80        return "\n";
81     }
82  
83     /***
84      * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getRowPreProcess(net.mlw.util.web.tag.Attributes)
85      */
86     public String getRowPreProcess(Attributes attributes)
87     {
88        return "";
89     }
90  
91     /***
92      * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getCellPreProcess(net.mlw.util.web.tag.Attributes)
93      */
94     public String getCellPreProcess(Attributes attributes)
95     {
96        return "";
97     }
98  
99     /***
100     * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getCellPostProcess()
101     */
102    public String getCellPostProcess()
103    {
104       return "\t";
105    }
106 
107    /***
108     * @see net.mlw.vlh.web.tag.support.HtmlDisplayProvider#getRowPostProcess()
109     */
110    public String getRowPostProcess()
111    {
112       return "\n";
113    }
114 
115    public boolean doesIncludeBodyContent()
116    {
117       return false;
118    }
119 
120    /***
121     * @see net.mlw.vlh.web.tag.support.DisplayProvider#emphase(java.lang.String,
122     *      java.lang.String)
123     */
124    public String emphase(String text, String emphasisPattern, String style)
125    {
126       // AAA add emphase escape charecterc for excel display provider
127       return text;
128    }
129 
130    public String getNestedHeaderPreProcess(ColumnInfo columnInfo, ValueListInfo info)
131    {
132       return "";
133    }
134 
135    public String getNestedHeaderPostProcess()
136    {
137       return "";
138    }
139 }