1 5 package org.exoplatform.portlets.monitor.jvm.component; 6 7 import org.exoplatform.container.monitor.jvm.OperatingSystemInfo; 8 import org.exoplatform.faces.core.component.UIExoComponentBase; 9 import org.exoplatform.text.template.BeanDataHandler; 10 import org.exoplatform.text.template.DataHandler; 11 import org.exoplatform.text.template.xhtml.Element; 12 import org.exoplatform.text.template.xhtml.Properties; 13 19 public class UIOSInfo extends UIExoComponentBase { 20 static private Element TEMPLATE = 21 new Properties(). 22 add("#{UIOSInfo.label.name}", "${name}"). 23 add("#{UIOSInfo.label.version}", "${version}"). 24 add("#{UIOSInfo.label.available-processors}","${AvailableProcessors}"). 25 add("#{UIOSInfo.label.achitecture}", "${arch}"). 26 optimize(); 27 28 private DataHandler dataHandler_ ; 29 30 public UIOSInfo(OperatingSystemInfo osinfo) { 31 setRendererType("TemplateRenderer") ; 32 dataHandler_ = new BeanDataHandler(osinfo); 33 } 34 35 public DataHandler getDataHandler(Class type) { return dataHandler_ ; } 36 37 public Element getTemplate() { return TEMPLATE ; } 38 } | Popular Tags |