1 4 package com.tc.admin; 5 6 import org.dijon.ContainerResource; 7 import org.dijon.Label; 8 9 import com.tc.admin.common.XContainer; 10 import com.tc.admin.common.XTextArea; 11 12 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 " + System.getProperty("java.version") + ", " + 34 System.getProperty("java.vendor"); 35 String javaHomeDir = System.getProperty("java.home"); 36 String javaVMInfo = System.getProperty("java.vm.name") + ", " + 37 System.getProperty("java.vm.version") + " [" + 38 Runtime.getRuntime().maxMemory()/(1024*1024) + " MB]"; 39 40 m_systemInformationTextArea.setText( 41 title + " " + version + newLine + 42 osInfo + newLine + 43 javaVersion + newLine + 44 javaHomeDir + newLine + 45 javaVMInfo); 46 47 m_copyrightLabel.setText(productInfo.getCopyright()); 48 } 49 } 50 | Popular Tags |