1 package com.icesoft.faces.facelets; 2 3 import com.sun.facelets.tag.jsf.ComponentHandler; 4 import com.sun.facelets.tag.jsf.ComponentConfig; 5 import com.sun.facelets.tag.TagAttribute; 6 import com.sun.facelets.FaceletContext; 7 import com.icesoft.faces.component.UIXhtmlComponent; 8 9 import javax.faces.component.UIComponent; 10 11 15 public class UIXhtmlComponentHandler extends ComponentHandler { 16 public UIXhtmlComponentHandler(ComponentConfig componentConfig) { 17 super(componentConfig); 18 } 19 20 23 protected UIComponent createComponent(FaceletContext ctx) { 24 UIXhtmlComponent current = new UIXhtmlComponent(); 26 current.setCreatedByFacelets(); 27 current.setTag(tag.getQName()); 28 TagAttribute[] attribs = tag.getAttributes().getAll(); 29 for(int i = 0; i < attribs.length; i++) { 30 String qName = attribs[i].getQName(); 31 if( attribs[i].isLiteral() ) { 32 String value = attribs[i].getValue(); 33 current.addStandardAttribute(qName, value); 34 } 35 else { 36 Object value = 40 attribs[i].getValueExpression(ctx, Object .class); 41 current.addELValueExpression(qName, value); 42 } 43 } 44 return current; 45 } 46 47 protected void setAttributes(FaceletContext ctx, Object instance) { 48 } 51 52 53 93 } 94 | Popular Tags |