incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r474621 [3/43] - in /incubator/adffaces/branches/faces-1_2-061113: plugins/maven-faces-plugin/ plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/ plugins/maven-faces-plugin/src/main/java/org/apache/myfac...
Date Tue, 14 Nov 2006 01:35:05 GMT
Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java Mon Nov 13 17:34:56 2006
@@ -21,6 +21,8 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.el.MethodExpression;
+
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.el.MethodBinding;
@@ -39,12 +41,17 @@
  * TreeTable include expanding/collapsing subtrees and focusing into subtrees.
  * @version $Name:  $ ($Revision$) $Date$
  * @author The Oracle ADF Faces Team
- * @todo document new default value for formSubmitted
  */
 abstract public class UIXTreeTableTemplate extends UIXTree
 {
 /**/  public abstract int[] getRowsByDepth();
-/**/  abstract public MethodBinding getRangeChangeListener();
+/**/  abstract public MethodExpression getRangeChangeListener();
+
+  @Deprecated
+  public void setRangeChangeListener(MethodBinding binding)
+  {
+    setRangeChangeListener(adaptMethodBinding(binding));
+  }
 
   /**
    * Gets the maximum number of rows to show.
@@ -180,7 +187,7 @@
       // it is nice to expand the focused item:
       getDisclosedRowKeys().add();
 
-      broadcastToMethodBinding(event, getFocusListener());
+      broadcastToMethodExpression(event, getFocusListener());
     }
     else if (event instanceof RangeChangeEvent)
     {
@@ -190,7 +197,7 @@
       //=-=pu: This ain't getting restored. Check with Arj or file a bug.
       addAttributeChange("first",
                          new Integer(rce.getNewStart()));
-      broadcastToMethodBinding(event, getRangeChangeListener());
+      broadcastToMethodExpression(event, getRangeChangeListener());
     }
 
     // Perform standard superclass processing

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java Mon Nov 13 17:34:56 2006
@@ -15,6 +15,9 @@
  */
 package org.apache.myfaces.trinidad.component;
 import java.io.IOException;
+
+import javax.el.MethodExpression;
+
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.el.MethodBinding;
@@ -39,8 +42,20 @@
 /**/  public abstract void setDisclosedRowKeys(RowKeySet keys);
 /**/  public abstract RowKeySet getSelectedRowKeys();
 /**/  public abstract void setSelectedRowKeys(RowKeySet keys);
-/**/  public abstract MethodBinding getRowDisclosureListener();
+/**/  public abstract MethodExpression getRowDisclosureListener();
 /**/  public abstract UIComponent getNodeStamp();
+
+  @Deprecated
+  public void setRowDisclosureListener(MethodBinding binding)
+  {
+    setRowDisclosureListener(adaptMethodBinding(binding));
+  }
+  
+  @Deprecated
+  public void setSelectionListener(MethodBinding binding)
+  {
+    setSelectionListener(adaptMethodBinding(binding));
+  }
   
   /**
    * Sets the phaseID of UI events depending on the "immediate" property.
@@ -66,7 +81,7 @@
       //=-=pu: This ain't getting restored. Check with Arj or file a bug.
       addAttributeChange("selectedRowKeys",
                          getSelectedRowKeys());
-      broadcastToMethodBinding(event, getSelectionListener());
+      broadcastToMethodExpression(event, getSelectionListener());
     }
 
     HierarchyUtils.__handleBroadcast(this, 

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBean.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBean.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBean.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBean.java Mon Nov 13 17:34:56 2006
@@ -21,6 +21,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.el.ValueExpression;
+
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
 
@@ -59,19 +61,27 @@
    * @exception IllegalArgumentException if key is a list key
    */
   public Object getLocalProperty(PropertyKey key);
-  
+
+  /**
+   * Return the value expression for a key.
+   * @exception IllegalArgumentException if the property does
+   *   not support value bindings.
+   */
+  public ValueExpression getValueExpression(PropertyKey key);
+
   /**
    * Return the value binding for a key.
    * @exception IllegalArgumentException if the property does
    *   not support value bindings.
+   * @deprecated
    */
   public ValueBinding getValueBinding(PropertyKey key);
 
   /**
    * Gets the current unevaluated value for the specified property key. 
    * <p>The method will first look for a local value. If it exists, it will 
-   * be returned. If it does not and the bean supports value bindings, the 
-   * method will look for a binding with the specified key and return it 
+   * be returned. If it does not and the bean supports value expressions, the 
+   * method will look for an expression with the specified key and return it 
    * directly if it exists without evaluatig its value.</p>
    * <p>This method is mainly used when:</p>
    * <ul>
@@ -94,21 +104,30 @@
    * @param key the parameter key of the raw property value to get.
    * 
    * @return the local value of the specified key if it exists, a 
-   *         <code>ValueBinding</code> object if the specified key 
-   *         supports bindings and a binding was specified for that 
+   *         <code>ValueExpression</code> object if the specified key 
+   *         supports expressions and an expression was specified for that 
    *         property, <code>null</code> otherwise.
    * 
    * @throws IllegalArgumentException if the specified key is a list key.
    * 
    * @see #getLocalProperty(PropertyKey)
    * @see #getValueBinding(PropertyKey)
+   * @see #getValueExpression(PropertyKey)
    */
   public Object getRawProperty(PropertyKey key);
 
   /**
+   * Set the value expression for a key.
+   * @exception IllegalArgumentException if the property does
+   *   not support value expressions.
+   */
+  public void setValueExpression(PropertyKey key, ValueExpression expression);
+
+  /**
    * Set the value binding for a key.
    * @exception IllegalArgumentException if the property does
    *   not support value bindings.
+   * @deprecated
    */
   public void setValueBinding(PropertyKey key, ValueBinding binding);
 

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java Mon Nov 13 17:34:56 2006
@@ -23,6 +23,8 @@
 import java.util.List;
 import java.util.Set;
 
+import javax.el.ValueExpression;
+
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
 
@@ -58,11 +60,11 @@
     // Look for a binding if and only if the key supports bindings
     if (key.getSupportsBinding())
     {
-      ValueBinding binding = getValueBinding(key);
-      if (binding != null)
+      ValueExpression expression = getValueExpression(key);
+      if (expression != null)
       {
         FacesContext context = FacesContext.getCurrentInstance();
-        return binding.getValue(context);
+        return expression.getValue(context.getELContext());
       }
     }
 
@@ -83,7 +85,7 @@
       return local;
 
     // Look for a binding if and only if the key supports bindings
-    return key.getSupportsBinding() ? getValueBinding(key) : null;
+    return key.getSupportsBinding() ? getValueExpression(key) : null;
   }
 
 
