incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bara...@apache.org
Subject svn commit: r471224 - in /incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin: ./ src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/ src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/ src/main/java/org/apache/myface...
Date Sat, 04 Nov 2006 16:02:13 GMT
Author: baranda
Date: Sat Nov  4 08:02:12 2006
New Revision: 471224

URL: http://svn.apache.org/viewvc?view=rev&rev=471224
Log:
Progressing in MyFacesComponentTagGenerator

Added:
    incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
  (with props)
Modified:
    incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/pom.xml
    incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
    incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
    incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/MyFacesComponentGenerator.java
    incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java
    incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
    incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
    incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java

Modified: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/pom.xml?view=diff&rev=471224&r1=471223&r2=471224
==============================================================================
--- incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/pom.xml (original)
+++ incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/pom.xml Sat Nov  4 08:02:12
2006
@@ -1,11 +1,13 @@
 <project> 
   <modelVersion>4.0.0</modelVersion>
 
+  <!--
   <parent>
     <groupId>org.apache.myfaces.trinidadbuild</groupId>
     <artifactId>maven-plugin-parent</artifactId> 
     <version>incubator-m1-SNAPSHOT</version>
   </parent>
+ -->
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
   <artifactId>maven-faces-plugin</artifactId> 

Modified: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java?view=diff&rev=471224&r1=471223&r2=471224
==============================================================================
--- incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
(original)
+++ incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
Sat Nov  4 08:02:12 2006
@@ -18,6 +18,7 @@
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
 import org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.ComponentTagGenerator;
+import org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.MyFacesComponentTagGenerator;
 import org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.TagAttributeFilter;
 import org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.TrinidadComponentTagGenerator;
 import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
@@ -1482,8 +1483,7 @@
         }
         else
         {
-            // TODO change this when the myfaces tag generator is created
-            generator = new TrinidadComponentTagGenerator(_is12());
+            generator = new MyFacesComponentTagGenerator(_is12());
         }
 
       try

Modified: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java?view=diff&rev=471224&r1=471223&r2=471224
==============================================================================
--- incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
(original)
+++ incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
Sat Nov  4 08:02:12 2006
@@ -61,6 +61,18 @@
                 "java.awt.Color".equals(propClassParams[0]));
     }
 
