You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2007/02/22 18:33:34 UTC
[Myfaces Wiki] Update of "treeHandler" by SebastienLever
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.
The following page has been changed by SebastienLever:
http://wiki.apache.org/myfaces/treeHandler
New page:
=== tabChangeListener ===
__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");
}
}
}}}