/** * Creates a {@link ComponentType} instance to represent a standard UI * component. * * @param name Base name of component from which component-type and * component-class are formed. * @return {@link ComponentType} instance. */ protected ComponentType createUIComponent(String name) { ComponentType componentType = FacesConfigFactory.eINSTANCE.createComponentType(); //set component-type ComponentTypeType componentTypeType = FacesConfigFactory.eINSTANCE.createComponentTypeType(); StringBuffer sb = new StringBuffer(); sb.append("javax.faces."); //$NON-NLS-1$ sb.append(name); componentTypeType.setTextContent(sb.toString()); componentType.setComponentType(componentTypeType); //set component-class ComponentClassType componentClassType = FacesConfigFactory.eINSTANCE.createComponentClassType(); sb = new StringBuffer(); sb.append("javax.faces.component.UI"); //$NON-NLS-1$ sb.append(name); componentClassType.setTextContent(sb.toString()); componentType.setComponentClass(componentClassType); return componentType; }
/** * Creates a {@link ComponentType} instance to represent a concrete HTML * component. * * @param name Base name of component from which component-type and * component-class are formed. * @return {@link ComponentType} instance. */ protected ComponentType createHTMLComponent(String name) { ComponentType componentType = FacesConfigFactory.eINSTANCE.createComponentType(); //set component-type ComponentTypeType componentTypeType = FacesConfigFactory.eINSTANCE.createComponentTypeType(); StringBuffer sb = new StringBuffer(); sb.append("javax.faces."); //$NON-NLS-1$ sb.append(name); componentTypeType.setTextContent(sb.toString()); componentType.setComponentType(componentTypeType); //set component-class ComponentClassType componentClassType = FacesConfigFactory.eINSTANCE.createComponentClassType(); sb = new StringBuffer(); sb.append("javax.faces.component.html."); //$NON-NLS-1$ sb.append(name); componentClassType.setTextContent(sb.toString()); componentType.setComponentClass(componentClassType); return componentType; }