1 5 package org.exoplatform.text.template.xhtml; 6 7 import java.io.IOException ; 8 import java.io.Writer ; 9 import java.util.ResourceBundle ; 10 15 public class Table extends Element { 16 17 public Table() { } 18 19 public Element add(Element element) { 20 if(element instanceof Row || 21 element instanceof Rows) { 22 return super.add(element) ; 23 } 24 throw new RuntimeException ("expect element type of Row or Rows") ; 25 } 26 27 public void render(XhtmlDataHandlerManager manager, 28 ResourceBundle res, Writer w) throws IOException { 29 if(cssClass_ == null) { 30 w.write("<table>") ; 31 } else { 32 w.write("<table class='") ; w.write(cssClass_); w.write("'>") ; 33 } 34 for(int i = 0 ; i < children_.length; i++) { 35 children_[i].render(manager, res, w) ; 36 } 37 w.write("</table>") ; 38 } 39 } | Popular Tags |