1 package org.jahia.layout; 2 3 11 12 import java.util.Enumeration ; 13 import java.util.Vector ; 14 15 import org.jahia.exceptions.JahiaException; 16 17 public class PortletBeanSet extends Vector { 18 19 public PortletBeanSet() { 20 } 21 22 28 public PortletBean findPortlet(int portletID) 29 throws JahiaException { 30 Enumeration portletList = this.elements(); 31 while (portletList.hasMoreElements()) { 32 PortletBean curPortlet = (PortletBean) portletList.nextElement(); 33 if (curPortlet.getPortletID() == portletID) { 34 return curPortlet; 35 } 36 } 37 throw new JahiaException("PortletBeanSet.findPortlet", 38 "Portlet not found", 39 JahiaException.ERROR_SEVERITY, 40 JahiaException.DATA_ERROR); 41 } 42 43 52 public boolean add(PortletBean portlet) { 53 return super.add(portlet); 54 } 55 56 } | Popular Tags |