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

Gavin King gavin.king at jboss.com
Thu Oct 12 02:58:37 EDT 2006


  User: gavin   
  Date: 06/10/12 02:58:37

  Modified:    src/main/org/jboss/seam/jsf  SeamApplication12.java
  Log:
  more JSF 1.2 methods
  
  Revision  Changes    Path
  1.2       +80 -2     jboss-seam/src/main/org/jboss/seam/jsf/SeamApplication12.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamApplication12.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/jsf/SeamApplication12.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- SeamApplication12.java	12 Oct 2006 01:37:28 -0000	1.1
  +++ SeamApplication12.java	12 Oct 2006 06:58:37 -0000	1.2
  @@ -1,11 +1,16 @@
   package org.jboss.seam.jsf;
   
   import java.lang.reflect.Method;
  +import java.util.ResourceBundle;
   
  +import javax.el.ELContextListener;
   import javax.el.ELException;
   import javax.el.ELResolver;
   import javax.el.ExpressionFactory;
  +import javax.el.ValueExpression;
  +import javax.faces.FacesException;
   import javax.faces.application.Application;
  +import javax.faces.component.UIComponent;
   import javax.faces.context.FacesContext;
   
   public class SeamApplication12 extends SeamApplication11
  @@ -15,6 +20,11 @@
      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;
     
      public SeamApplication12(Application application)
      {
  @@ -25,6 +35,11 @@
            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)
         {
  @@ -56,7 +71,8 @@
         }
      }
      
  -   public ExpressionFactory getExpressionFactory() {
  +   public ExpressionFactory getExpressionFactory() 
  +   {
         try
         {
            return (ExpressionFactory) getExpressionFactoryMethod.invoke(application);
  @@ -68,7 +84,8 @@
      }
      
      public Object evaluateExpressionGet(FacesContext context, String expression, 
  -          Class expectedType) throws ELException {
  +          Class expectedType) throws ELException 
  +          {
         try
         {
            return evaluateExpressionMethod.invoke(application, context, expression, expectedType);
  @@ -79,4 +96,65 @@
         }
      }
   
  +   public ResourceBundle getResourceBundle(FacesContext ctx, String name) 
  +   {
  +      try
  +      {
  +         return (ResourceBundle) getResourceBundleMethod.invoke(application, ctx, name);
  +      }
  +      catch (Exception e)
  +      {
  +         throw new RuntimeException(e);
  +      }
  +   }
  +   
  +   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);
  +      }
  +   }
  +   
  +   public void addELContextListener(ELContextListener listener)
  +   {
  +      try
  +      {
  +         addELContextListenerMethod.invoke(application, listener);
  +      }
  +      catch (Exception e)
  +      {
  +         throw new RuntimeException(e);
  +      }
  +   }
  +   
  +   public void removeELContextListener(ELContextListener listener)
  +   {
  +      try
  +      {
  +         removeELContextListenerMethod.invoke(application, listener);
  +      }
  +      catch (Exception e)
  +      {
  +         throw new RuntimeException(e);
  +      }
  +   }
  +   
  +   public ELContextListener[] getELContextListeners()
  +   {
  +      try
  +      {
  +         return (ELContextListener[]) getELContextListenersMethod.invoke(application);
  +      }
  +      catch (Exception e)
  +      {
  +         throw new RuntimeException(e);
  +      }
  +   }
  +
   }
  
  
  



More information about the jboss-cvs-commits mailing list