@@ -106,18 +108,19 @@
     return getLocalPropertyImpl(key);
   }
 
-  final public ValueBinding getValueBinding(PropertyKey key)
+  final public ValueExpression getValueExpression(PropertyKey key)
   {
     _checkNotListKey(key);
 
-    PropertyMap map = _getBindingsMap(false);
+    PropertyMap map = _getExpressionsMap(false);
     if (map == null)
       return null;
 
-    return (ValueBinding) map.get(key);
+    return (ValueExpression) map.get(key);    
   }
 
-  final public void setValueBinding(PropertyKey key, ValueBinding binding)
+  final public void setValueExpression(PropertyKey key,
+                                       ValueExpression expression)
   {
     _checkNotListKey(key);
 
@@ -127,18 +130,46 @@
          "Property \"" + key.getName() + "\" cannot be bound.");
     }
 
-    if (binding == null)
+    if (expression == null)
     {
-      PropertyMap map = _getBindingsMap(false);
+      PropertyMap map = _getExpressionsMap(false);
       if (map != null)
         map.remove(key);
     }
     else
     {
-      _getBindingsMap(true).put(key, binding);
+      _getExpressionsMap(true).put(key, expression);
     }
 
   }
+  
+  final public ValueBinding getValueBinding(PropertyKey key)
+  {
+    ValueExpression ve = getValueExpression(key);
+    if (ve == null)
+      return null;
+      
+    if (ve instanceof ValueBindingValueExpression)
+      return ((ValueBindingValueExpression) ve).getValueBinding();
+      
+    return new ValueExpressionValueBinding(ve);
+  }
+
+  final public void setValueBinding(PropertyKey key, ValueBinding binding)
+  {
+    ValueExpression ve;
+    
+    if (binding == null)
+    {
+      ve = null;
+    }
+    else
+    {
+      ve = new ValueBindingValueExpression(binding);
+    }
+
+    setValueExpression(key, ve);
+  }
 
 
   @SuppressWarnings("unchecked")
@@ -281,10 +312,10 @@
   @SuppressWarnings("unchecked")
   final public Set<PropertyKey> bindingKeySet()
   {
-    if (_bindings == null)
+    if (_expressions == null)
       return Collections.emptySet();
 
-    return _bindings.keySet();
+    return _expressions.keySet();
   }
 
 
@@ -295,8 +326,8 @@
     if (_properties != null)
       _properties.markInitialState();
 
-    if (_bindings != null)
-      _bindings.markInitialState();
+    if (_expressions != null)
+      _expressions.markInitialState();
   }
 
   public void restoreState(FacesContext context, Object state)
@@ -314,7 +345,7 @@
         Object propertyState = asArray[0];
         Object bindingsState = asArray[1];
         _getPropertyMap().restoreState(context, getType(), propertyState);
-        _getBindingsMap(true).restoreState(context, getType(), bindingsState);
+        _getExpressionsMap(true).restoreState(context, getType(), bindingsState);
         return;
       }
       else if (asArray.length == 1)
@@ -339,9 +370,9 @@
     Object propertyState = (_properties == null)
                             ? null
                             : _properties.saveState(context);
-    Object bindingsState = (_bindings == null)
+    Object bindingsState = (_expressions == null)
                             ? null
-                            : _bindings.saveState(context);
+                            : _expressions.saveState(context);
 
     if (bindingsState != null)
     {
@@ -390,11 +421,9 @@
     return new FlaggedPropertyMap();
   }
 
-  protected PropertyMap createBindingsMap()
+  protected PropertyMap createExpressionsMap()
   {
-    FlaggedPropertyMap bindings = new FlaggedPropertyMap();
-    bindings.setUseStateHolder(true);
-    return bindings;
+    return new FlaggedPropertyMap();
   }
 
   // "listKey" is unused, but it seems plausible that
@@ -445,17 +474,17 @@
     return _properties;
   }
 
-  private PropertyMap _getBindingsMap(boolean createIfNew)
+  private PropertyMap _getExpressionsMap(boolean createIfNew)
   {
-    if (_bindings == null)
+    if (_expressions == null)
     {
       if (createIfNew)
       {
-        _bindings = createBindingsMap();
+        _expressions = createExpressionsMap();
       }
     }
 
-    return _bindings;
+    return _expressions;
   }
 
 
@@ -474,7 +503,7 @@
   }
 
   private PropertyMap  _properties;
-  private PropertyMap  _bindings;
+  private PropertyMap  _expressions;
   private transient boolean  _initialStateMarked;
 
   static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(FacesBeanImpl.class);

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/DialogSource.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/DialogSource.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/DialogSource.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/DialogSource.java Mon Nov 13 17:34:56 2006
@@ -17,7 +17,7 @@
 
 import javax.faces.component.ActionSource;
 
-import javax.faces.el.MethodBinding;
+import javax.el.MethodExpression;
 
 import org.apache.myfaces.trinidad.event.LaunchListener;
 import org.apache.myfaces.trinidad.event.ReturnListener;
@@ -35,12 +35,12 @@
   public void addReturnListener(ReturnListener listener);
   public void removeReturnListener(ReturnListener listener);
   public ReturnListener[] getReturnListeners();
-  public void setReturnListener(MethodBinding returnListener);
-  public MethodBinding getReturnListener();
+  public void setReturnListener(MethodExpression returnListener);
+  public MethodExpression getReturnListener();
 
   public void addLaunchListener(LaunchListener listener);
   public void removeLaunchListener(LaunchListener listener);
   public LaunchListener[] getLaunchListeners();
-  public void setLaunchListener(MethodBinding launchListener);
-  public MethodBinding getLaunchListener();
+  public void setLaunchListener(MethodExpression launchListener);
+  public MethodExpression getLaunchListener();
 }

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java Mon Nov 13 17:34:56 2006
@@ -17,9 +17,9 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import javax.el.MethodExpression;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
 import javax.faces.event.AbortProcessingException;
 import javax.faces.event.FacesEvent;
 import javax.faces.event.PhaseId;
@@ -36,10 +36,10 @@
     UIXHierarchy  comp, 
     FacesEvent    event,
     RowKeySet     state,
