001 package org.hackystat.projectbrowser.page.sensordata; 002 003 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn; 004 import org.apache.wicket.markup.repeater.Item; 005 import org.apache.wicket.model.IModel; 006 007 /** 008 * Implements a column holding SDT summary information in the SensorDataDetailsPanel. 009 * @author Philip Johnson 010 * 011 */ 012 public class SdtColumn extends AbstractColumn { 013 014 /** for serialization. */ 015 private static final long serialVersionUID = 1L; 016 private String sdtName = ""; 017 018 /** 019 * Constructs the SensorDataType column. 020 * @param model The model containintg SDT info. 021 * @param sdtName The name of the SDT to be displayed in this column. 022 */ 023 public SdtColumn(IModel model, String sdtName) { 024 super(model); 025 this.sdtName = sdtName; 026 } 027 028 /** 029 * How to populate an individual cell. 030 * @param cellItem the Item instance that will be displayed in the cell. 031 * @param componentId Use this to assign to the component added to the cell. 032 * @param model the model used to figure out what to display in the cell. 033 */ 034 public void populateItem(Item cellItem, String componentId, IModel model) { 035 SensorDataTableRowModel rowModel = (SensorDataTableRowModel) model.getObject(); 036 cellItem.add(new SdtSummaryPanel(componentId, rowModel.getSensorDataSummaryList(this.sdtName), 037 rowModel.getStartTime())); 038 } 039 040 }