myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sless...@apache.org
Subject svn commit: r740940 [7/9] - in /myfaces/core/branches/2_0_0: api/src/main/java/javax/faces/webapp/pdl/facelets/ api/src/main/resources/META-INF/ impl/src/main/java/com/ impl/src/main/java/com/sun/ impl/src/main/java/com/sun/facelets/ impl/src/main/java...
Date Wed, 04 Feb 2009 23:55:29 GMT
Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ActionListenerHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ActionListenerHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ActionListenerHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ActionListenerHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,166 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.ActionSource;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributeException;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.jsf.ComponentSupport;
+import com.sun.facelets.util.ReflectionUtil;
+
+/**
+ * Register an ActionListener instance on the UIComponent associated with the closest parent UIComponent custom action.
+ * <p/> See <a target="_new"
+ * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/actionListener.html">tag documentation</a>.
+ * 
+ * @see javax.faces.event.ActionListener
+ * @see javax.faces.component.ActionSource
+ * @author Jacob Hookom
+ * @version $Id: ActionListenerHandler.java,v 1.7 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class ActionListenerHandler extends TagHandler
+{
+
+    private final static class LazyActionListener implements ActionListener, Serializable
+    {
+
+        private static final long serialVersionUID = -9202120013153262119L;
+
+        private final String type;
+        private final ValueExpression binding;
+
+        public LazyActionListener(String type, ValueExpression binding)
+        {
+            this.type = type;
+            this.binding = binding;
+        }
+
+        public void processAction(ActionEvent event) throws AbortProcessingException
+        {
+            ActionListener instance = null;
+            FacesContext faces = FacesContext.getCurrentInstance();
+            if (faces == null)
+            {
+                return;
+            }
+            if (this.binding != null)
+            {
+                instance = (ActionListener) binding.getValue(faces.getELContext());
+            }
+            if (instance == null && this.type != null)
+            {
+                try
+                {
+                    instance = (ActionListener) ReflectionUtil.forName(this.type).newInstance();
+                }
+                catch (Exception e)
+                {
+                    throw new AbortProcessingException("Couldn't Lazily instantiate ValueChangeListener", e);
+                }
+                if (this.binding != null)
+                {
+                    binding.setValue(faces.getELContext(), instance);
+                }
+            }
+            if (instance != null)
+            {
+                instance.processAction(event);
+            }
+        }
+    }
+
+    private final TagAttribute binding;
+
+    private final String listenerType;
+
+    /**
+     * @param config
+     */
+    public ActionListenerHandler(TagConfig config)
+    {
+        super(config);
+        this.binding = this.getAttribute("binding");
+        TagAttribute type = this.getAttribute("type");
+        if (type != null)
+        {
+            if (!type.isLiteral())
+            {
+                throw new TagAttributeException(type, "Must be a literal class name of type ActionListener");
+            }
+            else
+            {
+                // test it out
+                try
+                {
+                    ReflectionUtil.forName(type.getValue());
+                }
+                catch (ClassNotFoundException e)
+                {
+                    throw new TagAttributeException(type, "Couldn't qualify ActionListener", e);
+                }
+            }
+            this.listenerType = type.getValue();
+        }
+        else
+        {
+            this.listenerType = null;
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see javax.faces.webapp.pdl.facelets.FaceletHandler#apply(javax.faces.webapp.pdl.facelets.FaceletContext, javax.faces.component.UIComponent)
+     */
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        if (parent instanceof ActionSource)
+        {
+            if (ComponentSupport.isNew(parent))
+            {
+                ActionSource as = (ActionSource) parent;
+                ValueExpression b = null;
+                if (this.binding != null)
+                {
+                    b = this.binding.getValueExpression(ctx, ActionListener.class);
+                }
+                ActionListener listener = new LazyActionListener(this.listenerType, b);
+                as.addActionListener(listener);
+            }
+        }
+        else
+        {
+            throw new TagException(this.tag, "Parent is not of type ActionSource, type is: " + parent);
+        }
+    }
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/AttributeHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/AttributeHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/AttributeHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/AttributeHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,88 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.el.ELAdaptor;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * Sets the specified name and attribute on the parent UIComponent. If the "value" specified is not a literal, it will
+ * instead set the ValueExpression on the UIComponent. <p /> See <a target="_new"
+ * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/attribute.html">tag documentation</a>.
+ * 
+ * @see javax.faces.component.UIComponent#getAttributes()
+ * @see javax.faces.component.UIComponent#setValueExpression(java.lang.String, javax.el.ValueExpression)
+ * @author Jacob Hookom
+ * @version $Id: AttributeHandler.java,v 1.3 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class AttributeHandler extends TagHandler
+{
+
+    private final TagAttribute name;
+
+    private final TagAttribute value;
+
+    /**
+     * @param config
+     */
+    public AttributeHandler(TagConfig config)
+    {
+        super(config);
+        this.name = this.getRequiredAttribute("name");
+        this.value = this.getRequiredAttribute("value");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see javax.faces.webapp.pdl.facelets.FaceletHandler#apply(javax.faces.webapp.pdl.facelets.FaceletContext, javax.faces.component.UIComponent)
+     */
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        if (parent == null)
+        {
+            throw new TagException(this.tag, "Parent UIComponent was null");
+        }
+
+        // only process if the parent is new to the tree
+        if (parent.getParent() == null)
+        {
+            String n = this.name.getValue(ctx);
+            if (!parent.getAttributes().containsKey(n))
+            {
+                if (this.value.isLiteral())
+                {
+                    parent.getAttributes().put(n, this.value.getValue());
+                }
+                else
+                {
+                    ELAdaptor.setExpression(parent, n, this.value.getValueExpression(ctx, Object.class));
+                }
+            }
+        }
+    }
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertDateTimeHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertDateTimeHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertDateTimeHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertDateTimeHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,142 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.util.TimeZone;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.convert.Converter;
+import javax.faces.convert.DateTimeConverter;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributeException;
+import com.sun.facelets.tag.jsf.ComponentSupport;
+import com.sun.facelets.tag.jsf.ConvertHandler;
+import com.sun.facelets.tag.jsf.ConverterConfig;
+
+/**
+ * Register a DateTimeConverter instance on the UIComponent associated with the closest parent UIComponent custom
+ * action. <p/> See <a target="_new"
+ * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/convertDateTime.html">tag documentation</a>.
+ * 
+ * @author Jacob Hookom
+ * @version $Id: ConvertDateTimeHandler.java,v 1.6 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class ConvertDateTimeHandler extends ConvertHandler
+{
+
+    private final TagAttribute dateStyle;
+
+    private final TagAttribute locale;
+
+    private final TagAttribute pattern;
+
+    private final TagAttribute timeStyle;
+
+    private final TagAttribute timeZone;
+
+    private final TagAttribute type;
+
+    /**
+     * @param config
+     */
+    public ConvertDateTimeHandler(ConverterConfig config)
+    {
+        super(config);
+        this.dateStyle = this.getAttribute("dateStyle");
+        this.locale = this.getAttribute("locale");
+        this.pattern = this.getAttribute("pattern");
+        this.timeStyle = this.getAttribute("timeStyle");
+        this.timeZone = this.getAttribute("timeZone");
+        this.type = this.getAttribute("type");
+    }
+
+    /**
+     * Returns a new DateTimeConverter
+     * 
+     * @see DateTimeConverter
+     * @see com.sun.facelets.tag.jsf.ConvertHandler#createConverter(javax.faces.webapp.pdl.facelets.FaceletContext)
+     */
+    protected Converter createConverter(FaceletContext ctx) throws FacesException, ELException, FaceletException
+    {
+        return ctx.getFacesContext().getApplication().createConverter(DateTimeConverter.CONVERTER_ID);
+
+    }
+
+    /**
+     * Implements tag spec, see taglib documentation.
+     * 
+     * @see com.sun.facelets.tag.ObjectHandler#setAttributes(javax.faces.webapp.pdl.facelets.FaceletContext, java.lang.Object)
+     */
+    protected void setAttributes(FaceletContext ctx, Object obj)
+    {
+        DateTimeConverter c = (DateTimeConverter) obj;
+        if (this.locale != null)
+        {
+            c.setLocale(ComponentSupport.getLocale(ctx, this.locale));
+        }
+        if (this.pattern != null)
+        {
+            c.setPattern(this.pattern.getValue(ctx));
+        }
+        else
+        {
+            if (this.type != null)
+            {
+                c.setType(this.type.getValue(ctx));
+            }
+            if (this.dateStyle != null)
+            {
+                c.setDateStyle(this.dateStyle.getValue(ctx));
+            }
+            if (this.timeStyle != null)
+            {
+                c.setTimeStyle(this.timeStyle.getValue(ctx));
+            }
+        }
+
+        if (this.timeZone != null)
+        {
+            Object t = this.timeZone.getObject(ctx);
+            if (t != null)
+            {
+                if (t instanceof TimeZone)
+                {
+                    c.setTimeZone((TimeZone) t);
+                }
+                else if (t instanceof String)
+                {
+                    TimeZone tz = TimeZone.getTimeZone((String) t);
+                    c.setTimeZone(tz);
+                }
+                else
+                {
+                    throw new TagAttributeException(this.tag, this.timeZone,
+                                                    "Illegal TimeZone, must evaluate to either a java.util.TimeZone or String, is type: "
+                                                            + t.getClass());
+                }
+            }
+        }
+    }
+
+    protected MetaRuleset createMetaRuleset(Class type)
+    {
+        return super.createMetaRuleset(type).ignoreAll();
+    }
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertDelegateHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertDelegateHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertDelegateHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertDelegateHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,65 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.convert.Converter;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.jsf.ConvertHandler;
+import com.sun.facelets.tag.jsf.ConverterConfig;
+
+/**
+ * Register a named Converter instance on the UIComponent associated with the closest parent UIComponent custom action.
+ * <p/> See <a target="_new" href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/converter.html">tag
+ * documentation</a>.
+ * 
+ * @author Jacob Hookom
+ * @version $Id: ConvertDelegateHandler.java,v 1.4 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class ConvertDelegateHandler extends ConvertHandler
+{
+
+    private final TagAttribute converterId;
+
+    /**
+     * @param config
+     */
+    public ConvertDelegateHandler(ConverterConfig config)
+    {
+        super(config);
+        this.converterId = this.getRequiredAttribute("converterId");
+    }
+
+    /**
+     * Uses the specified "converterId" to pull an instance from the Application
+     * 
+     * @see javax.faces.application.Application#createComponent(java.lang.String)
+     * @see com.sun.facelets.tag.jsf.ConverterHandler#createConverter(javax.faces.webapp.pdl.facelets.FaceletContext)
+     */
+    protected Converter createConverter(FaceletContext ctx) throws FacesException, ELException, FaceletException
+    {
+        return ctx.getFacesContext().getApplication().createConverter(this.converterId.getValue(ctx));
+    }
+
+    protected MetaRuleset createMetaRuleset(Class type)
+    {
+        return super.createMetaRuleset(type).ignoreAll();
+    }
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertNumberHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertNumberHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertNumberHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ConvertNumberHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,83 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.convert.Converter;
+import javax.faces.convert.NumberConverter;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.jsf.ComponentSupport;
+import com.sun.facelets.tag.jsf.ConvertHandler;
+import com.sun.facelets.tag.jsf.ConverterConfig;
+
+/**
+ * Register a NumberConverter instance on the UIComponent associated with the closest parent UIComponent custom action.
+ * <p/> See <a target="_new"
+ * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/convertNumber.html">tag documentation</a>.
+ * 
+ * @author Jacob Hookom
+ * @version $Id: ConvertNumberHandler.java,v 1.4 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class ConvertNumberHandler extends ConvertHandler
+{
+
+    private final TagAttribute locale;
+
+    /**
+     * @param config
+     */
+    public ConvertNumberHandler(ConverterConfig config)
+    {
+        super(config);
+        this.locale = this.getAttribute("locale");
+    }
+
+    /**
+     * Returns a new NumberConverter
+     * 
+     * @see NumberConverter
+     * @see com.sun.facelets.tag.jsf.ConverterHandler#createConverter(javax.faces.webapp.pdl.facelets.FaceletContext)
+     */
+    protected Converter createConverter(FaceletContext ctx) throws FacesException, ELException, FaceletException
+    {
+        return ctx.getFacesContext().getApplication().createConverter(NumberConverter.CONVERTER_ID);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.sun.facelets.tag.ObjectHandler#setAttributes(javax.faces.webapp.pdl.facelets.FaceletContext, java.lang.Object)
+     */
+    protected void setAttributes(FaceletContext ctx, Object obj)
+    {
+        super.setAttributes(ctx, obj);
+        NumberConverter c = (NumberConverter) obj;
+        if (this.locale != null)
+        {
+            c.setLocale(ComponentSupport.getLocale(ctx, this.locale));
+        }
+    }
+
+    protected MetaRuleset createMetaRuleset(Class type)
+    {
+        return super.createMetaRuleset(type).ignore("locale");
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/CoreLibrary.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/CoreLibrary.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/CoreLibrary.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/CoreLibrary.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,87 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIParameter;
+import javax.faces.component.UISelectItem;
+import javax.faces.component.UISelectItems;
+import javax.faces.convert.DateTimeConverter;
+import javax.faces.convert.NumberConverter;
+import javax.faces.validator.DoubleRangeValidator;
+import javax.faces.validator.LengthValidator;
+import javax.faces.validator.LongRangeValidator;
+
+import com.sun.facelets.tag.AbstractTagLibrary;
+
+/**
+ * For Tag details, see JSF Core <a target="_new"
+ * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/tld-summary.html">taglib documentation</a>.
+ * 
+ * @author Jacob Hookom
+ * @version $Id: CoreLibrary.java,v 1.13 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class CoreLibrary extends AbstractTagLibrary
+{
+
+    public final static String Namespace = "http://java.sun.com/jsf/core";
+
+    public final static CoreLibrary Instance = new CoreLibrary();
+
+    public CoreLibrary()
+    {
+        super(Namespace);
+
+        this.addTagHandler("actionListener", ActionListenerHandler.class);
+
+        this.addTagHandler("attribute", AttributeHandler.class);
+
+        this.addConverter("convertDateTime", DateTimeConverter.CONVERTER_ID, ConvertDateTimeHandler.class);
+
+        this.addConverter("convertNumber", NumberConverter.CONVERTER_ID, ConvertNumberHandler.class);
+
+        this.addConverter("converter", null, ConvertDelegateHandler.class);
+
+        this.addTagHandler("facet", FacetHandler.class);
+
+        this.addTagHandler("loadBundle", LoadBundleHandler.class);
+
+        this.addComponent("param", UIParameter.COMPONENT_TYPE, null);
+
+        this.addTagHandler("phaseListener", PhaseListenerHandler.class);
+
+        this.addComponent("selectItem", UISelectItem.COMPONENT_TYPE, null);
+
+        this.addComponent("selectItems", UISelectItems.COMPONENT_TYPE, null);
+
+        this.addTagHandler("setPropertyActionListener", SetPropertyActionListenerHandler.class);
+
+        this.addComponent("subview", "javax.faces.NamingContainer", null);
+
+        this.addValidator("validateLength", LengthValidator.VALIDATOR_ID);
+
+        this.addValidator("validateLongRange", LongRangeValidator.VALIDATOR_ID);
+
+        this.addValidator("validateDoubleRange", DoubleRangeValidator.VALIDATOR_ID);
+
+        this.addValidator("validator", null, ValidateDelegateHandler.class);
+
+        this.addTagHandler("valueChangeListener", ValueChangeListenerHandler.class);
+
+        this.addTagHandler("view", ViewHandler.class);
+
+        this.addComponent("verbatim", "javax.faces.HtmlOutputText", "javax.faces.Text", VerbatimHandler.class);
+    }
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/FacetHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/FacetHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/FacetHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/FacetHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,73 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * Register a named facet on the UIComponent associated with the closest parent UIComponent custom action. <p/> See <a
+ * target="_new" href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/facet.html">tag documentation</a>.
+ * 
+ * @author Jacob Hookom
+ * @version $Id: FacetHandler.java,v 1.8 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class FacetHandler extends TagHandler
+{
+
+    public static final String KEY = "facelets.FACET_NAME";
+
+    protected final TagAttribute name;
+
+    public FacetHandler(TagConfig config)
+    {
+        super(config);
+        this.name = this.getRequiredAttribute("name");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see javax.faces.webapp.pdl.facelets.FaceletHandler#apply(javax.faces.webapp.pdl.facelets.FaceletContext, javax.faces.component.UIComponent)
+     */
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        if (parent == null)
+        {
+            throw new TagException(this.tag, "Parent UIComponent was null");
+        }
+        parent.getAttributes().put(KEY, this.name.getValue(ctx));
+        try
+        {
+            this.nextHandler.apply(ctx, parent);
+        }
+        finally
+        {
+            parent.getAttributes().remove(KEY);
+        }
+    }
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/LoadBundleHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/LoadBundleHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/LoadBundleHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/LoadBundleHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,241 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.Set;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributeException;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.jsf.ComponentSupport;
+
+/**
+ * Load a resource bundle localized for the Locale of the current view, and expose it (as a Map) in the request
+ * attributes of the current request. <p/> See <a target="_new"
+ * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/loadBundle.html">tag documentation</a>.
+ * 
+ * @author Jacob Hookom
+ * @version $Id: LoadBundleHandler.java,v 1.4 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class LoadBundleHandler extends TagHandler
+{
+
+    private final static class ResourceBundleMap implements Map
+    {
+        private final static class ResourceEntry implements Map.Entry
+        {
+
+            protected final String key;
+
+            protected final String value;
+
+            public ResourceEntry(String key, String value)
+            {
+                this.key = key;
+                this.value = value;
+            }
+
+            public Object getKey()
+            {
+                return this.key;
+            }
+
+            public Object getValue()
+            {
+                return this.value;
+            }
+
+            public Object setValue(Object value)
+            {
+                throw new UnsupportedOperationException();
+            }
+
+            public int hashCode()
+            {
+                return this.key.hashCode();
+            }
+
+            public boolean equals(Object obj)
+            {
+                return (obj instanceof ResourceEntry && this.hashCode() == obj.hashCode());
+            }
+        }
+
+        protected final ResourceBundle bundle;
+
+        public ResourceBundleMap(ResourceBundle bundle)
+        {
+            this.bundle = bundle;
+        }
+
+        public void clear()
+        {
+            throw new UnsupportedOperationException();
+        }
+
+        public boolean containsKey(Object key)
+        {
+            try
+            {
+                bundle.getString(key.toString());
+                return true;
+            }
+            catch (MissingResourceException e)
+            {
+                return false;
+            }
+        }
+
+        public boolean containsValue(Object value)
+        {
+            throw new UnsupportedOperationException();
+        }
+
+        public Set entrySet()
+        {
+            Enumeration e = this.bundle.getKeys();
+            Set s = new HashSet();
+            String k;
+            while (e.hasMoreElements())
+            {
+                k = (String) e.nextElement();
+                s.add(new ResourceEntry(k, this.bundle.getString(k)));
+            }
+            return s;
+        }
+
+        public Object get(Object key)
+        {
+            try
+            {
+                return this.bundle.getObject((String) key);
+            }
+            catch (java.util.MissingResourceException mre)
+            {
+                return "???" + key + "???";
+            }
+        }
+
+        public boolean isEmpty()
+        {
+            return false;
+        }
+
+        public Set keySet()
+        {
+            Enumeration e = this.bundle.getKeys();
+            Set s = new HashSet();
+            while (e.hasMoreElements())
+            {
+                s.add(e.nextElement());
+            }
+            return s;
+        }
+
+        public Object put(Object key, Object value)
+        {
+            throw new UnsupportedOperationException();
+        }
+
+        public void putAll(Map t)
+        {
+            throw new UnsupportedOperationException();
+        }
+
+        public Object remove(Object key)
+        {
+            throw new UnsupportedOperationException();
+        }
+
+        public int size()
+        {
+            return this.keySet().size();
+        }
+
+        public Collection values()
+        {
+            Enumeration e = this.bundle.getKeys();
+            Set s = new HashSet();
+            while (e.hasMoreElements())
+            {
+                s.add(this.bundle.getObject((String) e.nextElement()));
+            }
+            return s;
+        }
+    }
+
+    private final TagAttribute basename;
+
+    private final TagAttribute var;
+
+    /**
+     * @param config
+     */
+    public LoadBundleHandler(TagConfig config)
+    {
+        super(config);
+        this.basename = this.getRequiredAttribute("basename");
+        this.var = this.getRequiredAttribute("var");
+    }
+
+    /**
+     * See taglib documentation.
+     * 
+     * @see javax.faces.webapp.pdl.facelets.FaceletHandler#apply(javax.faces.webapp.pdl.facelets.FaceletContext, javax.faces.component.UIComponent)
+     */
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent);
+        ResourceBundle bundle = null;
+        try
+        {
+            String name = this.basename.getValue(ctx);
+            ClassLoader cl = Thread.currentThread().getContextClassLoader();
+            if (root != null && root.getLocale() != null)
+            {
+                bundle = ResourceBundle.getBundle(name, root.getLocale(), cl);
+            }
+            else
+            {
+                bundle = ResourceBundle.getBundle(name, Locale.getDefault(), cl);
+            }
+        }
+        catch (Exception e)
+        {
+            throw new TagAttributeException(this.tag, this.basename, e);
+        }
+        ResourceBundleMap map = new ResourceBundleMap(bundle);
+        FacesContext faces = ctx.getFacesContext();
+        faces.getExternalContext().getRequestMap().put(this.var.getValue(ctx), map);
+    }
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/PhaseListenerHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/PhaseListenerHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/PhaseListenerHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/PhaseListenerHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,171 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributeException;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.jsf.ComponentSupport;
+import com.sun.facelets.util.ReflectionUtil;
+
+public class PhaseListenerHandler extends TagHandler
+{
+
+    private final static class LazyPhaseListener implements PhaseListener, Serializable
+    {
+
+        private static final long serialVersionUID = -6496143057319213401L;
+
+        private final String type;
+
+        private final ValueExpression binding;
+
+        public LazyPhaseListener(String type, ValueExpression binding)
+        {
+            this.type = type;
+            this.binding = binding;
+        }
+
+        private PhaseListener getInstance()
+        {
+            PhaseListener instance = null;
+            FacesContext faces = FacesContext.getCurrentInstance();
+            if (faces == null)
+            {
+                return null;
+            }
+            if (this.binding != null)
+            {
+                instance = (PhaseListener) binding.getValue(faces.getELContext());
+            }
+            if (instance == null && type != null)
+            {
+                try
+                {
+                    instance = (PhaseListener) ReflectionUtil.forName(this.type).newInstance();
+                }
+                catch (Exception e)
+                {
+                    throw new AbortProcessingException("Couldn't Lazily instantiate PhaseListener", e);
+                }
+                if (this.binding != null)
+                {
+                    binding.setValue(faces.getELContext(), instance);
+                }
+            }
+            return instance;
+        }
+
+        public void afterPhase(PhaseEvent event)
+        {
+            PhaseListener pl = this.getInstance();
+            if (pl != null)
+            {
+                pl.afterPhase(event);
+            }
+        }
+
+        public void beforePhase(PhaseEvent event)
+        {
+            PhaseListener pl = this.getInstance();
+            if (pl != null)
+            {
+                pl.beforePhase(event);
+            }
+        }
+
+        public PhaseId getPhaseId()
+        {
+            PhaseListener pl = this.getInstance();
+            return (pl != null) ? pl.getPhaseId() : PhaseId.ANY_PHASE;
+        }
+
+    }
+
+    private final TagAttribute binding;
+
+    private final String listenerType;
+
+    public PhaseListenerHandler(TagConfig config)
+    {
+        super(config);
+        TagAttribute type = this.getAttribute("type");
+        this.binding = this.getAttribute("binding");
+        if (type != null)
+        {
+            if (!type.isLiteral())
+            {
+                throw new TagAttributeException(type, "Must be a literal class name of type PhaseListener");
+            }
+            else
+            {
+                // test it out
+                try
+                {
+                    ReflectionUtil.forName(type.getValue());
+                }
+                catch (ClassNotFoundException e)
+                {
+                    throw new TagAttributeException(type, "Couldn't qualify PhaseListener", e);
+                }
+            }
+            this.listenerType = type.getValue();
+        }
+        else
+        {
+            this.listenerType = null;
+        }
+    }
+
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        if (ComponentSupport.isNew(parent))
+        {
+            UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent);
+            if (root == null)
+            {
+                throw new TagException(this.tag, "UIViewRoot not available");
+            }
+            ValueExpression b = null;
+            if (this.binding != null)
+            {
+                b = this.binding.getValueExpression(ctx, PhaseListener.class);
+            }
+
+            PhaseListener pl = new LazyPhaseListener(this.listenerType, b);
+
+            root.addPhaseListener(pl);
+        }
+    }
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,142 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.ActionSource;
+import javax.faces.component.ActionSource2;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.el.LegacyValueBinding;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.jsf.ComponentSupport;
+import com.sun.facelets.util.FacesAPI;
+
+public class SetPropertyActionListenerHandler extends TagHandler
+{
+
+    private final TagAttribute value;
+
+    private final TagAttribute target;
+
+    public SetPropertyActionListenerHandler(TagConfig config)
+    {
+        super(config);
+        this.value = this.getRequiredAttribute("value");
+        this.target = this.getRequiredAttribute("target");
+    }
+
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        if (parent instanceof ActionSource)
+        {
+            ActionSource src = (ActionSource) parent;
+            if (ComponentSupport.isNew(parent))
+            {
+                ValueExpression valueExpr = this.value.getValueExpression(ctx, Object.class);
+                ValueExpression targetExpr = this.target.getValueExpression(ctx, Object.class);
+
+                ActionListener listener;
+
+                if (FacesAPI.getVersion() >= 12 && src instanceof ActionSource2)
+                {
+                    listener = new SetPropertyListener(valueExpr, targetExpr);
+                }
+                else
+                {
+                    listener = new LegacySetPropertyListener(new LegacyValueBinding(valueExpr),
+                                                             new LegacyValueBinding(targetExpr));
+                }
+
+                src.addActionListener(listener);
+            }
+        }
+        else
+        {
+            throw new TagException(this.tag, "Parent is not of type ActionSource, type is: " + parent);
+        }
+    }
+
+    private static class LegacySetPropertyListener implements ActionListener, Serializable
+    {
+
+        private ValueBinding value;
+
+        private ValueBinding target;
+
+        public LegacySetPropertyListener()
+        {
+        };
+
+        public LegacySetPropertyListener(ValueBinding value, ValueBinding target)
+        {
+            this.value = value;
+            this.target = target;
+        }
+
+        public void processAction(ActionEvent evt) throws AbortProcessingException
+        {
+            FacesContext faces = FacesContext.getCurrentInstance();
+            Object valueObj = this.value.getValue(faces);
+            this.target.setValue(faces, valueObj);
+        }
+
+    }
+
+    private static class SetPropertyListener implements ActionListener, Serializable
+    {
+
+        private ValueExpression value;
+
+        private ValueExpression target;
+
+        public SetPropertyListener()
+        {
+        };
+
+        public SetPropertyListener(ValueExpression value, ValueExpression target)
+        {
+            this.value = value;
+            this.target = target;
+        }
+
+        public void processAction(ActionEvent evt) throws AbortProcessingException
+        {
+            FacesContext faces = FacesContext.getCurrentInstance();
+            ELContext el = faces.getELContext();
+            Object valueObj = this.value.getValue(el);
+            this.target.setValue(el, valueObj);
+        }
+
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ValidateDelegateHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ValidateDelegateHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ValidateDelegateHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ValidateDelegateHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,60 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import javax.faces.validator.Validator;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.jsf.ValidateHandler;
+import com.sun.facelets.tag.jsf.ValidatorConfig;
+
+/**
+ * Register a named Validator instance on the UIComponent associated with the closest parent UIComponent custom
+ * action.<p/> See <a target="_new"
+ * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/validator.html">tag documentation</a>.
+ * 
+ * @author Jacob Hookom
+ * @version $Id: ValidateDelegateHandler.java,v 1.4 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class ValidateDelegateHandler extends ValidateHandler
+{
+
+    private final TagAttribute validatorId;
+
+    public ValidateDelegateHandler(ValidatorConfig config)
+    {
+        super(config);
+        this.validatorId = this.getRequiredAttribute("validatorId");
+    }
+
+    /**
+     * Uses the specified "validatorId" to get a new Validator instance from the Application.
+     * 
+     * @see javax.faces.application.Application#createValidator(java.lang.String)
+     * @see com.sun.facelets.tag.jsf.ValidateHandler#createValidator(javax.faces.webapp.pdl.facelets.FaceletContext)
+     */
+    protected Validator createValidator(FaceletContext ctx)
+    {
+        return ctx.getFacesContext().getApplication().createValidator(this.validatorId.getValue(ctx));
+    }
+
+    protected MetaRuleset createMetaRuleset(Class type)
+    {
+        return super.createMetaRuleset(type).ignoreAll();
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ValueChangeListenerHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ValueChangeListenerHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ValueChangeListenerHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ValueChangeListenerHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,163 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.event.ValueChangeListener;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributeException;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.jsf.ComponentSupport;
+import com.sun.facelets.util.ReflectionUtil;
+
+/**
+ * Register an ValueChangeListener instance on the UIComponent associated with the closest parent UIComponent custom
+ * action.<p/> See <a target="_new"
+ * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/valueChangeListener.html">tag documentation</a>.
+ * 
+ * @author Jacob Hookom
+ * @version $Id: ValueChangeListenerHandler.java,v 1.2 2005/08/24 04:38:50 jhook Exp $
+ */
+public final class ValueChangeListenerHandler extends TagHandler
+{
+
+    private static class LazyValueChangeListener implements ValueChangeListener, Serializable
+    {
+
+        private static final long serialVersionUID = 7613811124326963180L;
+
+        private final String type;
+
+        private final ValueExpression binding;
+
+        public LazyValueChangeListener(String type, ValueExpression binding)
+        {
+            this.type = type;
+            this.binding = binding;
+        }
+
+        public void processValueChange(ValueChangeEvent event) throws AbortProcessingException
+        {
+            ValueChangeListener instance = null;
+            FacesContext faces = FacesContext.getCurrentInstance();
+            if (faces == null)
+            {
+                return;
+            }
+            if (this.binding != null)
+            {
+                instance = (ValueChangeListener) binding.getValue(faces.getELContext());
+            }
+            if (instance == null && this.type != null)
+            {
+                try
+                {
+                    instance = (ValueChangeListener) ReflectionUtil.forName(this.type).newInstance();
+                }
+                catch (Exception e)
+                {
+                    throw new AbortProcessingException("Couldn't Lazily instantiate ValueChangeListener", e);
+                }
+                if (this.binding != null)
+                {
+                    binding.setValue(faces.getELContext(), instance);
+                }
+            }
+            if (instance != null)
+            {
+                instance.processValueChange(event);
+            }
+        }
+    }
+
+    private final TagAttribute binding;
+
+    private final String listenerType;
+
+    public ValueChangeListenerHandler(TagConfig config)
+    {
+        super(config);
+        this.binding = this.getAttribute("binding");
+        TagAttribute type = this.getAttribute("type");
+        if (type != null)
+        {
+            if (!type.isLiteral())
+            {
+                throw new TagAttributeException(type, "Must be a literal class name of type ValueChangeListener");
+            }
+            else
+            {
+                // test it out
+                try
+                {
+                    ReflectionUtil.forName(type.getValue());
+                }
+                catch (ClassNotFoundException e)
+                {
+                    throw new TagAttributeException(type, "Couldn't qualify ValueChangeListener", e);
+                }
+            }
+            this.listenerType = type.getValue();
+        }
+        else
+        {
+            this.listenerType = null;
+        }
+    }
+
+    /**
+     * See taglib documentation.
+     * 
+     * @see javax.faces.webapp.pdl.facelets.FaceletHandler#apply(javax.faces.webapp.pdl.facelets.FaceletContext, javax.faces.component.UIComponent)
+     */
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        if (parent instanceof EditableValueHolder)
+        {
+            if (ComponentSupport.isNew(parent))
+            {
+                EditableValueHolder evh = (EditableValueHolder) parent;
+                ValueExpression b = null;
+                if (this.binding != null)
+                {
+                    b = this.binding.getValueExpression(ctx, ValueChangeListener.class);
+                }
+                ValueChangeListener listener = new LazyValueChangeListener(this.listenerType, b);
+                evh.addValueChangeListener(listener);
+            }
+        }
+        else
+        {
+            throw new TagException(this.tag, "Parent is not of type EditableValueHolder, type is: " + parent);
+        }
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/VerbatimHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/VerbatimHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/VerbatimHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/VerbatimHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,59 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.el.ELException;
+import javax.faces.component.UIComponent;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import com.sun.facelets.tag.TextHandler;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+
+/**
+ * Handler for f:verbatim
+ * 
+ * @author Adam Winer
+ * @version $Id: VerbatimHandler.java,v 1.3 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class VerbatimHandler extends ComponentHandler
+{
+    public VerbatimHandler(ComponentConfig config)
+    {
+        super(config);
+    }
+
+    protected void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent)
+    {
+        StringBuffer content = new StringBuffer();
+        Iterator iter = findNextByType(TextHandler.class);
+        while (iter.hasNext())
+        {
+            TextHandler text = (TextHandler) iter.next();
+            content.append(text.getText(ctx));
+        }
+
+        c.getAttributes().put("value", content.toString());
+        c.getAttributes().put("escape", Boolean.FALSE);
+        c.setTransient(true);
+    }
+
+    protected void applyNextHandler(FaceletContext ctx, UIComponent c)
+    {
+    }
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ViewHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ViewHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ViewHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/ViewHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,116 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.core;
+
+import java.io.IOException;
+import java.util.logging.Logger;
+
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.event.PhaseEvent;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.jsf.ComponentSupport;
+
+/**
+ * Container for all JavaServer Faces core and custom component actions used on a page. <p/> See <a target="_new"
+ * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/view.html">tag documentation</a>.
+ * 
+ * @author Jacob Hookom
+ * @version $Id: ViewHandler.java,v 1.5 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class ViewHandler extends TagHandler
+{
+
+    private final static Class[] LISTENER_SIG = new Class[] { PhaseEvent.class };
+
+    private final TagAttribute locale;
+
+    private final TagAttribute renderKitId;
+
+    private final TagAttribute contentType;
+
+    private final TagAttribute encoding;
+
+    private final TagAttribute beforePhaseListener;
+
+    private final TagAttribute afterPhaseListener;
+
+    /**
+     * @param config
+     */
+    public ViewHandler(TagConfig config)
+    {
+        super(config);
+        this.locale = this.getAttribute("locale");
+        this.renderKitId = this.getAttribute("renderKitId");
+        this.contentType = this.getAttribute("contentType");
+        this.encoding = this.getAttribute("encoding");
+        this.beforePhaseListener = this.getAttribute("beforePhaseListener");
+        this.afterPhaseListener = this.getAttribute("afterPhaseListener");
+    }
+
+    /**
+     * See taglib documentation.
+     * 
+     * @see javax.faces.webapp.pdl.facelets.FaceletHandler#apply(javax.faces.webapp.pdl.facelets.FaceletContext, javax.faces.component.UIComponent)
+     */
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent);
+        if (root != null)
+        {
+            if (this.locale != null)
+            {
+                root.setLocale(ComponentSupport.getLocale(ctx, this.locale));
+            }
+            if (this.renderKitId != null)
+            {
+                String v = this.renderKitId.getValue(ctx);
+                root.setRenderKitId(v);
+            }
+            if (this.contentType != null)
+            {
+                String v = this.contentType.getValue(ctx);
+                ctx.getFacesContext().getExternalContext().getRequestMap().put("facelets.ContentType", v);
+            }
+            if (this.encoding != null)
+            {
+                String v = this.encoding.getValue(ctx);
+                ctx.getFacesContext().getExternalContext().getRequestMap().put("facelets.Encoding", v);
+            }
+            if (this.beforePhaseListener != null)
+            {
+                MethodExpression m = this.beforePhaseListener.getMethodExpression(ctx, null, LISTENER_SIG);
+                root.setBeforePhaseListener(m);
+            }
+            if (this.afterPhaseListener != null)
+            {
+                MethodExpression m = this.afterPhaseListener.getMethodExpression(ctx, null, LISTENER_SIG);
+                root.setAfterPhaseListener(m);
+            }
+        }
+        this.nextHandler.apply(ctx, parent);
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/package.html
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/package.html?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/package.html (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/core/package.html Wed Feb  4 23:55:25 2009
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: package.html,v 1.3 2008/07/13 19:01:44 rlubke Exp $
+-->
+</head>
+<body bgcolor="white">
+Tag Library for <b><a target="_new" href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/tld-summary.html">http://java.sun.com/jsf/core</a></b>.
+See JSF Core Tag Javadocs for attributes/functionality.
+</body>
+</html>
\ No newline at end of file

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/AbstractHtmlLibrary.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/AbstractHtmlLibrary.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/AbstractHtmlLibrary.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/AbstractHtmlLibrary.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,39 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.html;
+
+import com.sun.facelets.tag.AbstractTagLibrary;
+
+/**
+ * @author Jacob Hookom
+ * @version $Id: AbstractHtmlLibrary.java,v 1.3 2008/07/13 19:01:50 rlubke Exp $
+ */
+public abstract class AbstractHtmlLibrary extends AbstractTagLibrary
+{
+
+    /**
+     * @param namespace
+     */
+    public AbstractHtmlLibrary(String namespace)
+    {
+        super(namespace);
+    }
+
+    public void addHtmlComponent(String name, String componentType, String rendererType)
+    {
+        super.addComponent(name, componentType, rendererType, HtmlComponentHandler.class);
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlComponentHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlComponentHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlComponentHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlComponentHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,41 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.html;
+
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+
+/**
+ * @author Jacob Hookom
+ * @version $Id: HtmlComponentHandler.java,v 1.3 2008/07/13 19:01:50 rlubke Exp $
+ */
+public class HtmlComponentHandler extends ComponentHandler
+{
+
+    /**
+     * @param config
+     */
+    public HtmlComponentHandler(ComponentConfig config)
+    {
+        super(config);
+    }
+
+    protected MetaRuleset createMetaRuleset(Class type)
+    {
+        return super.createMetaRuleset(type).alias("class", "styleClass");
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlDecorator.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlDecorator.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlDecorator.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlDecorator.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,104 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.html;
+
+import com.sun.facelets.tag.Tag;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributes;
+import com.sun.facelets.tag.TagDecorator;
+
+/**
+ * @author Jacob Hookom
+ * @version $Id: HtmlDecorator.java,v 1.4 2008/07/13 19:01:50 rlubke Exp $
+ */
+public final class HtmlDecorator implements TagDecorator
+{
+
+    public final static String XhtmlNamespace = "http://www.w3.org/1999/xhtml";
+
+    public final static HtmlDecorator Instance = new HtmlDecorator();
+
+    /**
+     * 
+     */
+    public HtmlDecorator()
+    {
+        super();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.sun.facelets.tag.TagDecorator#decorate(com.sun.facelets.tag.Tag)
+     */
+    public Tag decorate(Tag tag)
+    {
+        if (XhtmlNamespace.equals(tag.getNamespace()))
+        {
+            String n = tag.getLocalName();
+            if ("a".equals(n))
+            {
+                return new Tag(tag.getLocation(), HtmlLibrary.Namespace, "commandLink", tag.getQName(), tag
+                        .getAttributes());
+            }
+            if ("form".equals(n))
+            {
+                return new Tag(tag.getLocation(), HtmlLibrary.Namespace, "form", tag.getQName(), tag.getAttributes());
+            }
+            if ("input".equals(n))
+            {
+                TagAttribute attr = tag.getAttributes().get("type");
+                if (attr != null)
+                {
+                    String t = attr.getValue();
+                    TagAttributes na = removeType(tag.getAttributes());
+                    if ("text".equals(t))
+                    {
+                        return new Tag(tag.getLocation(), HtmlLibrary.Namespace, "inputText", tag.getQName(), na);
+                    }
+                    if ("password".equals(t))
+                    {
+                        return new Tag(tag.getLocation(), HtmlLibrary.Namespace, "inputSecret", tag.getQName(), na);
+                    }
+                    if ("hidden".equals(t))
+                    {
+                        return new Tag(tag.getLocation(), HtmlLibrary.Namespace, "inputHidden", tag.getQName(), na);
+                    }
+                    if ("submit".equals(t))
+                    {
+                        return new Tag(tag.getLocation(), HtmlLibrary.Namespace, "commandButton", tag.getQName(), na);
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    private static TagAttributes removeType(TagAttributes attrs)
+    {
+        TagAttribute[] o = attrs.getAll();
+        TagAttribute[] a = new TagAttribute[o.length - 1];
+        int p = 0;
+        for (int i = 0; i < o.length; i++)
+        {
+            if (!"type".equals(o[i].getLocalName()))
+            {
+                a[p++] = o[i];
+            }
+        }
+        return new TagAttributes(a);
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlLibrary.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlLibrary.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlLibrary.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/HtmlLibrary.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,83 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jsf.html;
+
+/**
+ * @author Jacob Hookom
+ * @version $Id: HtmlLibrary.java,v 1.3 2008/07/13 19:01:50 rlubke Exp $
+ */
+public final class HtmlLibrary extends AbstractHtmlLibrary
+{
+
+    public final static String Namespace = "http://java.sun.com/jsf/html";
+
+    public final static HtmlLibrary Instance = new HtmlLibrary();
+
+    public HtmlLibrary()
+    {
+        super(Namespace);
+
+        this.addHtmlComponent("column", "javax.faces.Column", null);
+
+        this.addHtmlComponent("commandButton", "javax.faces.HtmlCommandButton", "javax.faces.Button");
+
+        this.addHtmlComponent("commandLink", "javax.faces.HtmlCommandLink", "javax.faces.Link");
+
+        this.addHtmlComponent("dataTable", "javax.faces.HtmlDataTable", "javax.faces.Table");
+
+        this.addHtmlComponent("form", "javax.faces.HtmlForm", "javax.faces.Form");
+
+        this.addHtmlComponent("graphicImage", "javax.faces.HtmlGraphicImage", "javax.faces.Image");
+
+        this.addHtmlComponent("inputHidden", "javax.faces.HtmlInputHidden", "javax.faces.Hidden");
+
+        this.addHtmlComponent("inputSecret", "javax.faces.HtmlInputSecret", "javax.faces.Secret");
+
+        this.addHtmlComponent("inputText", "javax.faces.HtmlInputText", "javax.faces.Text");
+
+        this.addHtmlComponent("inputTextarea", "javax.faces.HtmlInputTextarea", "javax.faces.Textarea");
+
+        this.addHtmlComponent("message", "javax.faces.HtmlMessage", "javax.faces.Message");
+
+        this.addHtmlComponent("messages", "javax.faces.HtmlMessages", "javax.faces.Messages");
+
+        this.addHtmlComponent("outputFormat", "javax.faces.HtmlOutputFormat", "javax.faces.Format");
+
+        this.addHtmlComponent("outputLabel", "javax.faces.HtmlOutputLabel", "javax.faces.Label");
+
+        this.addHtmlComponent("outputLink", "javax.faces.HtmlOutputLink", "javax.faces.Link");
+
+        this.addHtmlComponent("outputText", "javax.faces.HtmlOutputText", "javax.faces.Text");
+
+        this.addHtmlComponent("panelGrid", "javax.faces.HtmlPanelGrid", "javax.faces.Grid");
+
+        this.addHtmlComponent("panelGroup", "javax.faces.HtmlPanelGroup", "javax.faces.Group");
+
+        this.addHtmlComponent("selectBooleanCheckbox", "javax.faces.HtmlSelectBooleanCheckbox", "javax.faces.Checkbox");
+
+        this.addHtmlComponent("selectManyCheckbox", "javax.faces.HtmlSelectManyCheckbox", "javax.faces.Checkbox");
+
+        this.addHtmlComponent("selectManyListbox", "javax.faces.HtmlSelectManyListbox", "javax.faces.Listbox");
+
+        this.addHtmlComponent("selectManyMenu", "javax.faces.HtmlSelectManyMenu", "javax.faces.Menu");
+
+        this.addHtmlComponent("selectOneListbox", "javax.faces.HtmlSelectOneListbox", "javax.faces.Listbox");
+
+        this.addHtmlComponent("selectOneMenu", "javax.faces.HtmlSelectOneMenu", "javax.faces.Menu");
+
+        this.addHtmlComponent("selectOneRadio", "javax.faces.HtmlSelectOneRadio", "javax.faces.Radio");
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/package.html
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/package.html?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/package.html (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jsf/html/package.html Wed Feb  4 23:55:25 2009
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: package.html,v 1.3 2008/07/13 19:01:50 rlubke Exp $
+-->
+</head>
+<body bgcolor="white">
+Tag Library for <b><a target="_new" href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/tld-summary.html">http://java.sun.com/jsf/html</a></b>.
+See JSF HTML Tag Javadocs for attributes/functionality.
+</body>
+</html>
\ No newline at end of file

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/CatchHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/CatchHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/CatchHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/CatchHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,63 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jstl.core;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * @author Jacob Hookom
+ * @version $Id: CatchHandler.java,v 1.5 2008/07/13 19:01:43 rlubke Exp $
+ */
+public final class CatchHandler extends TagHandler
+{
+
+    private final TagAttribute var;
+
+    /**
+     * @param config
+     */
+    public CatchHandler(TagConfig config)
+    {
+        super(config);
+        this.var = this.getAttribute("var");
+    }
+
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        try
+        {
+            this.nextHandler.apply(ctx, parent);
+        }
+        catch (Exception e)
+        {
+            if (this.var != null)
+            {
+                ctx.setAttribute(this.var.getValue(ctx), e);
+            }
+        }
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/ChooseHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/ChooseHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/ChooseHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/ChooseHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,88 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jstl.core;
+
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagException;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+
+import javax.faces.component.UIComponent;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * @author Jacob Hookom
+ * @version $Id: ChooseHandler.java,v 1.3 2008/07/13 19:01:43 rlubke Exp $
+ */
+public final class ChooseHandler extends TagHandler
+{
+
+    private final ChooseOtherwiseHandler otherwise;
+    private final ChooseWhenHandler[] when;
+
+    public ChooseHandler(TagConfig config)
+    {
+        super(config);
+
+        List whenList = new ArrayList();
+        Iterator itr = this.findNextByType(ChooseWhenHandler.class);
+        while (itr.hasNext())
+        {
+            whenList.add(itr.next());
+        }
+        if (whenList.isEmpty())
+        {
+            throw new TagException(this.tag, "Choose Tag must have one or more When Tags");
+        }
+        this.when = (ChooseWhenHandler[]) whenList.toArray(new ChooseWhenHandler[whenList.size()]);
+
+        itr = this.findNextByType(ChooseOtherwiseHandler.class);
+        if (itr.hasNext())
+        {
+            this.otherwise = (ChooseOtherwiseHandler) itr.next();
+        }
+        else
+        {
+            this.otherwise = null;
+        }
+    }
+
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        for (int i = 0; i < this.when.length; i++)
+        {
+            if (this.when[i].isTestTrue(ctx))
+            {
+                this.when[i].apply(ctx, parent);
+                return;
+            }
+        }
+        if (this.otherwise != null)
+        {
+            this.otherwise.apply(ctx, parent);
+        }
+    }
+
+}

Added: myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/ChooseOtherwiseHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/ChooseOtherwiseHandler.java?rev=740940&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/ChooseOtherwiseHandler.java (added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/com/sun/facelets/tag/jstl/core/ChooseOtherwiseHandler.java Wed Feb  4 23:55:25 2009
@@ -0,0 +1,47 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.facelets.tag.jstl.core;
+
+import javax.faces.component.UIComponent;
+
+import com.sun.facelets.tag.TagConfig;
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * @author Jacob Hookom
+ * @version $Id: ChooseOtherwiseHandler.java,v 1.3 2008/07/13 19:01:44 rlubke Exp $
+ */
+public final class ChooseOtherwiseHandler extends TagHandler
+{
+
+    public ChooseOtherwiseHandler(TagConfig config)
+    {
+        super(config);
+    }
+
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
+            ELException
+    {
+        this.nextHandler.apply(ctx, parent);
+    }
+
+}



Mime
View raw message