-    MethodBinding disclosureListener) throws AbortProcessingException
+    MethodExpression method) throws AbortProcessingException
   {
   
-        // Notify the specified disclosure listener method (if any)
+    // Notify the specified disclosure listener method (if any)
     if (event instanceof RowDisclosureEvent)
     {
       RowDisclosureEvent dEvent = (RowDisclosureEvent) event;
@@ -65,7 +65,7 @@
       }
       //pu: Implicitly record a Change for 'expandedRowKeys' attribute
       comp.addAttributeChange("expandedRowKeys", state);
-      comp.broadcastToMethodBinding(event, disclosureListener);
+      comp.broadcastToMethodExpression(event, method);
     }
   }
 

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java Mon Nov 13 17:34:56 2006
@@ -24,6 +24,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.faces.FacesException;
+import javax.faces.component.ContextCallback;
 import javax.faces.component.NamingContainer;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -622,9 +624,9 @@
      * @return the local clientId
      */
   @Override
-  protected final String getLocalClientId()
+  public final String getContainerClientId(FacesContext context)
   {
-    String id = super.getLocalClientId();
+    String id = getClientId(context);
     String key = getClientRowKey();
     if (key != null)
     {
@@ -871,6 +873,47 @@
         : new DefaultClientKeyManager();
     }
     return iState._clientKeyMgr;
+  }
+
+  public boolean invokeOnComponent(FacesContext context,
+                                   String clientId, 
+                                   ContextCallback callback)
+    throws FacesException
+  {
+    String thisClientId = getClientId(context);
+    if (clientId.equals(thisClientId))
+    {
+      callback.invokeContextCallback(context, this);
+      return true;
+    }
+    // If we're on a row, set the currency, and invoke
+    // inside
+    else if (clientId.startsWith(thisClientId) &&
+             (clientId.charAt(thisClientId.length()) ==
+              NamingContainer.SEPARATOR_CHAR))
+    {
+      String postId = thisClientId.substring(
+                        thisClientId.length() + 1);
+      int sepIndex = postId.indexOf(NamingContainer.SEPARATOR_CHAR);
+      // If there's no separator character afterwards, then this
+      // isn't a row key
+      if (sepIndex < 0)
+        return super.invokeOnComponent(context, clientId, callback);
+      String currencyString = postId.substring(0, sepIndex);
+      Object oldRowKey = getRowKey();
+      try
+      {
+        setCurrencyString(currencyString);
+        return super.invokeOnComponent(context, clientId, callback);        
+      }
+      finally
+      {
+        // And restore the currency
+        setRowKey(oldRowKey);
+      }
+    }
+    
+    return false;
   }
 
   /**

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java Mon Nov 13 17:34:56 2006
@@ -15,15 +15,10 @@
  */
 package org.apache.myfaces.trinidad.component;
 
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
 import javax.faces.component.UIComponent;
 
-import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
-import javax.faces.event.FacesListener;
+import javax.el.MethodExpression;
+
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.event.AttributeChangeListener;
 
@@ -38,40 +33,8 @@
   abstract public void removeAttributeChangeListener(AttributeChangeListener acl);
   abstract public AttributeChangeListener[] getAttributeChangeListeners();
 
-  abstract public void setAttributeChangeListener(MethodBinding mb);
-  abstract public MethodBinding getAttributeChangeListener();
+  abstract public void setAttributeChangeListener(MethodExpression me);
+  abstract public MethodExpression getAttributeChangeListener();
 
   abstract public void markInitialState();
-
-  // JSF 1.2 methods that we're adding up front
-  abstract public int getFacetCount();
-  abstract public void encodeAll(FacesContext context) throws IOException;
-
-  
-  // Everything below here is a UIComponent method
-
-  @SuppressWarnings("unchecked")
-  @Override
-  public abstract Map getAttributes();
-
-  @SuppressWarnings("unchecked")
-  @Override
-  public abstract List getChildren();
-
-  @SuppressWarnings("unchecked")
-  @Override
-  public abstract Map getFacets();
-
-  @SuppressWarnings("unchecked")
-  @Override
-  public abstract Iterator getFacetsAndChildren();
-
-  @SuppressWarnings("unchecked")
-  @Override
-  protected abstract FacesListener[] getFacesListeners(Class clazz);
-
-  public abstract Object saveState(FacesContext context);
-  public abstract void restoreState(FacesContext context, Object state);
-  public abstract boolean isTransient();
-  public abstract void setTransient(boolean trans);
 }

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java Mon Nov 13 17:34:56 2006
@@ -25,6 +25,11 @@
 import java.util.NoSuchElementException;
 import java.util.Properties;
 
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+
 import javax.faces.component.NamingContainer;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -80,8 +85,7 @@
   static private final PropertyKey _LISTENERS_KEY =
     TYPE.registerKey("listeners", FacesListener[].class, PropertyKey.CAP_LIST);
   static private final PropertyKey _ATTRIBUTE_CHANGE_LISTENER_KEY =
-    TYPE.registerKey("attributeChangeListener", MethodBinding.class,
-                     PropertyKey.CAP_STATE_HOLDER);
+    TYPE.registerKey("attributeChangeListener", MethodExpression.class);
   // =-=AEW "parent", "rendersChildren", "childCount", "children",
   // "facets", "facetsAndChildren", "family" all are technically
   // bean properties, but they aren't exposed here...
@@ -164,18 +168,63 @@
   }
 
   @Override
-  public void setAttributeChangeListener(MethodBinding mb)
+  public void setAttributeChangeListener(MethodExpression mb)
   {
     setProperty(_ATTRIBUTE_CHANGE_LISTENER_KEY, mb);
   }
 
+  @Deprecated
+  public void setAttributeChangeListener(MethodBinding mb)
+  {
+    setAttributeChangeListener(adaptMethodBinding(mb));
+  }
+
   @Override
-  public MethodBinding getAttributeChangeListener()
+  public MethodExpression getAttributeChangeListener()
   {
-    return (MethodBinding) getProperty(_ATTRIBUTE_CHANGE_LISTENER_KEY);
+    return (MethodExpression) getProperty(_ATTRIBUTE_CHANGE_LISTENER_KEY);
   }
 
 
