01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.admin;
05:
06: import org.dijon.ContainerResource;
07: import org.dijon.Label;
08:
09: 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[] PROPERTY_FIELDS = { "Version", "BuildID",
25: "License" };
26:
27: // TODO: i18n
28: static final String[] PROPERTY_HEADERS = { "Version", "Build",
29: "License" };
30:
31: public AltProductInfoPanel() {
32: super ();
33:
34: AdminClientContext cc = AdminClient.getContext();
35: load(cc.topRes.getComponent("AltProductInfoPanel"));
36:
37: m_infoTable.setSelectionModel(new NullListSelectionModel());
38: }
39:
40: public void load(ContainerResource containerRes) {
41: super .load(containerRes);
42:
43: m_infoTable = (PropertyTable) findComponent("ProductInfoTable");
44: m_propertyModel = m_infoTable.getPropertyModel();
45: m_propertyModel.init(ProductInfo.class, PROPERTY_FIELDS,
46: PROPERTY_HEADERS);
47:
48: m_copyrightLabel = (Label) findComponent("CopyrightLabel");
49: }
50:
51: public void init(ProductInfo productInfo) {
52: m_propertyModel.setInstance(productInfo);
53: m_copyrightLabel.setText(productInfo.getCopyright());
54: }
55: }
|