KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > AltProductInfoPanel


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.admin;
5
6 import org.dijon.ContainerResource;
7 import org.dijon.Label;
8
9 import com.tc.admin.common.NullListSelectionModel;
10 import com.tc.admin.common.PropertyTable;
11 import com.tc.admin.common.PropertyTableModel;
12 import com.tc.admin.common.XContainer;
13
14 /**
15  * This component is displayed on the ServerPanel after connecting to the
16  * associated server.
17  */

18
19 public class AltProductInfoPanel extends XContainer {
20   private PropertyTable m_infoTable;
21   private PropertyTableModel m_propertyModel;
22   private Label m_copyrightLabel;
23
24   static final String JavaDoc[] PROPERTY_FIELDS = {
25    "Version",
26    "BuildID",
27    "License"
28   };
29                                 
30   // TODO: i18n
31
static final String JavaDoc[] PROPERTY_HEADERS = {
32     "Version",
33     "Build",
34     "License"
35   };
36                                                               
37   public AltProductInfoPanel() {
38     super();
39     
40     AdminClientContext cc = AdminClient.getContext();
41     load(cc.topRes.getComponent("AltProductInfoPanel"));
42
43     m_infoTable.setSelectionModel(new NullListSelectionModel());
44   }
45
46   public void load(ContainerResource containerRes) {
47     super.load(containerRes);
48
49     m_infoTable = (PropertyTable)findComponent("ProductInfoTable");
50     m_propertyModel = m_infoTable.getPropertyModel();
51     m_propertyModel.init(ProductInfo.class, PROPERTY_FIELDS, PROPERTY_HEADERS);
52     
53     m_copyrightLabel = (Label)findComponent("CopyrightLabel");
54   }
55   
56   public void init(ProductInfo productInfo) {
57     m_propertyModel.setInstance(productInfo);
58     m_copyrightLabel.setText(productInfo.getCopyright());
59   }
60 }
61
Popular Tags