+  @Override
+  public ValueExpression getValueExpression(String name)
+  {
+    if (name == null)
+      throw new NullPointerException();
+
+    PropertyKey key = getPropertyKey(name);
+
+    // Support standard RI behavior where getValueBinding()
+    // doesn't complain about being asked for a ValueBinding -
+    // but continue supporting strict behavior at FacesBean layer.
+    if (!key.getSupportsBinding())
+      return null;
+
+    return getFacesBean().getValueExpression(key);
+  }
+
+  @Override
+  public void setValueExpression(String name, 
+                                 ValueExpression expression)
+  {
+    if (name == null)
+      throw new NullPointerException();
+
+    if (expression.isLiteralText())
+    {
+      ELContext context =
+          FacesContext.getCurrentInstance().getELContext();
+      getAttributes().put(name, expression.getValue(context));
+    }
+    else
+    {
+      PropertyKey key = getPropertyKey(name);
+      getFacesBean().setValueExpression(key, expression);
+    }
+  }
+
+
+
   /**
    */
   @Override
@@ -207,9 +256,8 @@
   }
 
 
-  @SuppressWarnings("unchecked")
   @Override
-  public Map getAttributes()
+  public Map<String, Object> getAttributes()
   {
     if (_attributes == null)
       _init(null);
@@ -226,7 +274,7 @@
     // NOTE - client ids cannot be cached because the generated
     // value has to be dynamically calculated in some cases (UIData)
 
-    String clientId = getLocalClientId();
+    String clientId = getId();
     if (clientId == null)
     {
       clientId = (String) getProperty(_GENERATED_ID_KEY);
@@ -243,7 +291,7 @@
     {
       if (containerComponent instanceof NamingContainer)
       {
-        clientId = (containerComponent.getClientId(context) +
+        clientId = (containerComponent.getContainerClientId(context) +
                     NamingContainer.SEPARATOR_CHAR +
                     clientId);
         break;
@@ -317,13 +365,11 @@
     setBooleanProperty(RENDERED_KEY, rendered);
   }
 
-  @Override
   public boolean isTransient()
   {
     return getBooleanProperty(TRANSIENT_KEY, false);
   }
 
-  @Override
   public void setTransient(boolean newTransient)
   {
     setBooleanProperty(TRANSIENT_KEY, newTransient);
@@ -458,9 +504,8 @@
    * <p>Create (if necessary) and return a List of the children associated
    * with this component.</p>
    */
-  @SuppressWarnings("unchecked")
   @Override
-  public List getChildren()
+  public List<UIComponent> getChildren()
   {
     if (_children == null)
       _children = new ChildArrayList(this);
@@ -481,9 +526,8 @@
    * <p>Create (if necessary) and return a Map of the facets associated
    * with this component.</p>
    */
-  @SuppressWarnings("unchecked")
   @Override
-  public Map getFacets()
+  public Map<String, UIComponent> getFacets()
   {
 
     if (_facets == null)
@@ -500,7 +544,7 @@
       throw new NullPointerException();
     if (_facets == null)
       return null;
-    return (UIComponent) getFacets().get(facetName);
+    return getFacets().get(facetName);
   }
 
 
@@ -522,9 +566,8 @@
   /**
    * @todo optimize to a compound iterator
    */
-  @SuppressWarnings("unchecked")
   @Override
-  public Iterator getFacetsAndChildren()
+  public Iterator<UIComponent> getFacetsAndChildren()
   {
     // =-=AEW Is this supposed to be an immutable Iterator?
     if (_facets == null)
@@ -560,7 +603,6 @@
 
   // ------------------------------------------- Event processing methods
 
-  @SuppressWarnings("unchecked")
   @Override
   public void broadcast(FacesEvent event)
     throws AbortProcessingException
@@ -593,7 +635,7 @@
 
     if (event instanceof AttributeChangeEvent)
     {
-      broadcastToMethodBinding(event, getAttributeChangeListener());
+      broadcastToMethodExpression(event, getAttributeChangeListener());
     }
   }
 
@@ -601,7 +643,6 @@
   // ------------------------------------------- Lifecycle Processing Methods
 
 
-  @SuppressWarnings("unchecked")
   @Override
   public void decode(FacesContext context)
   {
@@ -609,9 +650,7 @@
       throw new NullPointerException();
 
     // Find all the partialTriggers and save on the context
-    // -= Simon Lessard =-
-    // FIXME: JSF 1.2 specify <String, Object>
-    Map<Object, Object> attrs = getAttributes();
+    Map<String, Object> attrs = getAttributes();
     Object triggers = attrs.get("partialTriggers");
     if (triggers instanceof String[])
     {
@@ -818,13 +857,11 @@
     getFacesBean().markInitialState();
   }
 
-  @Override
   public Object saveState(FacesContext context)
   {
     return getFacesBean().saveState(context);
   }
 
-  @Override
   public void restoreState(FacesContext context, Object stateObj)
   {
     getFacesBean().restoreState(context, stateObj);
@@ -879,7 +916,6 @@
    * component.
    * @param context the current FacesContext
    */
-  @SuppressWarnings("unchecked")
   protected void decodeChildrenImpl(FacesContext context)
   {
     Iterator<UIComponent> kids = getFacetsAndChildren();
@@ -915,7 +951,6 @@
    * component.
    * @param context the current FacesContext
    */
-  @SuppressWarnings("unchecked")
   protected void validateChildrenImpl(FacesContext context)
   {
     // Process all the facets and children of this component
@@ -947,7 +982,6 @@
     updateChildrenImpl(context);
   }
 
-  @SuppressWarnings("unchecked")
   protected void updateChildrenImpl(FacesContext context)
   {
     // Process all the facets and children of this component
@@ -977,7 +1011,6 @@
     getFacesBean().removeEntry(_LISTENERS_KEY, listener);
   }
 
-  @SuppressWarnings("unchecked")
   @Override
   protected FacesListener[] getFacesListeners(Class clazz)
   {
@@ -1116,15 +1149,6 @@
     return n.intValue();
   }
 
-  /**
-   * Returns the default local client identifier, relative to the current
-   * naming container.
-   */
-  protected String getLocalClientId()
-  {
-    return getId();
-  }
-
 
   /**
    * Return the number of facets.  This is more efficient than
@@ -1145,6 +1169,7 @@
    * This can be used to support MethodBindings such as the "actionListener"
    * binding on ActionSource components:
    * &lt;tr:commandButton actionListener="#{mybean.myActionListener}">
+   * @deprecated
    */
   protected final void broadcastToMethodBinding(
     FacesEvent event,
@@ -1169,10 +1194,46 @@
   }
 
   /**
+   * Given a MethodBinding, create a MethodExpression that
+   * adapts it.
+   */
+  static public MethodExpression adaptMethodBinding(MethodBinding binding)
+  {
+    return new MethodBindingMethodExpression(binding);
+  }
+
+  /**
+   * Broadcast an event to a MethodExpression.
+   * This can be used to support MethodBindings such as the "actionListener"
+   * binding on ActionSource components:
+   * &lt;tr:commandButton actionListener="#{mybean.myActionListener}">
+   */
+  protected final void broadcastToMethodExpression(
+    FacesEvent event,
+    MethodExpression method) throws AbortProcessingException
+  {
+    if (method != null)
+    {
+      try
+      {
+        FacesContext context = getFacesContext();
+        method.invoke(context.getELContext(), new Object[] { event });
+      }
+      catch (ELException ee)
+      {
+        Throwable t = ee.getCause();
+        // Unwrap AbortProcessingExceptions
+        if (t instanceof AbortProcessingException)
+          throw ((AbortProcessingException) t);
+        throw ee;
+      }
+    }
+  }
+
+  /**
    * render a component. this is called by renderers whose
    * getRendersChildren() return true.
    */
-  @SuppressWarnings("unchecked")
   void __encodeRecursive(FacesContext context, UIComponent component)
     throws IOException
   {
@@ -1187,7 +1248,7 @@
       {
         if (component.getChildCount() > 0)
         {
-          for(UIComponent child : (List<UIComponent>)component.getChildren())
+          for(UIComponent child : component.getChildren())
           {
             __encodeRecursive(context, child);
           }
@@ -1199,7 +1260,6 @@
   }
 
 
-  @SuppressWarnings("unchecked")
   static private UIComponent _findInsideOf(
     UIComponent from,
     String id)

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/ColorConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/ColorConverter.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/ColorConverter.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/ColorConverter.java Mon Nov 13 17:34:56 2006
@@ -19,6 +19,8 @@
 
 import java.text.ParseException;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.StateHolder;
 import javax.faces.component.UIComponent;
@@ -397,6 +399,42 @@
   }
 
   /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ConverterUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ConverterUtils.getValueExpression(_facesBean, name);
+  }
+
+  /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
    *
@@ -408,6 +446,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this converter
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -425,6 +464,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this converter
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/ConverterUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/ConverterUtils.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/ConverterUtils.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/ConverterUtils.java Mon Nov 13 17:34:56 2006
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 package org.apache.myfaces.trinidad.convert;
+
+import javax.el.ValueExpression;
 import javax.faces.component.UIComponent;
 import javax.faces.el.ValueBinding;
 
@@ -54,6 +56,19 @@
    return bean;
  } 
  
+  static void setValueExpression(FacesBean bean, String name, ValueExpression expression)
+  {   
+    PropertyKey key = _getPropertyKey(bean, name, true);
+    bean.setValueExpression(key, expression);
+  }
+ 
+  static ValueExpression getValueExpression(FacesBean bean, String name)
+  {
+    PropertyKey key = _getPropertyKey(bean, name, true);
+    return bean.getValueExpression(key);
+  }
+
+
   static void setValueBinding(FacesBean bean, String name, ValueBinding binding)
   {   
     PropertyKey key = _getPropertyKey(bean, name, true);

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/DateTimeConverter.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/DateTimeConverter.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/DateTimeConverter.java Mon Nov 13 17:34:56 2006
@@ -30,6 +30,8 @@
 import java.util.Set;
 import java.util.TimeZone;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.StateHolder;
 import javax.faces.component.UIComponent;
@@ -881,6 +883,42 @@
   }
 
   /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ConverterUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ConverterUtils.getValueExpression(_facesBean, name);
+  }
+
+  /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
    *
@@ -892,6 +930,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this converter
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -910,6 +949,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this converter
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java Mon Nov 13 17:34:56 2006
@@ -26,6 +26,8 @@
 import java.util.Locale;
 import java.util.Map;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -322,6 +324,42 @@
   }
 
   /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ConverterUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ConverterUtils.getValueExpression(_facesBean, name);
+  }
+
+  /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
    *
@@ -333,6 +371,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this converter
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -350,6 +389,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this converter
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ProcessMenuModel.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ProcessMenuModel.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ProcessMenuModel.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ProcessMenuModel.java Mon Nov 13 17:34:56 2006
@@ -106,7 +106,7 @@
   public ProcessMenuModel(
     Object instance,
     String viewIdProperty,
-    Object maxPathKey
+    String maxPathKey
   )throws IntrospectionException
   {
     super(instance, viewIdProperty);
@@ -148,7 +148,7 @@
   */
   public boolean isImmediate()
   {
-    Object maxPathKey = getMaxPathKey();
+    String maxPathKey = getMaxPathKey();
     if ( maxPathKey == null)
       return ProcessUtils.isImmediate(this, false);
     else
@@ -186,7 +186,7 @@
   */
   public boolean isReadOnly()
   {
-    Object maxPathKey = getMaxPathKey();
+    String maxPathKey = getMaxPathKey();
     if (maxPathKey == null)
       return ProcessUtils.isReadOnly(this, true);
     else
@@ -201,20 +201,20 @@
    */
   public void clearMaxPath()
   {
-    Object maxPathKey = getMaxPathKey();
+    String maxPathKey = getMaxPathKey();
     if ( maxPathKey != null)
       ProcessUtils.clearMaxPath(maxPathKey);
   }
 
-  public void setMaxPathKey(Object maxPathKey)
+  public void setMaxPathKey(String maxPathKey)
   {
     _maxPathKey = maxPathKey;
   }
 
-  public Object getMaxPathKey()
+  public String getMaxPathKey()
   {
     return _maxPathKey;
   }
 
-  Object _maxPathKey = null;
+  private String _maxPathKey;
 }

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ProcessUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ProcessUtils.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ProcessUtils.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/ProcessUtils.java Mon Nov 13 17:34:56 2006
@@ -322,13 +322,12 @@
   @SuppressWarnings("unchecked")
   public static Object getMaxVisitedRowKey(
     MenuModel model,
-    Object    maxPathKey
+    String    maxPathKey
   )
   {
     //TODO - what if maxPathKey is null
     ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
-    //FIXME As of JSF 1.2, the request map is <String, Object> 
-    Map<Object, Object> requestMap = externalContext.getRequestMap();
+    Map<String, Object> requestMap = externalContext.getRequestMap();
 
 
 
@@ -339,9 +338,7 @@
 
       //TODO - if I change this to use pageFlowScope it doesn't work.
       // figure out why.
-      // FIXME: -= Simon Lessard
-      //        session map is <String, Object> as of JSF 1.2
-      Map<Object,Object> sessionMap  = externalContext.getSessionMap();
+      Map<String,Object> sessionMap  = externalContext.getSessionMap();
 
       Map<Object,Object> maxPathMap = (Map<Object,Object>)sessionMap.get(maxPathKey);
       if (maxPathMap == null)
@@ -404,13 +401,12 @@
 
   @SuppressWarnings("unchecked")
   public static void clearMaxPath(
-    Object maxPathKey
+    String maxPathKey
   )
   {
     if (maxPathKey != null)
     {
-      // FIXME As of JSF 1.2, the request map is <String, Object> 
-      Map<Object, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
+      Map<String, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
       sessionMap.put(maxPathKey, null);
     }
   }

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/MessageFactory.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/MessageFactory.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/MessageFactory.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/MessageFactory.java Mon Nov 13 17:34:56 2006
@@ -19,7 +19,8 @@
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
+
+import javax.el.ValueExpression;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
@@ -412,11 +413,11 @@
     for (int i = 0; i < parameters.length; i++)
     {
       Object o = parameters[i];
-      if (o instanceof ValueBinding)
+      if (o instanceof ValueExpression)
       {
         if (context == null)
           context = FacesContext.getCurrentInstance();
-        o = ((ValueBinding) o).getValue(context);
+        o = ((ValueExpression) o).getValue(context.getELContext());
       }
       
       resolvedParameters[i] = o;
@@ -441,7 +442,7 @@
 
     for (int i = 0; i < parameters.length; i++)
     {
-      if (parameters[i] instanceof ValueBinding)
+      if (parameters[i] instanceof ValueExpression)
         return true;
     }
 
@@ -455,7 +456,7 @@
     Object[] parameters)
   {
     _assertIsValidCustomMessageType(customMessagePattern);
-    boolean isCustomMsgValueBound = (customMessagePattern instanceof ValueBinding);
+    boolean isCustomMsgValueBound = (customMessagePattern instanceof ValueExpression);
     boolean containsBinding = _containsBinding(parameters);
     if (isCustomMsgValueBound || containsBinding)
     {
@@ -466,7 +467,7 @@
       }
       else
       {
-        ValueBinding customMessage = (ValueBinding)customMessagePattern;
+        ValueExpression customMessage = (ValueExpression)customMessagePattern;
         return new CustomDetailErrorMessage(summary, customMessage,
                                             parameters, containsBinding);
       }
@@ -488,14 +489,14 @@
     {
       o = component.getAttributes().get("label");
       if (o == null)
-        o = component.getValueBinding("label");
+        o = component.getValueExpression ("label");
     }
     return o;
   }
 
   private static void _assertIsValidCustomMessageType(Object customMessagePattern)
   {
-    if (!(customMessagePattern instanceof ValueBinding ||
+    if (!(customMessagePattern instanceof ValueExpression  ||
          customMessagePattern instanceof String))
          throw new IllegalArgumentException("custom message should be of type ValueBinding or String");
   }
@@ -608,7 +609,7 @@
 
     CustomDetailErrorMessage(
       String messageFormat,
-      ValueBinding customDetailErrorMessage,
+      ValueExpression customDetailErrorMessage,
       Object[] parameters,
       boolean hasBoundParameters
     )
@@ -625,7 +626,7 @@
     public String getDetailMessage()
     {
       FacesContext context    = FacesContext.getCurrentInstance();
-      String detailMsgPattern = (String)_customDetailErrorMessage.getValue(context);
+      String detailMsgPattern = (String)_customDetailErrorMessage.getValue(context.getELContext());
       if(detailMsgPattern == null)
       {
         // Set a default message that might get used by FacesException 
@@ -649,7 +650,7 @@
       return _getFormattedString(detailMsgPattern, params);
     }
 
-    private ValueBinding _customDetailErrorMessage;
+    private ValueExpression _customDetailErrorMessage;
     private boolean _hasBoundParameters;
   }
 

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ByteLengthValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ByteLengthValidator.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ByteLengthValidator.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ByteLengthValidator.java Mon Nov 13 17:34:56 2006
@@ -19,6 +19,8 @@
 
 import java.nio.charset.IllegalCharsetNameException;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.StateHolder;
 import javax.faces.component.UIComponent;
@@ -242,6 +244,43 @@
     _isTransient = transientValue;
   }
 
+
+  /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ValidatorUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ValidatorUtils.getValueExpression(_facesBean, name);
+  }
+
   /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
@@ -254,6 +293,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this validator
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -271,6 +311,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this validator
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateRestrictionValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateRestrictionValidator.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateRestrictionValidator.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateRestrictionValidator.java Mon Nov 13 17:34:56 2006
@@ -25,6 +25,8 @@
 import java.util.Set;
 import java.util.TimeZone;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.StateHolder;
 import javax.faces.component.UIComponent;
@@ -236,6 +238,44 @@
   }
   //  End of StateHolder Methods
 
+
+  /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ValidatorUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ValidatorUtils.getValueExpression(_facesBean, name);
+  }
+
+
   /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
@@ -248,6 +288,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this validator
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -265,6 +306,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this validator
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateTimeRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateTimeRangeValidator.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateTimeRangeValidator.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateTimeRangeValidator.java Mon Nov 13 17:34:56 2006
@@ -18,6 +18,8 @@
 
 import java.util.Date;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.StateHolder;
 import javax.faces.component.UIComponent;
@@ -337,6 +339,44 @@
     _facesBean.restoreState(context, state);
   }
 
+
+  /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ValidatorUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ValidatorUtils.getValueExpression(_facesBean, name);
+  }
+
+
   /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
@@ -349,6 +389,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this validator
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -366,6 +407,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this validator
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DoubleRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DoubleRangeValidator.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DoubleRangeValidator.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DoubleRangeValidator.java Mon Nov 13 17:34:56 2006
@@ -16,6 +16,8 @@
 
 package org.apache.myfaces.trinidad.validator;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -288,6 +290,43 @@
   }
 
   /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ValidatorUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ValidatorUtils.getValueExpression(_facesBean, name);
+  }
+
+
+  /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
    *
@@ -299,6 +338,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this validator
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -316,6 +356,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this validator
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/LengthValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/LengthValidator.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/LengthValidator.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/LengthValidator.java Mon Nov 13 17:34:56 2006
@@ -16,6 +16,8 @@
 
 package org.apache.myfaces.trinidad.validator;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -290,6 +292,43 @@
   }
 
   /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ValidatorUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ValidatorUtils.getValueExpression(_facesBean, name);
+  }
+
+
+  /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
    *
