KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > text > template > xhtml > HeaderCell


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.text.template.xhtml;
6
7 import java.io.IOException JavaDoc;
8 import java.io.Writer JavaDoc;
9 import java.util.ResourceBundle JavaDoc;
10 import org.exoplatform.text.template.DataHandler;
11 /**
12  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
13  * @since Feb 1, 2005
14  * @version $Id$
15  */

16 public class HeaderCell extends Cell {
17   
18   public HeaderCell(String JavaDoc value) {
19     super(value) ;
20   }
21   
22   public void render(XhtmlDataHandlerManager manager,
23                      ResourceBundle JavaDoc res, Writer JavaDoc w) throws IOException JavaDoc {
24     w.write("<th") ;
25     if(cssClass_ != null) {
26       w.write(" class='") ;w.write(cssClass_); w.write("'") ;
27     }
28     if(cssStyle_ != null) {
29       w.write(" style='") ;w.write(cssStyle_); w.write("'") ;
30     }
31     if(attributes_ != null) {
32       w.write(attributes_) ;
33     }
34     w.write(">");
35     if(data_ != null) {
36       DataHandler dh = manager.getDataHandler(dataHandlerType_) ;
37       w.write(resolveValueAsString(data_ ,dh, res)) ;
38     }
39     if(children_.length > 0) {
40       for(int i = 0 ; i < children_.length; i++) {
41         children_[i].render(manager, res, w) ;
42       }
43     }
44     w.write("</th>") ;
45   }
46 }
Popular Tags