incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r466185 - in /incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal: application/ binding/ io/ menu/
Date Fri, 20 Oct 2006 16:27:56 GMT
Author: awiner
Date: Fri Oct 20 09:27:54 2006
New Revision: 466185

URL: http://svn.apache.org/viewvc?view=rev&rev=466185
Log:
Merge back JSF 1.2 modifications, one step at a time.  Having svn problems with some files

Removed:
    incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/ValueBindingAdapter.java
Modified:
    incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java
    incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java
    incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java
    incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java
    incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java

Modified: incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java?view=diff&rev=466185&r1=466184&r2=466185
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java
(original)
+++ incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java
Fri Oct 20 09:27:54 2006
@@ -30,6 +30,7 @@
 
 import javax.faces.FacesException;
 import javax.faces.application.ViewHandler;
+import javax.faces.application.ViewHandlerWrapper;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
@@ -56,7 +57,7 @@
  *   OK for now, because it's intended for use while developing, not while
  *   deployed - yet it's on all the time.  Hrm.
  */
-public class ViewHandlerImpl extends ViewHandler
+public class ViewHandlerImpl extends ViewHandlerWrapper
 {
   static public final String ALTERNATE_VIEW_HANDLER =
     "org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER";
@@ -69,16 +70,9 @@
     _loadInternalViews();
   }
 
-  @Override
-  public Locale calculateLocale(FacesContext context)
-  {
-    return _delegate.calculateLocale(context);
-  }
-
-  @Override
-  public String calculateRenderKitId(FacesContext context)
+  protected ViewHandler getWrapped()
   {
-    return _delegate.calculateRenderKitId(context);
+    return _delegate;
   }
 
   @Override
@@ -117,13 +111,13 @@
       }
     }
 
-    return _delegate.createView(context, viewId);
+    return super.createView(context, viewId);
   }
 
   @Override
   public String getActionURL(FacesContext context, String viewId)
   {
-    String actionURL = _delegate.getActionURL(context, viewId);
+    String actionURL = super.getActionURL(context, viewId);
     RequestContext afContext = RequestContext.getCurrentInstance();
     if (afContext != null)
     {
@@ -140,7 +134,7 @@
     FacesContext context,
     String       path)
   {
-    return _delegate.getResourceURL(context, path);
+    return super.getResourceURL(context, path);
   }
 
 
@@ -175,7 +169,7 @@
         }
         else
         {
-          _delegate.renderView(context, viewToRender);
+          super.renderView(context, viewToRender);
         }
 
         if (service != null)
@@ -259,7 +253,7 @@
       return null;
     }
 
-    UIViewRoot result = _delegate.restoreView(context, viewId);
+    UIViewRoot result = super.restoreView(context, viewId);
     // If we've successfully restored a view, then assume that
     // this is a postback request.
     if (result != null)
@@ -288,7 +282,7 @@
         service.isStateless(context))
       return;
 
-    _delegate.writeState(context);
+    super.writeState(context);
   }
 
   synchronized private void _initIfNeeded(FacesContext context)

Modified: incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java?view=diff&rev=466185&r1=466184&r2=466185
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java
(original)
+++ incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java
Fri Oct 20 09:27:54 2006
@@ -15,8 +15,11 @@
  */
 package org.apache.myfaces.trinidadinternal.binding;
 
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
+import java.io.Serializable;
+
+import javax.el.ValueExpression;
+import javax.el.ELContext;
+import javax.el.PropertyNotWritableException;
 
 import org.apache.myfaces.trinidadinternal.util.nls.StringUtils;
 
@@ -27,25 +30,25 @@
  *
  * @author The Oracle ADF Faces Team
  */
-public class AccessKeyBinding extends ValueBindingAdapter
+public class AccessKeyBinding extends ValueExpression implements Serializable
 {
   /**
    * Constructor purely for serialization.
    */
   public AccessKeyBinding()
   {
-    super(null);
   }
 
-  public AccessKeyBinding(ValueBinding base)
+  public AccessKeyBinding(ValueExpression expr)
   {
-    super(base);
+    _base = expr;
   }
 
+
   @Override
-  public Object getValue(FacesContext context)
+  public Object getValue(ELContext context)
   {
-    Object o = super.getValue(context);
+    Object o = _base.getValue(context);
     if (o == null)
       return null;
 
@@ -58,8 +61,51 @@
   }
 
   @Override
-  public Class<?> getType(FacesContext context)
+  public void setValue(ELContext context, Object value)
+  {
+    throw new PropertyNotWritableException();
+  }
+
+  @Override
+  public Class<?> getType(ELContext context)
+  {
+    return Character.class;
+  }
+
+  @Override
+  public Class<?> getExpectedType()
   {
     return Character.class;
   }
+
+  @Override
+  public boolean isReadOnly(ELContext context)
+  {
+    return true;
+  }
+
+
+  @Override
+  public boolean isLiteralText()
+  {
+    return false;
+  }
+
+  @Override
+  public String getExpressionString()
+  {
+    return null;
+  }
+
+  public int hashCode()
+  {
+    return 0;
+  }
+
+  public boolean equals(Object o)
+  {
+    return (o == this);
+  }
+
+  private ValueExpression _base;
 }

