1 5 package org.exoplatform.faces.core.component.model; 6 7 import java.util.List ; 8 import java.util.ArrayList ; 9 import java.util.ResourceBundle ; 10 import java.io.IOException ; 11 import javax.faces.context.ResponseWriter ; 12 import org.exoplatform.faces.core.component.UIGrid; 13 14 20 public class Row implements HtmlFragment { 21 protected List cells_ ; 22 protected String clazz_ ; 23 protected boolean visible_ ; 24 25 public Row() { 26 cells_ = new ArrayList () ; 27 visible_ = true ; 28 } 29 30 public Row add(Cell cell) { 31 cells_.add(cell) ; 32 return this ; 33 } 34 35 public boolean isVisible() { return visible_ ; } 36 public Row setVisible(boolean b) { 37 visible_ = b ; 38 return this ; 39 } 40 41 final public List getCells() { return cells_ ; } 42 43 public String getClazz() { return clazz_ ; } 44 public Row setClazz(String clazz) { 45 clazz_ = clazz ; 46 return this ; 47 } 48 49 public void render(ResponseWriter w, ResourceBundle res, UIGrid uiParent) throws IOException { 50 if(!visible_) return ; 51 w.write("<tr") ; 52 if(clazz_ != null) { 53 w.write(" class=\"");w.write(clazz_);w.write("\"") ; 54 } 55 w.write(">\n") ; 56 for (int i = 0 ; i < cells_.size() ; i++) { 57 Cell cell = (Cell) cells_.get(i) ; 58 cell.render(w, res, uiParent , "td") ; 59 } 60 w.write("</tr>\n") ; 61 } 62 63 } | Popular Tags |