Differences between revisions 3 and 4
Revision 3 as of 2007-02-22 17:34:48
Size: 1253
Comment:
Revision 4 as of 2009-09-20 23:01:44
Size: 1253
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

treeHandler

tomahawk.taglib.xml

<tag>
    <tag-name>tree</tag-name>
    <component>
        <component-type>org.apache.myfaces.HtmlTree</component-type>
        <renderer-type>org.apache.myfaces.HtmlTree</renderer-type>
        <handler-class>....facelets.TreeHandler</handler-class>
    </component>
</tag>

TreeHandler.java

import org.apache.log4j.Logger;

import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.jsf.ComponentConfig;
import com.sun.facelets.tag.jsf.ComponentHandler;

/**
 * Just fit the Tomahawk taglib to facelet:
 * <ul>
 * <li> Transform <code>value</code> property to <code>model</code>
 * </ul>
 * 
 */
public class TreeHandler extends ComponentHandler {
        /**
         * Logger for this class
         */
        private static final Logger     logger  = Logger.getLogger(TreeHandler.class);
        
        
        public TreeHandler(ComponentConfig componentConfig) {
                super(componentConfig);

        }

        @Override
        protected MetaRuleset createMetaRuleset(Class type) {
                if(logger.isDebugEnabled()){
                        logger.debug("replace 'value' attributes with 'model'");
                }
                
                return super.createMetaRuleset(type)
                .alias("value", "model");
        }
}

TreeHandler (last edited 2009-09-20 23:01:44 by localhost)