Seam SVN: r7486 - in branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui: util/cdk and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-02-26 13:20:14 -0500 (Tue, 26 Feb 2008)
New Revision: 7486
Modified:
branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java
branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java
branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java
Log:
Backport r7485, JBSEAM-2665, thanks to Keith Naas!
Modified: branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java
===================================================================
--- branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java 2008-02-26 18:12:58 UTC (rev 7485)
+++ branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java 2008-02-26 18:20:14 UTC (rev 7486)
@@ -9,7 +9,6 @@
import java.io.IOException;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
import javax.faces.component.UIParameter;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
@@ -35,7 +34,7 @@
{
UIComponent actionComponent = component.getParent();
String actionComponentId = actionComponent.getClientId(context);
- UIForm form = getUtils().getForm(actionComponent);
+ UIComponent form = getUtils().getForm(actionComponent);
UIParameter parameter = (UIParameter) component;
if (getUtils().isCommandButton(actionComponent))
{
Modified: branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java
===================================================================
--- branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java 2008-02-26 18:12:58 UTC (rev 7485)
+++ branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java 2008-02-26 18:20:14 UTC (rev 7486)
@@ -9,7 +9,6 @@
import java.io.IOException;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
import javax.faces.component.UIOutput;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
@@ -37,7 +36,7 @@
{
UIComponent actionComponent = component.getParent();
String actionComponentId = actionComponent.getClientId(context);
- UIForm form = getUtils().getForm(actionComponent);
+ UIComponent form = getUtils().getForm(actionComponent);
if (form == null)
{
log.warn("Must embed default action inside a form");
Modified: branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java
===================================================================
--- branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java 2008-02-26 18:12:58 UTC (rev 7485)
+++ branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java 2008-02-26 18:20:14 UTC (rev 7486)
@@ -34,8 +34,12 @@
private static final String TRINIDAD_FORM_FAMILY = "org.apache.myfaces.trinidad.Form";
private static final String TRINIDAD_COMMANDBUTTON_CLASS = "org.apache.myfaces.trinidad.component.core.nav.CoreCommandButton";
private static final String RICHFACES_COMMANDBUTTON_CLASS = "org.ajax4jsf.component.UIAjaxCommandButton";
-
- public UIForm getForm(UIComponent component)
+
+ /**
+ * Since Trinidad, and possibly other JSF implementations don't always subclass
+ * from {@link javax.faces.component.UIForm} we can't cast to UIForm.
+ */
+ public UIComponent getForm(UIComponent component)
{
while (component != null)
{
@@ -45,7 +49,7 @@
}
component = component.getParent();
}
- return (UIForm) component;
+ return component;
}
public boolean isCommandButton(UIComponent cmp)
16 years, 9 months
Seam SVN: r7485 - in trunk/ui/src/main/java/org/jboss/seam/ui: util/cdk and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-02-26 13:12:58 -0500 (Tue, 26 Feb 2008)
New Revision: 7485
Modified:
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java
trunk/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java
Log:
JBSEAM-2665 - thanks to Keith Naas!
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java 2008-02-26 18:02:30 UTC (rev 7484)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java 2008-02-26 18:12:58 UTC (rev 7485)
@@ -9,7 +9,6 @@
import java.io.IOException;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
import javax.faces.component.UIParameter;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
@@ -35,7 +34,7 @@
{
UIComponent actionComponent = component.getParent();
String actionComponentId = actionComponent.getClientId(context);
- UIForm form = getUtils().getForm(actionComponent);
+ UIComponent form = getUtils().getForm(actionComponent);
UIParameter parameter = (UIParameter) component;
if (getUtils().isCommandButton(actionComponent))
{
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java 2008-02-26 18:02:30 UTC (rev 7484)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java 2008-02-26 18:12:58 UTC (rev 7485)
@@ -9,7 +9,6 @@
import java.io.IOException;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
import javax.faces.component.UIOutput;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
@@ -37,7 +36,7 @@
{
UIComponent actionComponent = component.getParent();
String actionComponentId = actionComponent.getClientId(context);
- UIForm form = getUtils().getForm(actionComponent);
+ UIComponent form = getUtils().getForm(actionComponent);
if (form == null)
{
log.warn("Must embed default action inside a form");
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java 2008-02-26 18:02:30 UTC (rev 7484)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java 2008-02-26 18:12:58 UTC (rev 7485)
@@ -34,8 +34,12 @@
private static final String TRINIDAD_FORM_FAMILY = "org.apache.myfaces.trinidad.Form";
private static final String TRINIDAD_COMMANDBUTTON_CLASS = "org.apache.myfaces.trinidad.component.core.nav.CoreCommandButton";
private static final String RICHFACES_COMMANDBUTTON_CLASS = "org.ajax4jsf.component.UIAjaxCommandButton";
-
- public UIForm getForm(UIComponent component)
+
+ /**
+ * Since Trinidad, and possibly other JSF implementations don't always subclass
+ * from {@link javax.faces.component.UIForm} we can't cast to UIForm.
+ */
+ public UIComponent getForm(UIComponent component)
{
while (component != null)
{
@@ -45,7 +49,7 @@
}
component = component.getParent();
}
- return (UIForm) component;
+ return component;
}
public boolean isCommandButton(UIComponent cmp)
16 years, 9 months
Seam SVN: r7484 - branches/Seam_2_0.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-02-26 13:02:30 -0500 (Tue, 26 Feb 2008)
New Revision: 7484
Modified:
branches/Seam_2_0/build.xml
Log:
better clean target
Modified: branches/Seam_2_0/build.xml
===================================================================
--- branches/Seam_2_0/build.xml 2008-02-26 18:02:12 UTC (rev 7483)
+++ branches/Seam_2_0/build.xml 2008-02-26 18:02:30 UTC (rev 7484)
@@ -147,6 +147,7 @@
<delete dir="${coverage.dir}" quiet="${quietclean}" />
<delete dir="${ui.dir}/target" quiet="${quietclean}"/>
<delete dir="${doc.ref.dir}/target" quiet="${quietclean}" />
+ <delete dir="${doc.ref.dir}/tmp" quiet="${quietclean}" />
<cleanexample name="integration" path="${seam.dir}/src/test/integration" message="" />
</target>
16 years, 9 months
Seam SVN: r7482 - branches/Seam_2_0/build.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-02-26 12:53:44 -0500 (Tue, 26 Feb 2008)
New Revision: 7482
Modified:
branches/Seam_2_0/build/ci.build.xml
Log:
minor
Modified: branches/Seam_2_0/build/ci.build.xml
===================================================================
--- branches/Seam_2_0/build/ci.build.xml 2008-02-26 17:48:47 UTC (rev 7481)
+++ branches/Seam_2_0/build/ci.build.xml 2008-02-26 17:53:44 UTC (rev 7482)
@@ -9,7 +9,7 @@
<property name="seam.dir" value="${basedir}/../" />
<property name="dist.location" value="${seam.dir}/dist" />
- <property name="dist.ref.dir" value="${dist.location}/ref" />
+ <property name="doc.ref.dir" value="${seam.dir}/doc/Seam_Reference_Guide" />
<import file="common.build.xml" />
@@ -82,7 +82,7 @@
</target>
<target name="deployDocumentation" depends="initdav, initpoms">
- <deploy pom="${docs.pom}" jar="${dist.ref.dir}/en/pdf/seam_reference.pdf" unique="false" repositoryId="snapshots.jboss.org"/>
+ <deploy pom="${docs.pom}" jar="${doc.ref.dir}/target/docbook/pdf/Seam_Reference_Guide.pdf" unique="false" repositoryId="snapshots.jboss.org"/>
</target>
<macrodef name="build">
16 years, 9 months
Seam SVN: r7480 - in branches/Seam_2_0: doc/Seam_Reference_Guide and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-02-26 12:41:25 -0500 (Tue, 26 Feb 2008)
New Revision: 7480
Modified:
branches/Seam_2_0/build.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/pom.xml
Log:
Fix refdoc target to run new docs build
Modified: branches/Seam_2_0/build.xml
===================================================================
--- branches/Seam_2_0/build.xml 2008-02-26 16:40:04 UTC (rev 7479)
+++ branches/Seam_2_0/build.xml 2008-02-26 17:41:25 UTC (rev 7480)
@@ -46,7 +46,7 @@
<!-- Documentation -->
<property name="doc.dir" value="doc" />
<property name="doc.api.dir" value="${doc.dir}/api" />
- <property name="doc.ref.dir" value="${doc.dir}/reference" />
+ <property name="doc.ref.dir" value="${doc.dir}/Seam_Reference_Guide" />
<property name="javadoc.link" value="http://java.sun.com/j2se/5.0/docs/api" />
<!-- Distribution targets -->
@@ -146,6 +146,7 @@
<delete dir="${report.dir}" quiet="${quietclean}" />
<delete dir="${coverage.dir}" quiet="${quietclean}" />
<delete dir="${ui.dir}/target" quiet="${quietclean}"/>
+ <delete dir="${doc.ref.dir}/target" quiet="${quietclean}" />
<cleanexample name="integration" path="${seam.dir}/src/test/integration" message="" />
</target>
@@ -592,16 +593,12 @@
</target>
<target name="refdoc" description="Generate and copy reference documentation">
-
- <copy todir="${doc.ref.dir}/build">
- <fileset dir="${doc.ref.dir}" />
- </copy>
- <replace dir="${doc.ref.dir}/build" token="@version@" value="${complete.version}" />
- <ant dir="${doc.ref.dir}/build" inheritall="false" target="all.doc" />
+ <maven target="compile" basedir="${doc.ref.dir}">
+ <jvmarg line="-Xms128m -Xmx512m" />
+ </maven>
<copy todir="${dist.ref.dir}">
- <fileset dir="${doc.ref.dir}/build/build" />
+ <fileset dir="${doc.ref.dir}/target/docbook" />
</copy>
- <delete dir="${doc.ref.dir}/build" />
</target>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/pom.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/pom.xml 2008-02-26 16:40:04 UTC (rev 7479)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/pom.xml 2008-02-26 17:41:25 UTC (rev 7480)
@@ -4,9 +4,9 @@
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.jbossas</groupId>
+ <groupId>org.jboss.seam.reference-guide</groupId>
<artifactId>seam-reference-guide-${translation}</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>2.0.2-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>Seam Reference Guide (${translation})</name>
16 years, 9 months
Seam SVN: r7479 - trunk/build.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-02-26 11:40:04 -0500 (Tue, 26 Feb 2008)
New Revision: 7479
Modified:
trunk/build/ui.pom.xml
Log:
JBSEAM-2676
Modified: trunk/build/ui.pom.xml
===================================================================
--- trunk/build/ui.pom.xml 2008-02-26 14:37:51 UTC (rev 7478)
+++ trunk/build/ui.pom.xml 2008-02-26 16:40:04 UTC (rev 7479)
@@ -184,18 +184,6 @@
<scope>test</scope>
<classifier>jdk15</classifier>
</dependency>
-
- <!-- Dependencies for facelets jdk logging -> log4j bridge -->
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
16 years, 9 months
Seam SVN: r7478 - branches/Seam_1_2_1_AP/seam-gen/resources/WEB-INF.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-02-26 09:37:51 -0500 (Tue, 26 Feb 2008)
New Revision: 7478
Modified:
branches/Seam_1_2_1_AP/seam-gen/resources/WEB-INF/pages.xml
Log:
JBPAPP-638 - fix of the seam-gen pages template
Modified: branches/Seam_1_2_1_AP/seam-gen/resources/WEB-INF/pages.xml
===================================================================
--- branches/Seam_1_2_1_AP/seam-gen/resources/WEB-INF/pages.xml 2008-02-26 14:25:36 UTC (rev 7477)
+++ branches/Seam_1_2_1_AP/seam-gen/resources/WEB-INF/pages.xml 2008-02-26 14:37:51 UTC (rev 7478)
@@ -33,7 +33,7 @@
</exception>
<exception class="org.jboss.seam.security.AuthorizationException">
- <redirect>
+ <redirect view-id="/error.xhtml">
<message>You don't have permission to do this</message>
</redirect>
</exception>
16 years, 9 months
Seam SVN: r7477 - branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-02-26 09:25:36 -0500 (Tue, 26 Feb 2008)
New Revision: 7477
Removed:
branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/MethodExpressionHelper.java
branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/OptionalParameterMethodExpression.java
branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/ParamMethodExpression.java
branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/SeamExpressionFactory.java
Log:
JBPAPP-631 - moved classes from org.jboss.seam.ui.facelet to org.jboss.seam.jsf
Deleted: branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/MethodExpressionHelper.java
===================================================================
--- branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/MethodExpressionHelper.java 2008-02-26 06:58:34 UTC (rev 7476)
+++ branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/MethodExpressionHelper.java 2008-02-26 14:25:36 UTC (rev 7477)
@@ -1,247 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.seam.ui.facelet;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.MethodExpression;
-import javax.el.MethodInfo;
-import javax.el.ValueExpression;
-
-import org.jboss.seam.actionparam.MethodExpressionParser;
-
-/**
- * This is a helper class for the ParamMethodExpression.
- *
- * @author Stan Silvert
- */
-class MethodExpressionHelper implements Serializable
-{
-
- private String expWithParams;
- private boolean isStringLiteral = false;
-
- private MethodExpressionParser parser;
-
- // The wrapped expression
- private MethodExpression methodExp;
-
- // used for equals and hashCode
- private boolean expressionInitializedInCtor = false;
- private String hashString;
-
-
- MethodExpressionHelper(ELContext elContext,
- MethodExpressionParser parser)
- {
- this.expWithParams = parser.getUnparsedExpression();
- this.parser = parser;
-
- if ( MethodExpressionParser.isStringLiteral(expWithParams) )
- {
- setMethodExpression(elContext, new Class[0]);
- this.isStringLiteral = true;
- this.expressionInitializedInCtor = true;
- return;
- }
-
- // if there are no params, we can go ahead and create the expression
- if ( parser.getParams().length == 0 )
- {
- setMethodExpression(elContext, new Class[0]);
- this.expressionInitializedInCtor = true;
- }
- }
-
- boolean isLiteralText()
- {
- return this.isStringLiteral;
- }
-
- MethodInfo getMethodInfo(ELContext elContext)
- {
- if (this.methodExp == null)
- {
- return new PartialMethodInfo(parser.getMethodName());
- }
-
- return this.methodExp.getMethodInfo(elContext);
- }
-
- Object invokeTheExpression(ELContext elContext)
- {
- if (this.methodExp == null)
- {
- setMethodExpression(elContext, findParamTypes(elContext));
- }
-
- Object[] evaluatedParams = evaluateParams(elContext);
- return this.methodExp.invoke(elContext, evaluatedParams);
- }
-
- MethodExpression getExpression()
- {
- return this.methodExp;
- }
-
- // evaluate each param as a value expression and return the array of results
- private Object[] evaluateParams(ELContext elContext)
- {
- String[] params = parser.getParams();
-
- Object[] results = new Object[params.length];
-
- for (int i=0; i < results.length; i++)
- {
- String param = params[i].trim();
-
- if ( MethodExpressionParser.isQuotedString(param) )
- {
- // strip quotes
- results[i] = param.substring(1, param.length() - 1);
- continue;
- }
-
- ValueExpression ve = SeamExpressionFactory.getFaceletsExpressionFactory()
- .createValueExpression(elContext, "#{" + param + "}", Object.class);
- results[i] = ve.getValue(elContext);
- }
-
- return results;
- }
-
- // finds a public method that matches the method
- // name and number of params
- private Class[] findParamTypes(ELContext elContext)
- {
- if (parser.getParams().length == 0) return new Class[0];
-
- String expression = "#{" + parser.getBaseExpression() + "}";
- ValueExpression ve = SeamExpressionFactory.getFaceletsExpressionFactory().
- createValueExpression(elContext, expression, Object.class);
- Object obj = ve.getValue(elContext);
- Method[] publicMethods = obj.getClass().getMethods();
-
- Method methodMatch = null;
-
- for (int i=0; i < publicMethods.length; i++)
- {
- if (methodMatches(publicMethods[i]))
- {
- if (methodMatch != null)
- {
- throw new ELException("More than one method matched " +
- this.expWithParams + ". Method name or number of params must be unique.");
- }
-
- methodMatch = publicMethods[i];
- }
- }
-
- if (methodMatch == null)
- {
- throw new ELException("No method found for expression " +
- this.expWithParams +
- ". Method name and number of params must match.");
- }
-
- return methodMatch.getParameterTypes();
- }
-
- // To match, method must return a String, match method name, and match
- // number of params
- private boolean methodMatches(Method method)
- {
- return method.getName().equals(parser.getMethodName()) &&
- (method.getParameterTypes().length == parser.getParams().length);
- }
-
- private void setMethodExpression(ELContext elContext, Class[] paramTypes)
- {
- // note: returnType is always a String because this is an action method
- this.methodExp = SeamExpressionFactory.getFaceletsExpressionFactory().
- createMethodExpression(elContext,
- parser.getCombinedExpression(),
- String.class,
- paramTypes);
- }
-
- private String getHashString()
- {
- if (this.hashString == null)
- {
- this.hashString = parser.getBaseExpression() + "." +
- parser.getMethodName() + "." +
- parser.getParams().length;
- }
-
- return this.hashString;
- }
-
- @Override
- public boolean equals(Object object)
- {
- if (this == object) return true;
-
- if (this.expressionInitializedInCtor)
- {
- return this.methodExp.equals(object);
- }
-
- if (!(object instanceof MethodExpressionHelper)) return false;
- MethodExpressionHelper exp = (MethodExpressionHelper)object;
-
- return getHashString().equals(exp.getHashString());
- }
-
- @Override
- public int hashCode() {
- if (this.expressionInitializedInCtor)
- {
- return this.methodExp.hashCode();
- }
-
- return getHashString().hashCode();
- }
-
- /**
- * Limited MethodInfo implementation that can be used when the param types are
- * not yet known.
- */
- private static class PartialMethodInfo extends MethodInfo
- {
- private PartialMethodInfo(String methodName)
- {
- super(methodName, Object.class, new Class[0]);
- }
-
- @Override
- public Class<?>[] getParamTypes()
- {
- throw new IllegalStateException("paramTypes unknown until MethodExpression is invoked.");
- }
- }
-}
\ No newline at end of file
Deleted: branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/OptionalParameterMethodExpression.java
===================================================================
--- branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/OptionalParameterMethodExpression.java 2008-02-26 06:58:34 UTC (rev 7476)
+++ branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/OptionalParameterMethodExpression.java 2008-02-26 14:25:36 UTC (rev 7477)
@@ -1,75 +0,0 @@
-/**
- *
- */
-package org.jboss.seam.ui.facelet;
-
-import javax.el.ELContext;
-import javax.el.MethodExpression;
-import javax.el.MethodInfo;
-import javax.el.MethodNotFoundException;
-
-public class OptionalParameterMethodExpression extends MethodExpression
- {
-
- private MethodExpression withParam;
- private MethodExpression withNoParam;
-
- public OptionalParameterMethodExpression(MethodExpression withParam, MethodExpression withNoParam)
- {
- this.withParam = withParam;
- this.withNoParam = withNoParam;
- }
-
- @Override
- public MethodInfo getMethodInfo(ELContext ctx)
- {
- return withParam.getMethodInfo(ctx);
- }
-
- @Override
- public Object invoke(ELContext ctx, Object[] args)
- {
- try
- {
- return withParam.invoke(ctx, args);
- }
- catch (MethodNotFoundException mnfe)
- {
- try
- {
- return withNoParam.invoke(ctx, new Object[0]);
- }
- catch (MethodNotFoundException mnfe2)
- {
- throw mnfe;
- }
- }
- }
-
- @Override
- public String getExpressionString()
- {
- return withParam.getExpressionString();
- }
-
- @Override
- public boolean isLiteralText()
- {
- return withParam.isLiteralText();
- }
-
- @Override
- public boolean equals(Object object)
- {
- if ( !(object instanceof OptionalParameterMethodExpression) ) return false;
- OptionalParameterMethodExpression other = (OptionalParameterMethodExpression) object;
- return withParam.equals(other.withParam);
- }
-
- @Override
- public int hashCode()
- {
- return withParam.hashCode();
- }
-
- }
\ No newline at end of file
Deleted: branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/ParamMethodExpression.java
===================================================================
--- branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/ParamMethodExpression.java 2008-02-26 06:58:34 UTC (rev 7476)
+++ branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/ParamMethodExpression.java 2008-02-26 14:25:36 UTC (rev 7477)
@@ -1,92 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.seam.ui.facelet;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.MethodExpression;
-import javax.el.MethodInfo;
-import javax.el.MethodNotFoundException;
-import javax.el.PropertyNotFoundException;
-
-import org.jboss.seam.actionparam.MethodExpressionParser;
-
-/**
- * TODO: make this into a StateHolder?
- *
- * @author Stan Silvert
- */
-public class ParamMethodExpression extends MethodExpression
-{
-
- private MethodExpressionHelper helper;
- private String expString;
-
- public ParamMethodExpression(MethodExpressionParser parser,
- ELContext elContext)
- {
- this.expString = parser.getUnparsedExpression();
- this.helper = new MethodExpressionHelper(elContext, parser);
- }
-
- @Override
- public MethodInfo getMethodInfo(ELContext elContext) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException
- {
- return this.helper.getMethodInfo(elContext);
- }
-
- @Override
- public Object invoke(ELContext elContext, Object[] params) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException
- {
- // note that the params are ignored - they were cached by the helper
- return this.helper.invokeTheExpression(elContext);
- }
-
- @Override
- public boolean isLiteralText()
- {
- return this.helper.isLiteralText();
- }
-
- @Override
- public String getExpressionString()
- {
- return this.expString;
- }
-
- @Override
- public boolean equals(Object object)
- {
- if (this == object) return true;
- if (!(object instanceof ParamMethodExpression)) return false;
- ParamMethodExpression actionExpression = (ParamMethodExpression)object;
-
- return this.helper.equals(actionExpression.helper);
- }
-
- @Override
- public int hashCode()
- {
- return this.helper.hashCode();
- }
-}
Deleted: branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/SeamExpressionFactory.java
===================================================================
--- branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/SeamExpressionFactory.java 2008-02-26 06:58:34 UTC (rev 7476)
+++ branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/SeamExpressionFactory.java 2008-02-26 14:25:36 UTC (rev 7477)
@@ -1,110 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.seam.ui.facelet;
-
-import javax.el.ELContext;
-import javax.el.ExpressionFactory;
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-import javax.faces.event.FacesEvent;
-
-import org.jboss.seam.actionparam.MethodExpressionParser;
-
-import com.sun.facelets.compiler.SAXCompiler;
-
-/**
- * This ExpressionFactory replaces the one normally used in Facelets. It
- * recognizes if an EL expression is using params. If so, it will return a
- * special implementation of MethodExpression or ValueExpression to handle it.
- *
- * @author Stan Silvert
- */
-public class SeamExpressionFactory extends ExpressionFactory
-{
- private static ExpressionFactory faceletsExpressionFactory;
-
- static
- {
- // wrap the ExpressionFactory that Facelets would have created
- SAXCompiler compiler = new SAXCompiler();
- faceletsExpressionFactory = compiler.createExpressionFactory();
- }
-
- public SeamExpressionFactory() {}
-
- /**
- * Note default access. Other classes in this package use this factory
- * to create EL Expressions.
- */
- static ExpressionFactory getFaceletsExpressionFactory()
- {
- return faceletsExpressionFactory;
- }
-
- @Override
- public Object coerceToType(Object obj, Class targetType)
- {
- return faceletsExpressionFactory.coerceToType(obj, targetType);
- }
-
- @Override
- public MethodExpression createMethodExpression(ELContext elContext,
- String expression,
- Class returnType,
- Class[] paramTypes)
- {
- MethodExpressionParser parser = new MethodExpressionParser(expression);
- if ( parser.isParamExpression() )
- {
- return new ParamMethodExpression(parser, elContext);
- }
- else if ( paramTypes.length==1 && FacesEvent.class.isAssignableFrom( paramTypes[0] ) )
- {
- //so that JSF action listeners don't have to declare
- //the totally frickin useless ActionEvent parameter
- return new OptionalParameterMethodExpression(
- faceletsExpressionFactory.createMethodExpression(elContext, expression, returnType, paramTypes),
- faceletsExpressionFactory.createMethodExpression(elContext, expression, returnType, new Class[0])
- );
- }
- else
- {
- return faceletsExpressionFactory.createMethodExpression(elContext, expression, returnType, paramTypes);
- }
- }
-
- @Override
- public ValueExpression createValueExpression(Object instance, Class expectedType)
- {
- return faceletsExpressionFactory.createValueExpression(instance, expectedType);
- }
-
- @Override
- public ValueExpression createValueExpression(ELContext elContext,
- String expression,
- Class expectedType)
- {
- return faceletsExpressionFactory.createValueExpression(elContext, expression, expectedType);
- }
-
-}
\ No newline at end of file
16 years, 9 months