KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > weather > component > UIWeatherDetail


1 /**
2  * Jun 16, 2004, 11:43:17 AM
3  * @author: Fran�ois MORON
4  * @email: francois.moron@rd.francetelecom.com
5  **/

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 JavaDoc stationDetail_;
17     private String JavaDoc iconSrc_;
18     private String JavaDoc temperature_;
19     private String JavaDoc 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 JavaDoc pStationDetail) {
34         stationDetail_ = pStationDetail;
35         updateTree();
36     }
37     
38     public void setTemperature(String JavaDoc pTemperature) {
39         temperature_ = pTemperature;
40         updateTree();
41     }
42
43     public void setIconSrc(String JavaDoc pIconSrc) {
44         iconSrc_ = pIconSrc;
45         updateTree();
46     }
47
48     public void setWind(String JavaDoc 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