KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > ConfiguratorInfoPanel


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;
5
6 import org.dijon.ContainerResource;
7 import org.dijon.Label;
8
9 import com.tc.admin.ProductInfo;
10 import com.tc.admin.common.XContainer;
11 import com.tc.admin.common.XTextArea;
12
13 /**
14  * This is shown in the AboutDialog.
15  */

16
17 public class ConfiguratorInfoPanel extends XContainer {
18   private XTextArea m_systemInformationTextArea;
19   private Label m_copyrightLabel;
20
21   public void load(ContainerResource containerRes) {
22     super.load(containerRes);
23
24     m_systemInformationTextArea = (XTextArea)findComponent("SystemInformationTextArea");
25     m_copyrightLabel = (Label)findComponent("CopyrightLabel");
26   }
27   
28   public void init(String JavaDoc title, ProductInfo productInfo) {
29     String JavaDoc version = productInfo.getVersion();
30     String JavaDoc newLine = System.getProperty("line.separator");
31     String JavaDoc osInfo = System.getProperty("os.name") + " (" +
32                      System.getProperty("os.version") + "/" +
33                      System.getProperty("os.arch") + ")";
34     String JavaDoc javaVersion = "Java " + System.getProperty("java.version") + ", " +
35                                    System.getProperty("java.vendor");
36     String JavaDoc javaHomeDir = System.getProperty("java.home");
37     String JavaDoc javaVMInfo = System.getProperty("java.vm.name") + ", " +
38                          System.getProperty("java.vm.version") + " [" +
39                          Runtime.getRuntime().maxMemory()/(1024*1024) + " MB]";
40
41     m_systemInformationTextArea.setText(
42       title + " " + version + newLine +
43       osInfo + newLine +
44       javaVersion + newLine +
45       javaHomeDir + newLine +
46       javaVMInfo);
47
48     m_copyrightLabel.setText(productInfo.getCopyright());
49   }
50 }
51
Popular Tags