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.XContainer;
10: import com.tc.admin.common.XTextArea;
11:
12: /**
13: * This is shown in the AboutDialog.
14: */
15:
16: public class AdminClientInfoPanel extends XContainer {
17: private XTextArea m_systemInformationTextArea;
18: private Label m_copyrightLabel;
19:
20: public void load(ContainerResource containerRes) {
21: super .load(containerRes);
22:
23: m_systemInformationTextArea = (XTextArea) findComponent("SystemInformationTextArea");
24: m_copyrightLabel = (Label) findComponent("CopyrightLabel");
25: }
26:
27: public void init(String title, ProductInfo productInfo) {
28: String version = productInfo.getVersion();
29: String newLine = System.getProperty("line.separator");
30: String osInfo = System.getProperty("os.name") + " ("
31: + System.getProperty("os.version") + "/"
32: + System.getProperty("os.arch") + ")";
33: String javaVersion = "Java "
34: + System.getProperty("java.version") + ", "
35: + System.getProperty("java.vendor");
36: String javaHomeDir = System.getProperty("java.home");
37: String javaVMInfo = System.getProperty("java.vm.name") + ", "
38: + System.getProperty("java.vm.version") + " ["
39: + Runtime.getRuntime().maxMemory() / (1024 * 1024)
40: + " MB]";
41:
42: m_systemInformationTextArea.setText(title + " " + version
43: + newLine + osInfo + newLine + javaVersion + newLine
44: + javaHomeDir + newLine + javaVMInfo);
45:
46: m_copyrightLabel.setText(productInfo.getCopyright());
47: }
48: }
|