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 Row extends Element { 16 17 public Row() { } 18 19 public Element add(Element element) { 20 if(element instanceof Cell || 21 element instanceof HeaderCell) { 22 return super.add(element) ; 23 } 24 throw new RuntimeException ("expect element type of Cell or HeaderCell") ; 25 } 26 27 public void render(XhtmlDataHandlerManager manager, 28 ResourceBundle res, Writer w) throws IOException { 29 if(cssClass_ == null) { 30 w.write("<tr>") ; 31 } else { 32 w.write("<tr 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("</tr>") ; 38 } 39 } | Popular Tags |