1 19 20 package org.netbeans.modules.web.jsf.impl.facesmodel; 21 22 23 import java.util.List ; 24 import org.netbeans.modules.web.jsf.api.facesmodel.Converter; 25 import org.netbeans.modules.web.jsf.api.facesmodel.FacesConfig; 26 import org.netbeans.modules.web.jsf.api.facesmodel.JSFConfigVisitor; 27 import org.netbeans.modules.web.jsf.api.facesmodel.ManagedBean; 28 import org.netbeans.modules.web.jsf.api.facesmodel.NavigationRule; 29 import org.w3c.dom.Element ; 30 31 35 public class FacesConfigImpl extends JSFConfigComponentImpl implements FacesConfig{ 36 37 38 public FacesConfigImpl(JSFConfigModelImpl model, Element element) { 39 super(model, element); 40 } 41 42 public FacesConfigImpl(JSFConfigModelImpl model) { 43 this(model, createElementNS(model, JSFConfigQNames.FACES_CONFIG)); 44 } 45 46 public List <ManagedBean> getManagedBeans() { 47 return getChildren(ManagedBean.class); 48 } 49 50 public void addManagedBean(ManagedBean bean) { 51 appendChild(MANAGED_BEAN, bean); 52 } 53 54 public void addManagedBean(int index, ManagedBean bean) { 55 insertAtIndex(MANAGED_BEAN, bean, index, ManagedBean.class); 56 } 57 58 public void removeManagedBean(ManagedBean bean) { 59 removeChild(MANAGED_BEAN, bean); 60 } 61 62 public List <NavigationRule> getNavigationRules() { 63 return getChildren(NavigationRule.class); 64 } 65 66 public void addNavigationRule(NavigationRule rule) { 67 appendChild(NAVIGATION_RULE, rule); 68 } 69 70 public void addNavigationRule(int index, NavigationRule rule) { 71 insertAtIndex(NAVIGATION_RULE, rule, index, NavigationRule.class); 72 } 73 public void removeNavigationRule(NavigationRule rule) { 74 removeChild(NAVIGATION_RULE, rule); 75 } 76 77 public List <Converter> getConverters() { 78 return getChildren(Converter.class); 79 } 80 81 public void addConverter(Converter converter) { 82 appendChild(CONVERTER, converter); 83 } 84 85 public void addConverter(int index, Converter converter) { 86 insertAtIndex(CONVERTER, converter, index, NavigationRule.class); 87 } 88 89 public void removeConverter(Converter converter) { 90 removeChild(CONVERTER, converter); 91 } 92 93 public void accept(JSFConfigVisitor visitor) { 94 visitor.visit(this); 95 } 96 } 97 | Popular Tags |