@@ -301,6 +340,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this validator
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -318,6 +358,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this validator
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/LongRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/LongRangeValidator.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/LongRangeValidator.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/LongRangeValidator.java Mon Nov 13 17:34:56 2006
@@ -16,11 +16,14 @@
 
 package org.apache.myfaces.trinidad.validator;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
 
+
 import javax.faces.validator.Validator;
 import javax.faces.validator.ValidatorException;
 
@@ -290,6 +293,43 @@
   }
 
   /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ValidatorUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ValidatorUtils.getValueExpression(_facesBean, name);
+  }
+
+
+  /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
    *
@@ -301,6 +341,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this validator
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -318,6 +359,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this validator
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/RegExpValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/RegExpValidator.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/RegExpValidator.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/RegExpValidator.java Mon Nov 13 17:34:56 2006
@@ -19,6 +19,8 @@
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.component.StateHolder;
 import javax.faces.component.UIComponent;
@@ -164,6 +166,44 @@
     _facesBean.restoreState(context, state);
   }
 
+
+  /**
+   * <p>Set the {@link ValueExpression} used to calculate the value for the
+   * specified attribute if any.</p>
+   *
+   * @param name Name of the attribute for which to set a {@link ValueExpression}
+   * @param expression The {@link ValueExpression} to set, or <code>null</code>
+   *  to remove any currently set {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   *            attribute of this converter
+   */
+  public void setValueExpression(String name, ValueExpression expression)
+  {
+    ValidatorUtils.setValueExpression(_facesBean, name, expression) ;
+  }
+
+
+  /**
+   * <p>Return the {@link ValueExpression} used to calculate the value for the
+   * specified attribute name, if any.</p>
+   *
+   * @param name Name of the attribute or property for which to retrieve a
+   *  {@link ValueExpression}
+   *
+   * @exception NullPointerException if <code>name</code>
+   *  is <code>null</code>
+   * @exception IllegalArgumentException if <code>name</code> is not a valid
+   * attribute of this converter
+   */
+  public ValueExpression getValueExpression(String name)
+  {
+    return ValidatorUtils.getValueExpression(_facesBean, name);
+  }
+
+
   /**
    * <p>Set the {@link ValueBinding} used to calculate the value for the
    * specified attribute if any.</p>
@@ -176,6 +216,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    *            attribute of this validator
+   * @deprecated
    */
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -193,6 +234,7 @@
    *  is <code>null</code>
    * @exception IllegalArgumentException if <code>name</code> is not a valid
    * attribute of this validator
