1 6 7 package org.exoplatform.portlets.weather.component; 8 9 import org.exoplatform.faces.core.component.*; 10 import org.exoplatform.faces.core.component.model.*; 11 import org.exoplatform.portlets.weather.component.model.*; 12 13 14 public class UIWeatherDetail extends UIGrid 15 { 16 private String stationDetail_; 17 private String iconSrc_; 18 private String temperature_; 19 private String wind_; 20 21 public UIWeatherDetail() { 22 super(); 23 setId("UIWeatherDetail"); 24 setRendererType("GridRenderer"); 25 26 stationDetail_ = null; 27 iconSrc_ = null; 28 temperature_ = null; 29 wind_ = null; 30 updateTree(); 31 } 32 33 public void setStationDetail(String pStationDetail) { 34 stationDetail_ = pStationDetail; 35 updateTree(); 36 } 37 38 public void setTemperature(String pTemperature) { 39 temperature_ = pTemperature; 40 updateTree(); 41 } 42 43 public void setIconSrc(String pIconSrc) { 44 iconSrc_ = pIconSrc; 45 updateTree(); 46 } 47 48 public void setWind(String pWind) { 49 wind_ = pWind; 50 updateTree(); 51 } 52 53 private void updateTree() { 54 clear(); 55 if (stationDetail_!= null) { 56 add(new Row().add(new LabelCell(stationDetail_))); 57 } 58 if (iconSrc_!= null) add(new Row().add(new ImageCell(iconSrc_,iconSrc_))); 59 if (temperature_!= null) add(new Row().add(new LabelCell("T� : "+temperature_+" �C"))); 60 if (wind_!= null) add(new Row().add(new LabelCell("Vent : "+wind_))); 61 } 62 } 63 | Popular Tags |