KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > monitor > jvm > component > UIOSInfo


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

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 /**
14  * May 31, 2004
15  * @author: Tuan Nguyen
16  * @email: tuan08@users.sourceforge.net
17  * @version: $ID$
18  **/

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 JavaDoc type) { return dataHandler_ ; }
36   
37   public Element getTemplate() { return TEMPLATE ; }
38 }
Popular Tags