Modified: incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java?view=diff&rev=466185&r1=466184&r2=466185
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java
(original)
+++ incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java
Fri Oct 20 09:27:54 2006
@@ -15,8 +15,11 @@
  */
 package org.apache.myfaces.trinidadinternal.binding;
 
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
+import java.io.Serializable;
+
+import javax.el.ValueExpression;
+import javax.el.ELContext;
+import javax.el.PropertyNotWritableException;
 
 import org.apache.myfaces.trinidadinternal.util.nls.StringUtils;
 
@@ -27,25 +30,18 @@
  *
  * @author The Oracle ADF Faces Team
  */
-public class StripAccessKeyBinding extends ValueBindingAdapter
+public class StripAccessKeyBinding extends ValueExpression implements Serializable
 {
-  /**
-   * Constructor purely for serialization.
-   */
-  public StripAccessKeyBinding()
-  {
-    super(null);
-  }
 
-  public StripAccessKeyBinding(ValueBinding base)
+  public StripAccessKeyBinding(ValueExpression base)
   {
-    super(base);
+    _base = base;
   }
 
   @Override
-  public Object getValue(FacesContext context)
+  public Object getValue(ELContext context)
   {
-    Object o = super.getValue(context);
+    Object o = _base.getValue(context);
     if (o == null)
       return null;
 
@@ -58,8 +54,50 @@
   }
 
   @Override
-  public Class<?> getType(FacesContext context)
+  public void setValue(ELContext context, Object value)
+  {
+    throw new PropertyNotWritableException();
+  }
+
+  @Override
+  public Class<?> getType(ELContext context)
+  {
+    return Character.class;
+  }
+
+  @Override
+  public Class<?> getExpectedType()
+  {
+    return Character.class;
+  }
+
+  @Override
+  public boolean isReadOnly(ELContext context)
   {
-    return String.class;
+    return true;
   }
+
+  @Override
+  public boolean isLiteralText()
+  {
+    return false;
+  }
+
+  @Override
+  public String getExpressionString()
+  {
+    return null;
+  }
+
+  public int hashCode()
+  {
+    return 0;
+  }
+
+  public boolean equals(Object o)
+  {
+    return (o == this);
+  }
+
+  private ValueExpression _base;
 }

Modified: incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java?view=diff&rev=466185&r1=466184&r2=466185
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java
(original)
+++ incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java
Fri Oct 20 09:27:54 2006
@@ -124,6 +124,15 @@
     getResponseWriter().writeComment(comment);
   }
 
+
+
+  @Override
+  public void writeText(Object text, UIComponent component, 
+                        String propertyName)
+    throws IOException
+  {
+    getResponseWriter().writeText(text, component, propertyName);
+  }
   
   @Override
   public void writeText(Object text, String componentPropertyName) throws IOException

Modified: incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java?view=diff&rev=466185&r1=466184&r2=466185
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java
(original)
+++ incubator/adffaces/branches/faces-1_2-second/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java
Fri Oct 20 09:27:54 2006
@@ -31,8 +31,6 @@
 import java.util.Set;
 
 import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-
 import javax.faces.webapp.UIComponentTag;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
@@ -48,7 +46,7 @@
   MenuUtils() {}
 
   //=======================================================================
-  // Bound Value/EL Binding utilities
+  // Bound Value/EL Expression utilities
   //=======================================================================
   
   /**
@@ -62,12 +60,10 @@
     
     try
     {
-      // Value of rendered is EL method binding, so we 
-      // need to evaluate it
-      FacesContext ctx     = FacesContext.getCurrentInstance();
-      ValueBinding binding = 
-                        ctx.getApplication().createValueBinding(elExpression);
-      retVal               = binding.getValue(ctx);
+      FacesContext ctx = FacesContext.getCurrentInstance();
+      return ctx.getApplication().evaluateExpressionGet(ctx,
+                                                        elExpression,
+                                                        null);
     }
     catch (Exception ex)
     {
@@ -75,7 +71,6 @@
                   " is invalid or returned a bad value.\n", ex);
       return null;
     }
-    return retVal;
   }
   
   /**



Mime
View raw message