+   * @deprecated
    */
   public ValueBinding getValueBinding(String name)
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ValidatorUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ValidatorUtils.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ValidatorUtils.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ValidatorUtils.java Mon Nov 13 17:34:56 2006
@@ -14,6 +14,9 @@
  * limitations under the License.
  */
 package org.apache.myfaces.trinidad.validator;
+
+import javax.el.ValueExpression;
+
 import javax.faces.component.UIComponent;
 import javax.faces.el.ValueBinding;
 
@@ -69,6 +72,18 @@
     return bean;
   }  
  
+  static void setValueExpression(FacesBean bean, String name, ValueExpression expression)
+  {   
+    PropertyKey key = _getPropertyKey(bean, name, true);
+    bean.setValueExpression(key, expression);
+  }
+ 
+  static ValueExpression getValueExpression(FacesBean bean, String name)
+  {
+    PropertyKey key = _getPropertyKey(bean, name, true);
+    return bean.getValueExpression(key);
+  }
+
   static void setValueBinding(FacesBean bean, String name, ValueBinding binding)
   {   
     PropertyKey key = _getPropertyKey(bean, name, true);

Copied: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java (from r474585, incubator/adffaces/branches/faces-1_2-061031/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java)
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java?view=diff&rev=474621&p1=incubator/adffaces/branches/faces-1_2-061031/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java&r1=474585&p2=incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061031/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentELTag.java Mon Nov 13 17:34:56 2006
@@ -150,6 +150,45 @@
   }
 
   /**
+   * Set a property of type java.lang.Number.  If the value
+   * is an EL expression, it will be stored as a ValueBinding.
+   * Otherwise, it will parsed with Integer.valueOf() or Double.valueOf() .
+   * Null values are ignored.
+   */
+  protected void setNumberProperty(
+    FacesBean   bean,
+    PropertyKey key,
+    ValueExpression expression)
+  {
+    if (expression == null)
+      return;
+
+    if (expression.isLiteralText())
+    {
+      Object value = expression.getValue(null);
+      if (value != null)
+      { 
+        if (value instanceof Number)
+        {
+          bean.setProperty(key, value);
+        }
+        else
+        {
+          String valueStr = value.toString();
+          if(valueStr.indexOf('.') == -1)
+            bean.setProperty(key, Integer.valueOf(valueStr));
+          else
+            bean.setProperty(key, Double.valueOf(valueStr));
+        }
+      }
+    }
+    else
+    {
+      bean.setValueExpression(key, expression);
+    }
+  }
+
+  /**
    * Set a property of type int[].  If the value
    * is an EL expression, it will be stored as a ValueExpression.
    * Otherwise, it will parsed as a whitespace-separated series

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java Mon Nov 13 17:34:56 2006
@@ -23,6 +23,8 @@
 import java.util.Date;
 import java.util.Iterator;
 
+import javax.el.MethodExpression;
+
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.el.MethodBinding;
@@ -132,10 +134,14 @@
 
     if (_attributeChangeListener != null)
     {
-      MethodBinding mb =
-        createMethodBinding(_attributeChangeListener,
-                            new Class[]{AttributeChangeEvent.class});
-      uixComponent.setAttributeChangeListener(mb);
+      MethodExpression me = getFacesContext().getApplication().
+         getExpressionFactory().createMethodExpression(
+             getFacesContext().getELContext(),
+             _attributeChangeListener,
+             null,
+             new Class[]{AttributeChangeEvent.class});
+
+      uixComponent.setAttributeChangeListener(me);
     }
 
 

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/site/xdoc/tagdoc/tr_forEach.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/site/xdoc/tagdoc/tr_forEach.xml?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/site/xdoc/tagdoc/tr_forEach.xml (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/site/xdoc/tagdoc/tr_forEach.xml Mon Nov 13 17:34:56 2006
@@ -25,34 +25,17 @@
    <br/>
 <p>
         The forEach tag is a replacement for the JSTL
-&lt;c:forEach&gt; tag that works with ADF Faces components.  In JSF
-1.1, &lt;c:forEach&gt; cannot be used with any JSF components or tags.
+&lt;c:forEach&gt; tag.  Though as of JSF 1.2/JSP 2.1/JSTL 1.2,
+&lt;c:forEach&gt; can be used with any JSF components or tags,
+it does not support "varStatus".  This tag adds support for varStatus
+(other than "current" which is not supported).
 (<b>Note</b>: this tag is not supported in Facelets, because c:forEach
-is functional in Facelets.  It will also be removed in JSF 1.2/JSP
-2.1, because c:forEach will become functional there too.)  This tag
-brings that functionality to JSF, but it is limited to ADF Faces tags.
-This tag also has several limitations not found in &lt;c:forEach&gt;:
-
-<ul>
-
-<li>&lt;tr:forEach&gt; does not currently support scenarios where the
-size of the "items" list or array changes from one request to the
-next. It may be possible to work around this in specific scenarios by
-manually deleting all children of the parent component
-(&lt;tr:selectOneListbox&gt; in the above example), but this has not
-yet been tested.</li>
-
-<li>&lt;tr:forEach&gt; does not support arbitrary
+is fully functional in Facelets.)  Unlike the old Trinidad tr:forEach
+built with JSF 1.1, however, this tag can be used with any JSP 2.1-based
+tag, JSF or non-JSF.  This tag also has a limitation not found in &lt;c:forEach&gt;:  &lt;tr:forEach&gt; does not currently support arbitrary
 java.util.Collections; it can only iterate over java.util.Lists or
-arrays.</li>
-
-<li>&lt;tr:forEach&gt; executes at the time the JSP tag executes. So
-it does not have access to any EL variables that are created by JSF
-components.  For example, the &lt;tr:table&gt; creates an EL variable
-using the value of the "var" attribute. However, this EL variable is
-not available to &lt;tr:forEach&gt;</li>
-
-</ul></p><h4>Example:</h4><source>
+arrays.</p>
+<h4>Example:</h4><source>
             &lt;tr:selectOneListbox value="#{someValue}"&gt;
               &lt;tr:forEach var="item" items="#{model.listOfItems}"&gt;
                 &lt;tr:selectItem value="#{item.value}" text="#{item.text}"/&gt;
@@ -105,7 +88,7 @@
 <td>varStatus</td><td>String</td><td>No</td><td>
 
           name of the loop status exposed when iterating. The properties
-		'index','count','begin','end','step','current','first','last'
+		'index','count','begin','end','step','first','last'
 		are available through this
         </td>
 </tr>

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/bean/FacesBeanImplTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/bean/FacesBeanImplTest.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/bean/FacesBeanImplTest.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/bean/FacesBeanImplTest.java Mon Nov 13 17:34:56 2006
@@ -31,7 +31,9 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-public class FacesBeanImplTest extends TestCase
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
+public class FacesBeanImplTest extends FacesTestCase
 {
   public static final Test suite()
   {
@@ -50,13 +52,15 @@
   }
 
   @Override
-  public void setUp()
+  protected void setUp() throws Exception
   {
+    super.setUp();
   }
 
   @Override
-  public void tearDown()
+  protected void tearDown() throws Exception
   {
+    super.tearDown();
   }
 
   public void testInitialValues()

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/bean/TestValueBinding.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/bean/TestValueBinding.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/bean/TestValueBinding.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/bean/TestValueBinding.java Mon Nov 13 17:34:56 2006
@@ -19,7 +19,13 @@
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
 
-public class TestValueBinding extends ValueBinding implements StateHolder
+import java.io.Serializable;
+
+// =-=AdamWiner FIXME We shouldn't have to implement Serializable
+// on ValueBindings - FacesBeanImpl is not handling ValueExpressions
+// around non-serializable ValueBindings
+public class TestValueBinding extends ValueBinding implements StateHolder, 
+                                                              Serializable
 {
   public TestValueBinding()
   {

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/AttributeChangeTester.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/AttributeChangeTester.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/AttributeChangeTester.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/AttributeChangeTester.java Mon Nov 13 17:34:56 2006
@@ -15,8 +15,9 @@
  */
 package org.apache.myfaces.trinidad.component;
 
