1 15 package org.apache.tapestry.portlet; 16 17 import java.util.Iterator ; 18 19 import javax.portlet.PortletConfig; 20 21 import org.apache.tapestry.describe.DescribableStrategy; 22 import org.apache.tapestry.describe.DescriptionReceiver; 23 import org.apache.tapestry.web.WebUtils; 24 25 31 public class PortletConfigStrategy implements DescribableStrategy 32 { 33 34 public void describeObject(Object object, DescriptionReceiver receiver) 35 { 36 PortletConfig pc = (PortletConfig) object; 37 38 receiver.title("Portlet Config"); 39 40 receiver.property("portletName", pc.getPortletName()); 41 42 receiver.section("Init Parameters"); 43 44 Iterator i = WebUtils.toSortedList(pc.getInitParameterNames()).iterator(); 45 46 while (i.hasNext()) 47 { 48 String name = (String ) i.next(); 49 receiver.property(name, pc.getInitParameter(name)); 50 } 51 } 52 } | Popular Tags |