+    public static boolean isAction(PropertyBean property)
+    {
+        return (property.getClass().equals("javax.el.MethodExpression")
+                && property.getJspPropertyName().equals("action"));
+    }
+
+    public static boolean isActionListener(PropertyBean property)
+    {
+        return (property.getClass().equals("javax.el.MethodExpression")
+                && property.getJspPropertyName().equals("actionListener"));
+    }
+
     static public void writeImports(
       PrettyWriter out,
       String       packageName,

Modified: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/MyFacesComponentGenerator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/MyFacesComponentGenerator.java?view=diff&rev=471224&r1=471223&r2=471224
==============================================================================
--- incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/MyFacesComponentGenerator.java
(original)
+++ incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/MyFacesComponentGenerator.java
Sat Nov  4 08:02:12 2006
@@ -46,6 +46,7 @@
     }
 
     public void writePropertyDeclaration(PrettyWriter out,
+                                         ComponentBean component,
                                          PropertyBean property) throws IOException
     {
         String propName = property.getPropertyName();

Modified: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java?view=diff&rev=471224&r1=471223&r2=471224
==============================================================================
--- incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java
(original)
+++ incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java
Sat Nov  4 08:02:12 2006
@@ -146,7 +146,9 @@
     {
       String componentType = component.getComponentType();
       out.println();
-      out.println("@Override");
+
+      // The superclass does not necessarily need to have this method
+      //out.println("@Override");
       out.println("public String getComponentType()");
       out.println("{");
       out.indent();
@@ -161,7 +163,9 @@
     {
       String rendererType = component.getRendererType();
       out.println();
-      out.println("@Override");
+
+      // The superclass does not necessarily need to have this method
+      //out.println("@Override");
       out.println("public String getRendererType()");
       out.println("{");
       out.indent();

Added: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java?view=auto&rev=471224
==============================================================================
--- incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
(added)
+++ incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
Sat Nov  4 08:02:12 2006
@@ -0,0 +1,480 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * 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 org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
+
+import org.apache.myfaces.trinidadbuild.plugin.faces.generator.GeneratorHelper;
+import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ComponentBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.MethodSignatureBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.FilteredIterator;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Component tag generator for myfaces
+ *
+ * @author Bruno Aranda (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class MyFacesComponentTagGenerator extends AbstractComponentTagGenerator
+{
+    private boolean _is12;
+
+    public MyFacesComponentTagGenerator(boolean is12)
+    {
+        _is12 = is12;
+    }
+
+    protected void addSpecificImports(Set imports,
+                                      ComponentBean component)
+    {
+        imports.add("javax.faces.component.UIComponent");
+        imports.add(component.getComponentClass());
+
+        if (_is12)
+        {
+            imports.add("javax.el.ValueExpression");
+        }
+
+        Iterator properties = component.properties();
+        properties = new FilteredIterator(properties, new TagAttributeFilter());
+
+        while (properties.hasNext())
+        {
+            PropertyBean property = (PropertyBean) properties.next();
+            String   propertyClass = property.getPropertyClass();
+
+            if (GeneratorHelper.isConverter(propertyClass))
+            {
+                if (!_is12)
+                {
+                    imports.add("javax.faces.el.ValueBinding");
+                }
+                imports.add("javax.faces.convert.Converter");
+            }
+            else if (property.isMethodBinding())
+            {
+                if (_is12)
+                {
+                    imports.add("javax.el.MethodExpression");
+                }
+                else
+                {
+                    imports.add("javax.faces.el.MethodBinding");
+                }
+            }
+            else if (property.isMethodExpression())
+            {
+                imports.add("javax.el.MethodExpression");
+            }
+            else if (GeneratorHelper.isActionListener(property))
+            {
+                imports.add("javax.faces.event.MethodExpressionActionListener");
+            }
+        }
+    }
+
+
+    protected void writePropertyDeclaration(PrettyWriter out,
+                                            PropertyBean property) throws IOException
+    {
+        String fieldPropName = property.getFieldPropertyName();
+        String jspPropType = GeneratorHelper.getJspPropertyType(property, _is12);
+
+        out.println();
+        out.println("private " + jspPropType + " " + fieldPropName + ";");
+    }
+
+    protected void writePropertySetter(PrettyWriter out,
+                                       PropertyBean property) throws IOException
+    {
+        String propName = property.getPropertyName();
+        String fieldPropName = property.getFieldPropertyName();
+        String jspPropName = property.getJspPropertyName();
+        String propVar = Util.getVariableFromName(propName);
+        String setMethod = Util.getPrefixedPropertyName("set", jspPropName);
+        String jspPropType = GeneratorHelper.getJspPropertyType(property, _is12);
+
+        out.println("public void " + setMethod + "(" + jspPropType + " " + propVar + ")");
+        out.println("{");
+        out.indent();
+        out.println(fieldPropName + " = " + propVar + ";");
+        out.unindent();
+        out.println("}");
+    }
+
+    public void writeSetPropertiesMethod(PrettyWriter out,
+                                         String componentClass,
+                                         ComponentBean component) throws IOException
+    {
+        Iterator properties = component.properties();
+        properties = new FilteredIterator(properties, new TagAttributeFilter());
+
+        out.println();
+
+        if (_is12)
+        {
+            out.println("@Override");
+        }
+        out.println("protected void setProperties(UIComponent component)");
+        out.unindent();
+        out.println("{");
+        out.indent();
+
+        writeSetPropertyMethodBody(out, componentClass, properties);
+        out.unindent();
+        out.println("}");
+        //    }
+    }
+
+    protected void writeSetPropertyMethodBody(PrettyWriter out,
+                                              String componentClass,
+                                              Iterator properties) throws IOException
+    {
+
+        out.println("if (!(component instanceof "+componentClass+"))");
+        out.println("{");
+        out.indent();
+        out.print("throw new IllegalArgumentException(");
+        out.print("\"Component \" + component.getClass().getName() + \" is no "+componentClass+"\"");
+        out.println(");");
+        out.unindent();
+        out.println("}");
+
+        out.println(componentClass+" comp = ("+componentClass+")component;");
+
+        out.println();
+        out.println("super.setProperties(component);");
+        out.println();
+
+        if (!_is12)
+        {
+            out.println("FacesContext context = FacesContext.getCurrentInstance();");
+        }
+
+        while (properties.hasNext())
+        {
+            PropertyBean property = (PropertyBean) properties.next();
+            _writeSetPropertiesCase(out, componentClass, property);
+        }
+    }
+
+    private void _writeSetPropertiesCase(
+      PrettyWriter  out,
+      String             componentClass,
+      PropertyBean        property) throws IOException
+    {
+      String propName = property.getPropertyName();
+      String propClass = property.getPropertyClass();
+      String propVar = "_" + Util.getVariableFromName(propName);
+
+      if (property.isMethodBinding())
+      {
+        _writeSetMethodBinding(out, componentClass, property);
+      }
+      else if (property.isMethodExpression())
+      {
+        _writeSetMethodExpression(out, componentClass, property);
+      }
+      else if (GeneratorHelper.isConverter(propClass))
+      {
+        _writeSetConverter(out, componentClass, propName);
+      }
+      else 
+      {
+        _writeSetProperty(out, propName, propVar);
+      }
+    }
+
+    private void _writeSetProperty(
+            PrettyWriter out,
+            String propName,
+            String propVar)
+    {
+        out.println("if ("+propVar+" != null) ");
+        out.println("{");
+        out.indent();
+
+        if (_is12)
+        {
+            out.println("comp.setValueExpression(\""+propName+"\", "+propVar+");");
+        }
+        else
+        {
+            _writeSetValueBinding(out, propName, propVar);
+        }
+        out.unindent();
+        out.println("}");
+    }
+
+    private void _writeSetValueBinding(
+            PrettyWriter out,
+            String propName,
+            String propVar)
+    {
+        out.println("if (isValueReference(" + propVar + ")");
+        out.println("{");
+        out.indent();
+        out.println("ValueBinding vb = context.getApplication().createValueBinding(" + propVar
+ ");");
+        out.println("comp.setValueBinding(\"" + propName + "\", " + propVar + ");");
+        out.unindent();
+        out.println("}");
+        out.println("else");
+        out.println("{");
+        out.indent();
+        out.println("comp.getAttributes().put(\"" + propName + "\", " + propVar + ");");
+        out.unindent();
+        out.println("}");
+    }
+
+
+
+    private void _writeSetMethodBinding(
+            PrettyWriter out,
+            String componentClass,
+            PropertyBean property) throws IOException
+    {
+        String propName = property.getPropertyName();
+        String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
+        String propVar = "_" + propName;
+
+        if (_is12)
+        {
+            out.println("if (" + propVar + " != null)");
+            out.indent();
+            out.println("bean.setProperty(" + componentClass + "." + propKey + ", " +
+                    "new MethodExpressionMethodBinding(" + propVar + "));");
+            out.unindent();
+        }
+        else
+        {
+            MethodSignatureBean signature = property.getMethodBindingSignature();
+            String[] paramTypes = (signature != null) ? signature.getParameterTypes() : null;
+
+            String classArray;
+
+            if (paramTypes == null || paramTypes.length == 0)
+            {
+                classArray = "new Class[0]";
+            }
+            else
+            {
+                StringBuffer sb = new StringBuffer();
+                sb.append("new Class[]{");
+                for (int i = 0; i < paramTypes.length; i++)
+                {
+                    if (i > 0)
+                        sb.append(',');
+                    sb.append(paramTypes[i]);
+                    sb.append(".class");
+                }
+
+                // TODO: remove trailing comma
+                sb.append(',');
+
+                sb.append('}');
+                classArray = sb.toString();
+            }
+
+            out.println("if (" + propVar + " != null)");
+            out.println("{");
+            out.indent();
+
+            if (isStringMethodBindingReturnType(signature))
+            {
+                out.println("MethodBinding mb;");
+                out.println("if (isValueReference(" + propVar + "))");
+                out.indent();
+                out.println("mb = createMethodBinding(" + propVar + ", " + classArray + ");");
+                out.unindent();
+                out.println("else");
+                out.indent();
+                out.println("mb = new org.apache.myfaces.trinidadinternal.taglib.ConstantMethodBinding("
+ propVar + ");");
+                out.unindent();
+            }
+            else
+            {
+                // never a literal, no need for ConstantMethodBinding
+                out.println("MethodBinding mb = createMethodBinding(" + propVar + ", " +
+                        classArray + ");");
+            }
+
+            out.println("bean.setProperty(" + componentClass + "." + propKey + ", mb);");
+            out.unindent();
+            out.println("}");
+        }
+    }
+
+    private void _writeSetMethodExpression(
+            PrettyWriter out,
+            String componentClass,
+            PropertyBean property) throws IOException
+    {
+        String propName = property.getPropertyName();
+        String propVar = property.getFieldPropertyName();
+
+        out.println("if ("+propVar+" != null) ");
+        out.println("{");
+        out.indent();
+
+        if (GeneratorHelper.isAction(property))
+        {
+            out.println("comp.setActionExpression("+propVar+");");
+        }
+        else if (GeneratorHelper.isActionListener(property))
+        {
+            out.println("comp.addActionListener(new MethodExpressionActionListener(" + propVar
+ "));");
+        }
+        else
+        {
+            out.println("comp." + Util.getPrefixedPropertyName("set", propName) + "(" + propVar
+ ");");
+        }
+        out.unindent();
+        out.println("}");
+    }
+
+    private void _writeSetKeyStroke(
+            PrettyWriter out,
+            String componentClass,
+            String propName) throws IOException
+    {
+        String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
+        String propVar = "_" + propName;
+
+
+        if (_is12)
+        {
+            out.println("if (" + propVar + " != null)");
+            out.println("{");
+            out.indent();
+            out.println("if (!" + propVar + ".isLiteralText())");
+            out.println("{");
+            out.indent();
+            out.println("bean.setValueExpression(" + componentClass + "." + propKey + ",
" + propVar + ");");
+            out.unindent();
+            out.println("}");
+            out.println("else");
+            out.println("{");
+            out.indent();
+            out.println("Object val = " + propVar + ".getValue(null);");
+            out.println("if (val != null)");
+            out.indent();
+            out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
+            out.println("\tKeyStroke.getKeyStroke(val.toString()));");
+            out.unindent();
+            out.unindent();
+            out.println("}");
+            out.unindent();
+            out.println("}");
+        }
+        else
+        {
+            out.println("if (" + propVar + " != null)");
+            out.println("{");
+            out.indent();
+            out.println("if (isValueReference(" + propVar + "))");
+            out.println("{");
+            out.indent();
+            out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
+            out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
+            out.unindent();
+            out.println("}");
+            out.println("else");
+            out.println("{");
+            out.indent();
+            out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
+            out.println("\tKeyStroke.getKeyStroke(" + propVar + "));");
+            out.unindent();
+            out.println("}");
+            out.unindent();
+            out.println("}");
+        }
+    }
+
+    private void _writeSetConverter(
+            PrettyWriter out,
+            String componentClass,
+            String propName) throws IOException
+    {
+        String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
+        String propVar = "_" + propName;
+
+        out.println("if (" + propVar + " != null)");
+        out.println("{");
+        out.indent();
+        if (_is12)
+        {
+            out.println("if (!" + propVar + ".isLiteralText())");
+            out.println("{");
+            out.indent();
+            out.println("bean.setValueExpression(" + componentClass + "." + propKey + ",
" + propVar + ");");
+            out.unindent();
+            out.println("}");
+            out.println("else");
+            out.println("{");
+            out.indent();
+            out.println("Object o = " + propVar + ".getValue(null);");
+            out.println("if (o != null)");
+            out.println("{");
+
+            out.indent();
+            out.println("Converter converter = getFacesContext().getApplication().");
+            out.indent();
+            out.println("createConverter(o.toString());");
+            out.unindent();
+            out.println("bean.setProperty(" + componentClass + "." + propKey + ", converter);");
+
+            out.unindent();
+            out.println("}");
+
+            out.unindent();
+            out.println("}");
+        }
+        else
+        {
+            out.println("if (isValueReference(" + propVar + "))");
+            out.println("{");
+            out.indent();
+            out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
+            out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
+            out.unindent();
+            out.println("}");
+            out.println("else");
+            out.println("{");
+            out.indent();
+            out.println("Converter converter = getFacesContext().getApplication().");
+            out.indent();
+            out.println("createConverter(" + propVar + ");");
+            out.unindent();
+            out.println("bean.setProperty(" + componentClass + "." + propKey + ", converter);");
+            out.unindent();
+            out.println("}");
+        }
+        out.unindent();
+        out.println("}");
+    }
+
+    private boolean isStringMethodBindingReturnType(
+            MethodSignatureBean sig)
+    {
+        return (sig != null && "java.lang.String".equals(sig.getReturnType()));
+    }
+
+}

Propchange: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java?view=diff&rev=471224&r1=471223&r2=471224
==============================================================================
--- incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
(original)
+++ incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
Sat Nov  4 08:02:12 2006
@@ -151,8 +151,7 @@
         String setMethod = Util.getPrefixedPropertyName("set", jspPropName);
         String jspPropType = GeneratorHelper.getJspPropertyType(property, _is12);
 
-        // TODO uncomment next
-        //out.print("final ");
+        out.print("final ");
         out.println("public void " + setMethod + "(" + jspPropType + " " + propVar + ")");
         out.println("{");
         out.indent();

Modified: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java?view=diff&rev=471224&r1=471223&r2=471224
==============================================================================
--- incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
(original)
+++ incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
Sat Nov  4 08:02:12 2006
@@ -223,6 +223,27 @@
     return _tagClass;
   }
 
+   /**
+   * Sets the JSP tag handler superclass for this component.
+   *
+   * @param tagSuperclass  the JSP tag handler superclass
+   */
+  public void setTagSuperclass(
+    String tagSuperclass)
+  {
+    _tagSuperclass = tagSuperclass;
+  }
+
+  /**
+   * Returns the JSP tag handler superclass for this component.
+   *
+   * @return  the JSP tag handler superclass
+   */
+  public String getTagSuperclass()
+  {
+    return _tagSuperclass;
+  }
+
   /**
    * Returns the JSP tag name for this component.
    *

Modified: incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java?view=diff&rev=471224&r1=471223&r2=471224
==============================================================================
--- incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
(original)
+++ incubator/adffaces/branches/myfaces-1_2-maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
Sat Nov  4 08:02:12 2006
@@ -15,26 +15,20 @@
 */
 package org.apache.myfaces.trinidadbuild.plugin.faces.parse;
 
-import java.io.IOException;
-import java.io.InputStream;
-
-import java.net.URL;
-import java.net.URLConnection;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.apache.commons.digester.Digester;
 import org.apache.commons.digester.AbstractObjectCreationFactory;
-
+import org.apache.commons.digester.Digester;
 import org.apache.maven.plugin.MojoExecutionException;
-
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.rules.BeanPropertySetterRule;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.XIncludeFilter;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
-
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.rules.BeanPropertySetterRule;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.XIncludeFilter;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
 
 public class FacesConfigParser
 {
@@ -152,6 +146,8 @@
                                    "children");
     digester.addBeanPropertySetter("faces-config/component/component-extension/tag-class",
                                    "tagClass");
+    digester.addBeanPropertySetter("faces-config/component/component-extension/tag-superclass",
+                                   "tagSuperclass");
     digester.addCallMethod("faces-config/component/component-extension/tag-class-modifier",
                            "parseTagClassModifier", 1);
     digester.addCallParam("faces-config/component/component-extension/tag-class-modifier",
0);



Mime
View raw message