1 26 27 package org.objectweb.util.browser.core.panel; 28 29 import java.util.Iterator ; 30 import java.util.List ; 31 import java.util.Vector ; 32 33 import org.objectweb.util.browser.api.Panel; 34 import org.objectweb.util.browser.core.api.CompositePanelFactory; 35 import org.objectweb.util.browser.core.api.ViewFactory; 37 38 46 public class DefaultCompositePanelFactory 47 extends DefaultPanelFactory 48 implements CompositePanelFactory { 49 50 56 protected List viewFactoryList_; 57 58 64 public DefaultCompositePanelFactory(){ 65 viewFactoryList_ = new Vector (); 66 } 67 68 74 protected Panel createPanel(Object object){ 75 DefaultCompositePanel compositePanel = new DefaultCompositePanel(); 76 Iterator iterator = viewFactoryList_.iterator(); 77 while (iterator.hasNext()) { 78 ViewFactory element = (ViewFactory) iterator.next(); 79 Panel panel = element.newPanel(object); 80 if(panel!=null) 81 compositePanel.add(panel); 82 } 83 return compositePanel; 84 } 85 86 92 97 110 111 117 121 public void add(ViewFactory viewFactory) { 122 if(viewFactory!=null) 123 viewFactoryList_.add(viewFactory); 124 } 125 126 } 127 128 129 | Popular Tags |