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  /*** This interface defines how the valuelist should be rendered.
29   * 
30   * @author mwilson
31   * 
32   * TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
33   */
34  public interface DisplayProvider
35  {
36  
37     boolean doesIncludeBodyContent();
38  
39     String getMimeType();
40  
41     /***
42      * Get the HTML that comes before the column text.
43      * 
44      * @return The HTML that comes before the column text.
45      */
46     String getHeaderRowPreProcess();
47  
48     /***
49      * Get the HTML that comes before the column text.
50      * 
51      * @return The HTML that comes before the column text.
52      */
53     String getHeaderCellPreProcess(ColumnInfo columnInfo, ValueListInfo info);
54  
55     /***
56      * Formats the text to be displayed as the header by waraping it in a link if sorting is enabled.
57      * 
58      * @param columnInfo
59      *           The ColumnInfo.
60      * @param tableInfo
61      *           The TableInfo.
62      * @param info
63      *           The ValueListInfo.
64      * 
65      * @return The formated HTML.
66      */
67     String getHeaderLabel(ColumnInfo columnInfo, TableInfo tableInfo, ValueListInfo info, Map includeParameters);
68  
69     /***
70      * Get the HTML that comes after the column text.
71      * 
72      * @return The HTML that comes after the column text.
73      */
74     String getHeaderCellPostProcess();
75  
76     /***
77      * Get the HTML that comes before the column text.
78      * 
79      * @return The HTML that comes before the column text.
80      */
81     String getHeaderRowPostProcess();
82  
83     String getRowPreProcess(Attributes attributes);
84  
85     String getCellPreProcess(Attributes attributes);
86  
87     String getCellPostProcess();
88  
89     String getRowPostProcess();
90  
91     /***
92      * Get the HTML that emphase text.
93      * @param style  CSS className for the span tag.
94      * @param text a String that represent source text to search the emphasis pattern. 
95      * @param emphasisPattern a String that will be emphased in text.
96      * @return String Text with emphasised pattern.
97      * @author Andrej Zachar
98      */
99     String emphase(String text, String emphasisPattern, String style);
100 
101    String getNestedHeaderPreProcess(ColumnInfo columnInfo, ValueListInfo info);
102 
103    String getNestedHeaderPostProcess();
104 }