PropertyViewerSample.java
01 /*
02  * Created on Aug 19, 2007
03  
04  * Copyright 2005 CafeSip.org 
05  *
06  * Licensed under the Apache License, Version 2.0 (the "License"); 
07  * you may not use this file except in compliance with the License. 
08  * You may obtain a copy of the License at 
09  *
10  *  http://www.apache.org/licenses/LICENSE-2.0 
11  *
12  * Unless required by applicable law or agreed to in writing, software 
13  * distributed under the License is distributed on an "AS IS" BASIS, 
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
15  * See the License for the specific language governing permissions and 
16  * limitations under the License.
17  *
18  */
19 package org.cafesip.gwtcomp.examples.client;
20 
21 import java.util.HashMap;
22 
23 import org.cafesip.gwtcomp.client.ui.PropertyViewer;
24 import org.cafesip.gwtcomp.client.ui.TitleBar;
25 
26 import com.google.gwt.user.client.ui.FlowPanel;
27 import com.google.gwt.user.client.ui.HTML;
28 
29 /**
30  @author Amit Chatterjee
31  *
32  */
33 public class PropertyViewerSample extends FlowPanel
34 {
35     /**
36      *  A constructor for this class.
37      
38      *  @param grid
39      */
40     public PropertyViewerSample()
41     {
42         super();
43         setWidth("100%");
44         
45         init();
46     }
47     
48     protected void init()
49     {
50         TitleBar titleBar = new TitleBar(
51                 "Property Viewer", null, 1);
52         add(titleBar);
53         
54         add(new HTML("<p>"));
55 
56         PropertyViewer propertyViewer = new PropertyViewer();
57         add(propertyViewer);
58         propertyViewer.setWidth("100%");
59 
60         HashMap map = new HashMap();
61         map.put("Name""Joe Shmoe");
62         map.put("Company""CafeSip");
63         map.put("URL""cafesip.org");
64 
65         propertyViewer.setProperties(map);
66     }
67     
68 }