From adffaces-commits-return-44-apmail-incubator-adffaces-commits-archive=incubator.apache.org@incubator.apache.org Wed Jun 07 19:18:08 2006 Return-Path: Delivered-To: apmail-incubator-adffaces-commits-archive@locus.apache.org Received: (qmail 92663 invoked from network); 7 Jun 2006 19:18:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jun 2006 19:18:07 -0000 Received: (qmail 12918 invoked by uid 500); 7 Jun 2006 19:17:58 -0000 Delivered-To: apmail-incubator-adffaces-commits-archive@incubator.apache.org Received: (qmail 12872 invoked by uid 500); 7 Jun 2006 19:17:58 -0000 Mailing-List: contact adffaces-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-dev@incubator.apache.org Delivered-To: mailing list adffaces-commits@incubator.apache.org Received: (qmail 12817 invoked by uid 99); 7 Jun 2006 19:17:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 12:17:58 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 12:17:56 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id BDC181A983A; Wed, 7 Jun 2006 12:17:36 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r412491 - in /incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main: conf/META-INF/ java/org/apache/myfaces/adfinternal/facelets/ Date: Wed, 07 Jun 2006 19:17:35 -0000 To: adffaces-commits@incubator.apache.org From: matzew@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060607191736.BDC181A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: matzew Date: Wed Jun 7 12:17:35 2006 New Revision: 412491 URL: http://svn.apache.org/viewvc?rev=412491&view=rev Log: added taghandlers for facelets support Added: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ResetActionListenerTag.java incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ReturnActionListenerTag.java Modified: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/conf/META-INF/af-base.taglib.xml incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/AdfListenersTagRule.java incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/SetActionListenerTag.java Modified: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/conf/META-INF/af-base.taglib.xml URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/conf/META-INF/af-base.taglib.xml?rev=412491&r1=412490&r2=412491&view=diff ============================================================================== --- incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/conf/META-INF/af-base.taglib.xml (original) +++ incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/conf/META-INF/af-base.taglib.xml Wed Jun 7 12:17:35 2006 @@ -24,4 +24,12 @@ setActionListener org.apache.myfaces.adfinternal.facelets.SetActionListenerTag + + resetActionListener + org.apache.myfaces.adfinternal.facelets.ResetActionListenerTag + + + returnActionListener + org.apache.myfaces.adfinternal.facelets.ReturnActionListenerTag + Modified: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/AdfListenersTagRule.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/AdfListenersTagRule.java?rev=412491&r1=412490&r2=412491&view=diff ============================================================================== --- incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/AdfListenersTagRule.java (original) +++ incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/AdfListenersTagRule.java Wed Jun 7 12:17:35 2006 @@ -15,24 +15,20 @@ */ package org.apache.myfaces.adfinternal.facelets; -import java.beans.PropertyDescriptor; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import java.util.ArrayList; -import java.util.StringTokenizer; - -import javax.el.MethodExpression; -import javax.faces.el.MethodBinding; - -import com.sun.facelets.FaceletContext; -import com.sun.facelets.el.LegacyMethodBinding; -import com.sun.facelets.tag.Metadata; -import com.sun.facelets.tag.MetadataTarget; -import com.sun.facelets.tag.MetaRule; -import com.sun.facelets.tag.TagAttribute; -import com.sun.facelets.tag.TagAttributeException; +import java.beans.PropertyDescriptor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import javax.el.MethodExpression; +import javax.faces.el.MethodBinding; + +import com.sun.facelets.FaceletContext; +import com.sun.facelets.el.LegacyMethodBinding; +import com.sun.facelets.tag.MetaRule; +import com.sun.facelets.tag.Metadata; +import com.sun.facelets.tag.MetadataTarget; +import com.sun.facelets.tag.TagAttribute; +import com.sun.facelets.tag.TagAttributeException; /** * Added: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ResetActionListenerTag.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ResetActionListenerTag.java?rev=412491&view=auto ============================================================================== --- incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ResetActionListenerTag.java (added) +++ incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ResetActionListenerTag.java Wed Jun 7 12:17:35 2006 @@ -0,0 +1,54 @@ +/* +* Copyright 2006 The Apache Software Foundation. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package org.apache.myfaces.adfinternal.facelets; + +import java.io.IOException; + +import javax.el.ELException; +import javax.faces.FacesException; +import javax.faces.component.ActionSource; +import javax.faces.component.UIComponent; + +import org.apache.myfaces.adfinternal.taglib.listener.ResetActionListener; + +import com.sun.facelets.FaceletContext; +import com.sun.facelets.FaceletException; +import com.sun.facelets.tag.TagConfig; +import com.sun.facelets.tag.TagHandler; +import com.sun.facelets.tag.jsf.ComponentSupport; + +/** + * @author Matthias Wessendorf + * + */ +public class ResetActionListenerTag extends TagHandler { + + public ResetActionListenerTag(TagConfig tagConfig) { + super(tagConfig); + } + + public void apply(FaceletContext faceletContext, UIComponent parent) + throws IOException, FacesException, FaceletException, ELException { + + if(ComponentSupport.isNew(parent)) + { + ActionSource actionSource = (ActionSource)parent; + ResetActionListener listener = new ResetActionListener(); + + actionSource.addActionListener(listener); + } + } +} \ No newline at end of file Added: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ReturnActionListenerTag.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ReturnActionListenerTag.java?rev=412491&view=auto ============================================================================== --- incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ReturnActionListenerTag.java (added) +++ incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/ReturnActionListenerTag.java Wed Jun 7 12:17:35 2006 @@ -0,0 +1,64 @@ +/* +* Copyright 2006 The Apache Software Foundation. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package org.apache.myfaces.adfinternal.facelets; + +import java.io.IOException; + +import javax.el.ELException; +import javax.el.ValueExpression; +import javax.faces.FacesException; +import javax.faces.component.ActionSource; +import javax.faces.component.UIComponent; + +import org.apache.myfaces.adfinternal.taglib.listener.ReturnActionListener; + +import com.sun.facelets.FaceletContext; +import com.sun.facelets.FaceletException; +import com.sun.facelets.el.LegacyValueBinding; +import com.sun.facelets.tag.TagAttribute; +import com.sun.facelets.tag.TagConfig; +import com.sun.facelets.tag.TagHandler; +import com.sun.facelets.tag.jsf.ComponentSupport; + +/** + * @author Matthias Wessendorf + * + */ +public class ReturnActionListenerTag extends TagHandler { + + public ReturnActionListenerTag(TagConfig tagConfig) { + super(tagConfig); + _value = getAttribute("value"); + } + + public void apply(FaceletContext faceletContext, UIComponent parent) + throws IOException, FacesException, FaceletException, ELException { + + if(ComponentSupport.isNew(parent)) + { + ValueExpression valueExp = _value.getValueExpression(faceletContext, Object.class); + ActionSource actionSource = (ActionSource)parent; + ReturnActionListener listener = new ReturnActionListener(); + listener.setValueBinding(listener.VALUE_KEY, + new LegacyValueBinding(valueExp)); + + actionSource.addActionListener(listener); + } + } + + private final TagAttribute _value; + +} \ No newline at end of file Modified: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/SetActionListenerTag.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/SetActionListenerTag.java?rev=412491&r1=412490&r2=412491&view=diff ============================================================================== --- incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/SetActionListenerTag.java (original) +++ incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/facelets/SetActionListenerTag.java Wed Jun 7 12:17:35 2006 @@ -15,22 +15,20 @@ */ package org.apache.myfaces.adfinternal.facelets; -import java.io.IOException; - -import javax.el.ELException; -import javax.el.ValueExpression; -import javax.faces.component.ActionSource; -import javax.faces.component.UIComponent; - -import com.sun.facelets.FaceletContext; -import com.sun.facelets.FaceletException; -import com.sun.facelets.el.LegacyValueBinding; -import com.sun.facelets.tag.TagAttribute; -import com.sun.facelets.tag.TagConfig; -import com.sun.facelets.tag.TagHandler; -import com.sun.facelets.tag.jsf.ComponentSupport; - -import org.apache.myfaces.adfinternal.taglib.listener.SetActionListener; +import javax.el.ELException; +import javax.el.ValueExpression; +import javax.faces.component.ActionSource; +import javax.faces.component.UIComponent; + +import org.apache.myfaces.adfinternal.taglib.listener.SetActionListener; + +import com.sun.facelets.FaceletContext; +import com.sun.facelets.FaceletException; +import com.sun.facelets.el.LegacyValueBinding; +import com.sun.facelets.tag.TagAttribute; +import com.sun.facelets.tag.TagConfig; +import com.sun.facelets.tag.TagHandler; +import com.sun.facelets.tag.jsf.ComponentSupport; /** * @author Emmanuel Pirsch