You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/11/04 16:55:04 UTC
svn commit: r1197609 - in /myfaces/commons/trunk:
myfaces-commons-components/pom.xml
myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java
pom.xml
Author: lu4242
Date: Fri Nov 4 15:55:04 2011
New Revision: 1197609
URL: http://svn.apache.org/viewvc?rev=1197609&view=rev
Log:
MYFACES-3381 Add @JSFFaceletFunction annotation
Modified:
myfaces/commons/trunk/myfaces-commons-components/pom.xml
myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java
myfaces/commons/trunk/pom.xml
Modified: myfaces/commons/trunk/myfaces-commons-components/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-components/pom.xml?rev=1197609&r1=1197608&r2=1197609&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-components/pom.xml (original)
+++ myfaces/commons/trunk/myfaces-commons-components/pom.xml Fri Nov 4 15:55:04 2011
@@ -80,7 +80,9 @@
<id>makemcctaglib</id>
<configuration>
<xmlFile>META-INF/mc.taglib.xml</xmlFile>
+ <!--
<xmlBaseFile>src/main/conf/META-INF/facelets-taglib-base.xml</xmlBaseFile>
+ -->
<templateFile>facelets-taglib20.vm</templateFile>
<params>
<shortname>mc</shortname>
@@ -96,7 +98,9 @@
<configuration>
<outputDirectory>${project.build.directory}/tlddoc-facelets</outputDirectory>
<xmlFile>mc_facelets.tld</xmlFile>
+ <!--
<xmlBaseFile>src/main/conf/META-INF/facelet-tld-base.tld</xmlBaseFile>
+ -->
<templateFile>tld-facelets-tomahawk20.vm</templateFile>
<params>
<shortname>mc</shortname>
Modified: myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java?rev=1197609&r1=1197608&r2=1197609&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java (original)
+++ myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java Fri Nov 4 15:55:04 2011
@@ -21,6 +21,8 @@ package org.apache.myfaces.commons.facel
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletFunction;
+
public final class FaceletsFunctionLibrary
{
@@ -29,18 +31,43 @@ public final class FaceletsFunctionLibra
super();
}
+ /**
+ * Return a UIComponent instance based on the passed findComponent
+ * expression. The viewRoot instance is used as component reference
+ *
+ * @param expr
+ * @return
+ */
+ @JSFFaceletFunction(name="mc:findComponent")
public static UIComponent findComponent(String expr)
{
return FacesContext.getCurrentInstance().
getViewRoot().findComponent(expr);
}
-
+
+ /**
+ * Return the client id of the component returned by the findComponent
+ * expression.
+ *
+ * @param expr
+ * @return
+ */
+ @JSFFaceletFunction(name="mc:outputClientId")
public static String outputClientId(String expr)
{
FacesContext ctx = FacesContext.getCurrentInstance();
return ctx.getViewRoot().findComponent(expr).getClientId(ctx);
}
+ /**
+ * Invoke findComponent() taking as reference the passed component
+ * and as param the expression defined.
+ *
+ * @param c
+ * @param expr
+ * @return
+ */
+ @JSFFaceletFunction(name="mc:findComponentFrom")
public static UIComponent findComponentFrom(UIComponent c, String expr)
{
if (c != null)
Modified: myfaces/commons/trunk/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/pom.xml?rev=1197609&r1=1197608&r2=1197609&view=diff
==============================================================================
--- myfaces/commons/trunk/pom.xml (original)
+++ myfaces/commons/trunk/pom.xml Fri Nov 4 15:55:04 2011
@@ -88,7 +88,7 @@
<plugin>
<groupId>org.apache.myfaces.buildtools</groupId>
<artifactId>myfaces-builder-plugin</artifactId>
- <version>1.0.8</version>
+ <version>1.0.10-SNAPSHOT</version>
</plugin>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
@@ -177,7 +177,7 @@
<dependency>
<groupId>org.apache.myfaces.buildtools</groupId>
<artifactId>myfaces-builder-annotations</artifactId>
- <version>1.0.7</version>
+ <version>1.0.9-SNAPSHOT</version>
<scope>provided</scope>
</dependency>