-import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
 
 import org.apache.myfaces.trinidad.event.AttributeChangeEvent;
 import org.apache.myfaces.trinidad.event.AttributeChangeListener;
@@ -24,7 +25,7 @@
 /**
  * Utility class for testing out AttributeChange events.
  */
-public class AttributeChangeTester extends MethodBinding
+public class AttributeChangeTester extends MethodExpression
  implements AttributeChangeListener
 {
   public AttributeChangeTester()
@@ -38,8 +39,13 @@
     _listenerCalled = true;
   }
 
+  public MethodInfo getMethodInfo(ELContext context)
+  {
+    return null;
+  }
+
   @Override
-  public Object invoke(FacesContext context, Object params[])
+  public Object invoke(ELContext context, Object params[])
   {
     if (params.length != 1)
       throw new IllegalStateException("Params not of length 1");
@@ -52,10 +58,24 @@
     return null;
   }
 
-  @Override
-  public Class<?> getType(FacesContext context)
+  public String getExpressionString()
   {
     return null;
+  }
+
+  public boolean isLiteralText()
+  {
+    return false;
+  }
+
+  public int hashCode()
+  {
+    return 0;
+  }
+
+  public boolean equals(Object o)
+  {
+    return o == this;
   }
 
   public void verify()

Modified: incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIComponentTestCase.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIComponentTestCase.java?view=diff&rev=474621&r1=474620&r2=474621
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIComponentTestCase.java (original)
+++ incubator/adffaces/branches/faces-1_2-061113/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIComponentTestCase.java Mon Nov 13 17:34:56 2006
@@ -280,13 +280,19 @@
       mockRenderer.expects(never()).method("decode");
     }
 
-    doTestApplyRequestValues(facesContext, root, component);
+    try
+    {
+      setCurrentContext(facesContext);
+      doTestApplyRequestValues(facesContext, root, component);
+    }
+    finally
+    {
+      setCurrentContext(null);
+    }
 
     mockRenderKitFactory.verify();
     mockRenderkit.verify();
     mockRenderer.verify();
-
-    setCurrentContext(null);
   }
 
 



Mime
View raw message