KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > monitor > portlet > component > UIPortletContainerMonitor


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
6 package org.exoplatform.portlets.monitor.portlet.component;
7
8 import java.util.List JavaDoc;
9 import org.exoplatform.faces.core.component.UIExoComponentBase;
10 import org.exoplatform.portlets.monitor.portlet.component.model.PortletApplicationData;
11 import org.exoplatform.services.portletcontainer.monitor.PortletContainerMonitor;
12 /**
13  * Wed, Dec 22, 2003 @ 23:14
14  *
15  * @author: Tuan Nguyen
16  * @email: tuan08@users.sourceforge.net
17  * @version: $Id: UIPortletContainerMonitor.java,v 1.5 2004/08/02 12:04:26 tuan08 Exp $
18  */

19 public class UIPortletContainerMonitor extends UIExoComponentBase {
20
21   private PortletContainerMonitor service_;
22   private UIPortletMenu uiMenu_;
23   private UIPortletApplicationMonitor uiAppMonitor_;
24   private UIPortletMonitor uiPortletMonitor_;
25
26   public UIPortletContainerMonitor(PortletContainerMonitor service) {
27     setRendererType("PortletContainerMonitorRenderer");
28     setId("UIPortletContainerMonitor");
29     service_ = service ;
30     List JavaDoc children = getChildren();
31     uiMenu_ = new UIPortletMenu(service_.getPortletRuntimeDataMap().values());
32     uiMenu_.setRendered(true);
33     children.add(uiMenu_);
34     uiAppMonitor_ = new UIPortletApplicationMonitor();
35     PortletApplicationData appData = (PortletApplicationData) uiMenu_.
36         getPortletApplications().iterator().next();
37     uiAppMonitor_.setPortletApplicationData(appData);
38     uiAppMonitor_.setRendered(true);
39     children.add(uiAppMonitor_);
40     uiPortletMonitor_ = new UIPortletMonitor();
41     uiPortletMonitor_.setRendered(true);
42   }
43
44   public UIPortletMenu getUIPortletsMenu() {
45     return uiMenu_;
46   }
47
48   public UIPortletMonitor getUIPortletMonitor() {
49     return uiPortletMonitor_;
50   }
51
52   public UIPortletApplicationMonitor getUIPortletApplicationMonitor() {
53     return uiAppMonitor_;
54   }
55
56
57   public void showMonitor(UIExoComponentBase monitor) {
58     List JavaDoc children = getChildren();
59     children.remove(1);
60     children.add(monitor);
61   }
62
63
64   public String JavaDoc getFamily() {
65     return "org.exoplatform.portlets.monitor.portlet.component.UIPortletContainerMonitor";
66   }
67 }
68
69
Popular Tags