1 15 package org.apache.tapestry.contrib.table.model.simple; 16 17 import org.apache.tapestry.IRender; 18 import org.apache.tapestry.IRequestCycle; 19 import org.apache.tapestry.contrib.table.model.ITableColumn; 20 import org.apache.tapestry.contrib.table.model.ITableModelSource; 21 import org.apache.tapestry.contrib.table.model.ITableRendererSource; 22 import org.apache.tapestry.valid.RenderString; 23 24 35 public class SimpleTableValueRendererSource implements ITableRendererSource 36 { 37 private static final long serialVersionUID = 1L; 38 39 44 private static final String EMPTY_REPRESENTATION = " "; 45 46 49 public IRender getRenderer( 50 IRequestCycle objCycle, 51 ITableModelSource objSource, 52 ITableColumn objColumn, 53 Object objRow) 54 { 55 SimpleTableColumn objSimpleColumn = (SimpleTableColumn) objColumn; 56 57 Object objValue = objSimpleColumn.getColumnValue(objRow); 58 if (objValue == null) 59 return new RenderString(EMPTY_REPRESENTATION, true); 60 61 return new RenderString(objValue.toString()); 62 } 63 64 } 65 | Popular Tags |