incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r453775 - in /incubator/adffaces/branches/faces-1_2/trinidad: trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/ trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/ trinidad-impl/src/m...
Date Fri, 06 Oct 2006 21:20:48 GMT
Author: awiner
Date: Fri Oct  6 14:20:47 2006
New Revision: 453775

URL: http://svn.apache.org/viewvc?view=rev&rev=453775
Log:
Implement ActionSource2 on command and selectInput base classes

Modified:
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXCommandTemplate.java
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXSelectInputTemplate.java
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Command.xml
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/SelectInput.xml
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputColorRenderer.java
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java
    incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java

Modified: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXCommandTemplate.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXCommandTemplate.java?view=diff&rev=453775&r1=453774&r2=453775
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXCommandTemplate.java
(original)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXCommandTemplate.java
Fri Oct  6 14:20:47 2006
@@ -18,6 +18,7 @@
 import javax.el.MethodExpression;
 
 import javax.faces.component.ActionSource;
+import javax.faces.component.ActionSource2;
 import javax.faces.context.FacesContext;
 import javax.faces.el.MethodBinding;
 import javax.faces.event.AbortProcessingException;
@@ -37,12 +38,35 @@
  * @author The Oracle ADF Faces Team
  */
 abstract public class UIXCommandTemplate extends UIXComponentBase
