[jboss-cvs] jboss-seam/src/main/org/jboss/seam/jsf ...

Gavin King gavin.king at jboss.com
Wed May 16 11:48:11 EDT 2007


  User: gavin   
  Date: 07/05/16 11:48:11

  Modified:    src/main/org/jboss/seam/jsf   SeamViewHandler.java
                        SeamApplication.java
  Log:
  more 1.2 updates
  
  Revision  Changes    Path
  1.3       +30 -9     jboss-seam/src/main/org/jboss/seam/jsf/SeamViewHandler.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamViewHandler.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/jsf/SeamViewHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- SeamViewHandler.java	4 Apr 2006 19:50:59 -0000	1.2
  +++ SeamViewHandler.java	16 May 2007 15:48:11 -0000	1.3
  @@ -11,7 +11,8 @@
   import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.core.LocaleSelector;
   
  -public class SeamViewHandler extends ViewHandler {
  +public class SeamViewHandler extends ViewHandler 
  +{
      
      private ViewHandler viewHandler;
      
  @@ -21,7 +22,20 @@
      }
   
      @Override
  -   public Locale calculateLocale(FacesContext facesContext) {
  +   public String calculateCharacterEncoding(FacesContext context)
  +   {
  +      return viewHandler.calculateCharacterEncoding(context);
  +   }
  +
  +   @Override
  +   public void initView(FacesContext context) throws FacesException
  +   {
  +      viewHandler.initView(context);
  +   }
  +   
  +   @Override
  +   public Locale calculateLocale(FacesContext facesContext) 
  +   {
         Locale jsfLocale = viewHandler.calculateLocale(facesContext);
         if ( !Contexts.isSessionContextActive() )
         {
  @@ -34,38 +48,45 @@
      }
   
      @Override
  -   public String calculateRenderKitId(FacesContext ctx) {
  +   public String calculateRenderKitId(FacesContext ctx) 
  +   {
         return viewHandler.calculateRenderKitId(ctx);
      }
   
      @Override
  -   public UIViewRoot createView(FacesContext ctx, String viewId) {
  +   public UIViewRoot createView(FacesContext ctx, String viewId) 
  +   {
         return viewHandler.createView(ctx, viewId);
      }
   
      @Override
  -   public String getActionURL(FacesContext ctx, String viewId) {
  +   public String getActionURL(FacesContext ctx, String viewId) 
  +   {
         return viewHandler.getActionURL(ctx, viewId);
      }
   
      @Override
  -   public String getResourceURL(FacesContext ctx, String path) {
  +   public String getResourceURL(FacesContext ctx, String path) 
  +   {
         return viewHandler.getResourceURL(ctx, path);
      }
   
      @Override
      public void renderView(FacesContext ctx, UIViewRoot viewRoot)
  -         throws IOException, FacesException {
  +         throws IOException, FacesException 
  +   {
         viewHandler.renderView(ctx, viewRoot);
      }
   
      @Override
  -   public UIViewRoot restoreView(FacesContext ctx, String viewId) {
  +   public UIViewRoot restoreView(FacesContext ctx, String viewId) 
  +   {
         return viewHandler.restoreView(ctx, viewId);
      }
   
      @Override
  -   public void writeState(FacesContext ctx) throws IOException {
  +   public void writeState(FacesContext ctx) throws IOException 
  +   {
         viewHandler.writeState(ctx);
      }
   
  
  
  
  1.10      +60 -149   jboss-seam/src/main/org/jboss/seam/jsf/SeamApplication.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamApplication.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/jsf/SeamApplication.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- SeamApplication.java	15 May 2007 20:02:45 -0000	1.9
  +++ SeamApplication.java	16 May 2007 15:48:11 -0000	1.10
  @@ -1,6 +1,5 @@
   package org.jboss.seam.jsf;
   
  -import java.lang.reflect.Method;
   import java.util.Collection;
   import java.util.Iterator;
   import java.util.Locale;
  @@ -35,164 +34,22 @@
   public class SeamApplication extends Application
   {  
      
  -   private final Method getELResolverMethod;
  -   private final Method addELResolverMethod;
  -   private final Method getExpressionFactoryMethod;
  -   private final Method evaluateExpressionMethod;
  -   private final Method getResourceBundleMethod;
  -   private final Method createComponentMethod;
  -   private final Method getELContextListenersMethod;
  -   private final Method addELContextListenerMethod;
  -   private final Method removeELContextListenerMethod;
  +   protected Application application;
     
      public SeamApplication(Application application)
      {
         this.application = application;
  -         
  -      try
  -      {
  -         getELResolverMethod = application.getClass().getMethod("getELResolver");
  -         addELResolverMethod = application.getClass().getMethod("addELResolver", ELResolver.class);
  -         getExpressionFactoryMethod = application.getClass().getMethod("getExpressionFactory");
  -         evaluateExpressionMethod = application.getClass().getMethod("evaluateExpressionGet", FacesContext.class, String.class, Class.class);
  -         getResourceBundleMethod = application.getClass().getMethod("getResourceBundle", FacesContext.class, String.class);
  -         createComponentMethod = application.getClass().getMethod("createComponent", ValueExpression.class, FacesContext.class, String.class);
  -         getELContextListenersMethod = application.getClass().getMethod("getELContextListeners");
  -         addELContextListenerMethod = application.getClass().getMethod("addELContextListener", ELContextListener.class);
  -         removeELContextListenerMethod = application.getClass().getMethod("removeELContextListener", ELContextListener.class);
  -      }
  -      catch (Exception e)
  -      {
  -         throw new RuntimeException(e);
  -      }
  -   }
  -   
  -
  -   @Override
  -   public ELResolver getELResolver() 
  -   {
  -      try
  -      {
  -         return (ELResolver) getELResolverMethod.invoke(application);
  -      }
  -      catch (Exception e)
  -      {
  -         throw new RuntimeException(e);
  -      }
      }
      
  -   @Override
  -   public void addELResolver(ELResolver resolver) 
  -   {
  -      try
  -      {
  -         addELResolverMethod.invoke(application, resolver);
  -      }
  -      catch (Exception e)
  -      {
  -         throw new RuntimeException(e);
  -      }
  -   }
  -   
  -   @Override
  -   public ExpressionFactory getExpressionFactory() 
  -   {
  -      try
  -      {
  -         return (ExpressionFactory) getExpressionFactoryMethod.invoke(application);
  -      }
  -      catch (Exception e)
  -      {
  -         throw new RuntimeException(e);
  -      }
  -   }
  -   
  -   @Override
  -   public Object evaluateExpressionGet(FacesContext context, String expression, 
  -          Class expectedType) throws ELException 
  -   {
  -      try
  -      {
  -         return evaluateExpressionMethod.invoke(application, context, expression, expectedType);
  -      }
  -      catch (Exception e)
  -      {
  -         throw new RuntimeException(e);
  -      }
  -   }
  -   
  -   @Override
  -   public ResourceBundle getResourceBundle(FacesContext ctx, String name) 
  -   {
  -      try
  -      {
  -         return (ResourceBundle) getResourceBundleMethod.invoke(application, ctx, name);
  -      }
  -      catch (Exception e)
  -      {
  -         throw new RuntimeException(e);
  -      }
  -   }
  -   
  -   @Override
  -   public UIComponent createComponent(ValueExpression componentExpression,
  -         FacesContext context, String componentType) throws FacesException
  -   {
  -      try
  -      {
  -         return (UIComponent) createComponentMethod.invoke(application, componentExpression, context, componentType);
  -      }
  -      catch (Exception e)
  -      {
  -         throw new RuntimeException(e);
  -      }
  -   }
  -   
  -   @Override
  -   public void addELContextListener(ELContextListener listener)
  -   {
  -      try
  -      {
  -         addELContextListenerMethod.invoke(application, listener);
  -      }
  -      catch (Exception e)
  -      {
  -         throw new RuntimeException(e);
  -      }
  -   }
  -   
  -   @Override
  -   public void removeELContextListener(ELContextListener listener)
  -   {
  -      try
  -      {
  -         removeELContextListenerMethod.invoke(application, listener);
  -      }
  -      catch (Exception e)
  +   public Application getDelegate()
         {
  -         throw new RuntimeException(e);
  -      }
  +      return application;
      }
      
      @Override
  -   public ELContextListener[] getELContextListeners()
  -   {
  -      try
  -      {
  -         return (ELContextListener[]) getELContextListenersMethod.invoke(application);
  -      }
  -      catch (Exception e)
  -      {
  -         throw new RuntimeException(e);
  -      }
  -   }
  -
  -
  -   protected Application application;
  -   
  -   public Application getDelegate()
  +   public ELResolver getELResolver() 
      {
  -      return application;
  +      return application.getELResolver();
      }
      
      @Override
  @@ -443,4 +300,58 @@
         application.setViewHandler(handler);
      }
      
  +   @Override
  +   public void addELContextListener(ELContextListener arg0)
  +   {
  +      application.addELContextListener(arg0);
  +   }
  +
  +   @Override
  +   public void addELResolver(ELResolver arg0)
  +   {
  +      application.addELResolver(arg0);
  +   }
  +
  +   @Override
  +   public UIComponent createComponent(ValueExpression arg0, FacesContext arg1, String arg2) throws FacesException
  +   {
  +      return application.createComponent(arg0, arg1, arg2);
  +   }
  +
  +   @Override
  +   public Object evaluateExpressionGet(FacesContext arg0, String arg1, Class arg2) throws ELException
  +   {
  +      return application.evaluateExpressionGet(arg0, arg1, arg2);
  +   }
  +
  +   @Override
  +   public ELContextListener[] getELContextListeners()
  +   {
  +      return application.getELContextListeners();
  +   }
  +
  +   @Override
  +   public ExpressionFactory getExpressionFactory()
  +   {
  +      return application.getExpressionFactory();
  +   }
  +
  +   @Override
  +   public ResourceBundle getResourceBundle(FacesContext arg0, String arg1)
  +   {
  +      return application.getResourceBundle(arg0, arg1);
  +   }
  +
  +   @Override
  +   public void removeELContextListener(ELContextListener arg0)
  +   {
  +      application.removeELContextListener(arg0);
  +   }
  +
  +   @Override
  +   public String toString()
  +   {
  +      return application.toString();
  +   }
  +   
   }
  
  
  



More information about the jboss-cvs-commits mailing list