1 5 6 package org.exoplatform.portlets.monitor.portlet.component; 7 8 import java.util.List ; 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 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 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 children = getChildren(); 59 children.remove(1); 60 children.add(monitor); 61 } 62 63 64 public String getFamily() { 65 return "org.exoplatform.portlets.monitor.portlet.component.UIPortletContainerMonitor"; 66 } 67 } 68 69 | Popular Tags |