-                                  implements ActionSource, DialogSource
+  implements ActionSource, ActionSource2, DialogSource
 {
 /**/ // Abstract methods implemented by code gen
+/**/  abstract public MethodExpression getActionExpression();
+/**/  abstract public MethodExpression setActionExpression();
+/**/  abstract public MethodExpression getLaunchListener();
 /**/  abstract public MethodBinding getActionListener();
 /**/  abstract public MethodExpression getReturnListener();
 /**/  abstract public MethodExpression getLaunchListener();
+
+  public MethodBinding getAction()
+  {
+    MethodExpression me = getActionExpression();
+    if (me == null)
+      return null;
+
+    if (me instanceof MethodBindingMethodExpression)
+      return ((MethodBindingMethodExpression) me).getMethodBinding();
+
+    return new MethodExpressionMethodBinding(me);
+  }
+
+  public void setAction(MethodBinding binding)
+  {
+    if (binding instanceof MethodExpressionMethodBinding)
+      setActionExpression(((MethodExpressionMethodBinding) binding).getMethodExpression());
+    else
+      setActionExpression(new MethodBindingMethodExpression(binding));
+  }
 
   /**
    * <p>Intercept <code>queueEvent</code> and mark the phaseId for the

Modified: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXSelectInputTemplate.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXSelectInputTemplate.java?view=diff&rev=453775&r1=453774&r2=453775
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXSelectInputTemplate.java
(original)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXSelectInputTemplate.java
Fri Oct  6 14:20:47 2006
@@ -14,9 +14,11 @@
  * limitations under the License.
  */
 package org.apache.myfaces.trinidad.component;
+
 import javax.el.MethodExpression;
 
 import javax.faces.component.ActionSource;
+import javax.faces.component.ActionSource2;
 import javax.faces.context.FacesContext;
 import javax.faces.el.MethodBinding;
 import javax.faces.event.AbortProcessingException;
@@ -37,12 +39,35 @@
  * @author The Oracle ADF Faces Team
  */
 abstract public class UIXSelectInputTemplate extends UIXEditableValue
-                                      implements ActionSource
+  implements ActionSource, ActionSource2
 {
 	
 /**/ // Abstract methods implemented by code gen
+/**/  abstract public MethodExpression getActionExpression();
+/**/  abstract public MethodExpression setActionExpression();
 /**/  abstract public MethodBinding getActionListener();
 /**/  abstract public MethodExpression getReturnListener();
+
+
+  public MethodBinding getAction()
+  {
+    MethodExpression me = getActionExpression();
+    if (me == null)
+      return null;
+
+    if (me instanceof MethodBindingMethodExpression)
+      return ((MethodBindingMethodExpression) me).getMethodBinding();
+
+    return new MethodExpressionMethodBinding(me);
+  }
+
+  public void setAction(MethodBinding binding)
+  {
+    if (binding instanceof MethodExpressionMethodBinding)
+      setActionExpression(((MethodExpressionMethodBinding) binding).getMethodExpression());
+    else
+      setActionExpression(new MethodBindingMethodExpression(binding));
+  }
 
   /**
    * <p>Intercept <code>queueEvent</code> and mark the phaseId for any

Modified: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Command.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Command.xml?view=diff&rev=453775&r1=453774&r2=453775
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Command.xml
(original)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/Command.xml
Fri Oct  6 14:20:47 2006
@@ -33,8 +33,8 @@
       <description><![CDATA[a reference to an action method sent by the command
component,
               or the static outcome of an action]]>
       </description>
-      <property-name>action</property-name>
-      <property-class>javax.faces.el.MethodBinding</property-class>
+      <property-name>actionExpression</property-name>
+      <property-class>javax.el.MethodExpression</property-class>
       <property-extension>
         <mfp:method-binding-signature>
           <mfp:return-type>java.lang.String</mfp:return-type>
@@ -43,6 +43,7 @@
           <mfp:preferred>true</mfp:preferred>
         </mfp:property-metadata>
         <mfp:state-holder>yes</mfp:state-holder>
+        <mfp:jsp-property-name>action</mfp:jsp-property-name>
       </property-extension>
     </property>
     <property>

Modified: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/SelectInput.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/SelectInput.xml?view=diff&rev=453775&r1=453774&r2=453775
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/SelectInput.xml
(original)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/SelectInput.xml
Fri Oct  6 14:20:47 2006
@@ -32,8 +32,8 @@
     <component-class>org.apache.myfaces.trinidad.component.UIXSelectInput</component-class>
     <property>
       <description><![CDATA[a reference to an action method sent by the commandButton,
or the static outcome of an action]]></description>
-      <property-name>action</property-name>
-      <property-class>javax.faces.el.MethodBinding</property-class>
+      <property-name>actionExpression</property-name>
+      <property-class>javax.el.MethodExpression</property-class>
       <property-extension>
         <mfp:method-binding-signature>
           <mfp:return-type>java.lang.String</mfp:return-type>
@@ -42,6 +42,7 @@
           <mfp:preferred>true</mfp:preferred>
         </mfp:property-metadata>
         <mfp:state-holder>yes</mfp:state-holder>
+        <mfp:jsp-property-name>action</mfp:jsp-property-name>
       </property-extension>
     </property>
     <property>

Modified: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputColorRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputColorRenderer.java?view=diff&rev=453775&r1=453774&r2=453775
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputColorRenderer.java
(original)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputColorRenderer.java
Fri Oct  6 14:20:47 2006
@@ -70,7 +70,7 @@
   {
     FacesBean bean = getFacesBean(component);
     // If there's a non-default action, then just launch away
-    if (getAction(bean) != null)
+    if (getActionExpression(bean) != null)
     {
       super.queueActionEvent(context, component);
     }
@@ -291,7 +291,7 @@
     // If the field has an action, use the default behavior.  Or,
     // if the field doesn't support launching a window at all,
     // use the default behavior.
-    if ((getAction(bean) != null) ||
+    if ((getActionExpression(bean) != null) ||
         !Boolean.TRUE.equals(
             arc.getAgent().getCapabilities().get(TrinidadAgent.CAP_MULTIPLE_WINDOWS)))
       return super.getLaunchOnclick(context, arc, component, bean);

Modified: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java?view=diff&rev=453775&r1=453774&r2=453775
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java
(original)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java
Fri Oct  6 14:20:47 2006
@@ -73,7 +73,7 @@
   {
     FacesBean bean = getFacesBean(component);
     // If there's a non-default action, then just launch away
-    if (getAction(bean) != null)
+    if (getActionExpression(bean) != null)
     {
       super.queueActionEvent(context, component);
     }
@@ -335,7 +335,7 @@
     // If the field has an action, use the default behavior.  Or,
     // if the field doesn't support launching a window at all,
     // use the default behavior.
-    if ((getAction(bean) != null) ||
+    if ((getActionExpression(bean) != null) ||
         !Boolean.TRUE.equals(
             arc.getAgent().getCapabilities().get(TrinidadAgent.CAP_MULTIPLE_WINDOWS)))
       return super.getLaunchOnclick(context, arc, component, bean);

Modified: incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java?view=diff&rev=453775&r1=453774&r2=453775
==============================================================================
--- incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java
(original)
+++ incubator/adffaces/branches/faces-1_2/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java
Fri Oct  6 14:20:47 2006
@@ -60,7 +60,7 @@
     super.findTypeConstants(type);
     _searchDescKey = type.findKey("searchDesc");
     _iconKey = type.findKey("icon");
-    _actionKey = type.findKey("action");
+    _actionExpressionKey = type.findKey("actionExpression");
   }
 
   //
@@ -357,9 +357,9 @@
     return true;
   }
 
-  protected Object getAction(FacesBean bean)
+  protected Object getActionExpression(FacesBean bean)
   {
-    return bean.getProperty(_actionKey);
+    return bean.getProperty(_actionExpressionKey);
   }
 
   protected String getSearchDesc(
@@ -392,7 +392,7 @@
     return "af|inputListOfValues::content";
   }
 
-  private PropertyKey _actionKey;
+  private PropertyKey _actionExpressionKey;
   private PropertyKey _iconKey;
   private PropertyKey _searchDescKey;
 



Mime
View raw message