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 import org.exoplatform.text.template.DataHandler; 11 16 public class Div extends Text { 17 18 public Div() { 19 super(null) ; 20 } 21 22 public Div(String text) { 23 super(text) ; 24 } 25 26 public void render(XhtmlDataHandlerManager manager, 27 ResourceBundle res, Writer w) throws IOException { 28 if(cssClass_ == null ) { 29 w.write("<div>") ; 30 } else { 31 w.write("<div class='") ; w.write(cssClass_); w.write("'>") ; 32 } 33 if(data_ != null) { 34 DataHandler dh = manager.getDataHandler(dataHandlerType_) ; 35 w.write(resolveValueAsString(data_ ,dh, res)) ; 36 } 37 if(children_.length > 0) { 38 for(int i = 0 ; i < children_.length; i++) { 39 children_[i].render(manager, res, w) ; 40 } 41 } 42 w.write("</div>") ; 43 } 44 45 } | Popular Tags |