You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2008/04/06 23:53:37 UTC
svn commit: r645313 [1/4] - in /myfaces/tobago/trunk: ./ core/
core/src/main/faces-config/
core/src/main/java/org/apache/myfaces/tobago/component/
core/src/main/java/org/apache/myfaces/tobago/taglib/component/
core/src/main/java/org/apache/myfaces/toba...
Author: bommel
Date: Sun Apr 6 14:53:32 2008
New Revision: 645313
URL: http://svn.apache.org/viewvc?rev=645313&view=rev
Log:
(TOBAGO-637) Generate Components, JSP Tags from annotations
Now we are able to generate JSF 1.2 Components and Tags.
Added:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeListboxBoxTagDeclaration.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/DateExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/FileExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/InExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/LabelExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuCheckboxExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuRadioExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectBooleanCheckboxExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyCheckboxExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyListboxExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneChoiceExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneListboxExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneRadioExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/TextAreaExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/TimeExtensionTag.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/TobagoExtensionBodyTagSupport.java (with props)
myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/package-info.java (with props)
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/component/
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/component/InputSuggest.java (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/InputSuggest.java
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/component/InputSuggest2.java (with props)
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/component/MethodBindingToMethodExpression.java (with props)
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/component/MethodExpressionToMethodBinding.java (with props)
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/MethodExpressionStateChangeListener.java (with props)
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/MethodExpressionTabChangeListener.java (with props)
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeEvent.java (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeEvent.java
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeListener.java (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeListener.java
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeSource.java (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeSource.java
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/SortActionSource.java (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/SortActionSource.java
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/SortActionSource2.java (with props)
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/TabChangeEvent.java (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/TabChangeEvent.java
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/TabChangeListener.java (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/TabChangeListener.java
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/event/TabChangeSource.java (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/TabChangeSource.java
myfaces/tobago/trunk/tobago-jsf-compat/src/test/
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/
- copied from r644224, myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/mock/
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/faces/
- copied from r645312, myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/mock/faces/
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/
- copied from r645312, myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/mock/servlet/
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg (contents, props changed)
- copied, changed from r644224, myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg
- copied, changed from r644224, myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component12.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg
- copied unchanged from r644224, myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg
- copied, changed from r644224, myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag12.stg
Removed:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/InputSuggest.java
myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/mock/
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component12.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag12.stg
Modified:
myfaces/tobago/trunk/core/pom.xml
myfaces/tobago/trunk/core/src/main/faces-config/faces-config.xml
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectItemsTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SheetTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabGroupTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasBinding.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasFor.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasId.java
myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java
myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericComponentTagUnitTest.java
myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericTestBase.java
myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java
myfaces/tobago/trunk/extension/facelets/pom.xml
myfaces/tobago/trunk/extension/tobago-taglib-extension/pom.xml
myfaces/tobago/trunk/pom.xml
myfaces/tobago/trunk/theme/scarborough/pom.xml
myfaces/tobago/trunk/tobago-jsf-compat/pom.xml
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/faces/MockRenderKit.java
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockPageContext.java
myfaces/tobago/trunk/tobago-jsf-compat/src/test/java/org/apache/myfaces/tobago/mock/servlet/MockServletContext.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/TagAttribute.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/UIComponentTagAttribute.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationProcessorFactory.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentPropertyInfo.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/PropertyInfo.java
Modified: myfaces/tobago/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/pom.xml?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/pom.xml (original)
+++ myfaces/tobago/trunk/core/pom.xml Sun Apr 6 14:53:32 2008
@@ -52,7 +52,24 @@
</execution>
</executions>
</plugin>-->
-
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/generated-component</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>maven-apt-plugin</artifactId>
@@ -72,6 +89,7 @@
<factory>org.apache.myfaces.tobago.apt.TaglibAnnotationProcessorFactory</factory>
<nocompile>true</nocompile>
<encoding>UTF-8</encoding>
+ <A>jsf-version=${jsf.target}</A>
</configuration>
</execution>
<execution>
@@ -91,6 +109,7 @@
<fork>true</fork>
<nocompile>true</nocompile>
<encoding>UTF-8</encoding>
+ <A>jsf-version=${jsf.target}</A>
<force>true</force>
</configuration>
</execution>
@@ -115,9 +134,9 @@
<generated>target/generated-faces-config</generated>
<factory>org.apache.myfaces.tobago.apt.FacesConfigAnnotationProcessorFactory</factory>
<fork>true</fork>
- <nocompile>false</nocompile>
+ <nocompile>true</nocompile>
<encoding>UTF-8</encoding>
- <A>sourceFacesConfig=${basedir}/src/main/faces-config/faces-config.xml,targetFacesConfig=faces-config.xml</A>
+ <A>sourceFacesConfig=${basedir}/src/main/faces-config/faces-config.xml,targetFacesConfig=faces-config.xml,jsf-version=${jsf.target}</A>
</configuration>
</execution>
@@ -149,8 +168,8 @@
<encoding>UTF-8</encoding>
<showWarnings>true</showWarnings>
<!-- <compilerArgument>-Xlint:all,-serial,-fallthrough</compilerArgument>-->
- <verbose>true</verbose>
<includes>
+ <include>org/apache/myfaces/tobago/renderkit/*</include>
<include>org/apache/myfaces/tobago/internal/taglib/*</include>
<include>org/apache/myfaces/tobago/component/*</include>
<include>org/apache/myfaces/tobago/component/UITreeListbox*</include>
@@ -241,6 +260,13 @@
<artifactId>tobago-jsf-compat</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.tobago</groupId>
+ <artifactId>tobago-jsf-compat</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
<!--dependency>
<groupId>org.apache.shale</groupId>
<artifactId>shale-test</artifactId>
@@ -302,38 +328,61 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.apache.shale</groupId>
+ <artifactId>shale-test</artifactId>
+ <version>1.0.4</version>
+ <!--version>1.1.0-SNAPSHOT</version-->
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <!--version>${myfaces12.version}</version-->
<scope>provided</scope>
</dependency>
- <!--dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency-->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
- <!--version>2.1</version-->
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
- <!--version>2.4</version-->
</dependency>
- <dependency>
- <groupId>org.apache.shale</groupId>
- <artifactId>shale-test</artifactId>
- <version>1.0.4</version>
- <!--version>1.1.0-SNAPSHOT</version-->
- <scope>test</scope>
- </dependency>
-
</dependencies>
<profiles>
+ <profile>
+ <id>jsf-1.2</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${myfaces12.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <jsf.target>1.2</jsf.target>
+ </properties>
+ </profile>
<!-- Mac OS X has not a tools.jar! -->
<profile>
<id>tools.jar</id>
@@ -509,4 +558,7 @@
</dependencies>
</profile>
</profiles>
+ <properties>
+ <jsf.target>1.1</jsf.target>
+ </properties>
</project>
Modified: myfaces/tobago/trunk/core/src/main/faces-config/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/faces-config/faces-config.xml?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/faces-config/faces-config.xml (original)
+++ myfaces/tobago/trunk/core/src/main/faces-config/faces-config.xml Sun Apr 6 14:53:32 2008
@@ -17,10 +17,6 @@
* limitations under the License.
-->
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
<faces-config>
<application>
<default-render-kit-id>tobago</default-render-kit-id>
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectItemsTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectItemsTagDeclaration.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectItemsTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectItemsTagDeclaration.java Sun Apr 6 14:53:32 2008
@@ -44,7 +44,7 @@
* the information for this option.
*/
@TagAttribute
- @UIComponentTagAttribute(expression = DynamicExpression.VALUE_BINDING_REQUIRED)
+ @UIComponentTagAttribute(type = "javax.faces.model.SelectItem[]", expression = DynamicExpression.VALUE_BINDING_REQUIRED)
void setValue(String value);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SheetTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SheetTagDeclaration.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SheetTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SheetTagDeclaration.java Sun Apr 6 14:53:32 2008
@@ -41,7 +41,8 @@
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UIData",
uiComponentBaseClass = "org.apache.myfaces.tobago.component.AbstractUIData",
- interfaces = "org.apache.myfaces.tobago.ajax.api.AjaxComponent",
+ interfaces = { "org.apache.myfaces.tobago.ajax.api.AjaxComponent",
+ "org.apache.myfaces.tobago.event.SortActionSource" },
rendererType = "Sheet",
allowedChildComponenents = {
"javax.faces.Column",
@@ -114,7 +115,7 @@
* (i.e. also the current value of the "rowData" property) will be exposed.
*/
@TagAttribute(required = true)
- @UIComponentTagAttribute()
+ @UIComponentTagAttribute(expression = DynamicExpression.PROHIBITED)
void setVar(String var);
/**
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabGroupTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabGroupTagDeclaration.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabGroupTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabGroupTagDeclaration.java Sun Apr 6 14:53:32 2008
@@ -46,7 +46,7 @@
uiComponent = "org.apache.myfaces.tobago.component.UITabGroup",
uiComponentBaseClass = "org.apache.myfaces.tobago.component.AbstractUITabGroup",
rendererType = "TabGroup",
- interfaces = "org.apache.myfaces.tobago.ajax.api.AjaxComponent",
+ interfaces = { "org.apache.myfaces.tobago.ajax.api.AjaxComponent", "javax.faces.component.ActionSource"},
allowedChildComponenents = "org.apache.myfaces.tobago.Tab")
public interface TabGroupTagDeclaration extends HasIdBindingAndRendered, HasDeprecatedDimension,
Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeListboxBoxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeListboxBoxTagDeclaration.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeListboxBoxTagDeclaration.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeListboxBoxTagDeclaration.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,27 @@
+package org.apache.myfaces.tobago.taglib.component;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+
+@UIComponentTag(
+ uiComponent = "org.apache.myfaces.tobago.component.UITreeListboxBox",
+ generate = false,
+ rendererType = "TreeListboxBox")
+public interface TreeListboxBoxTagDeclaration {
+}
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeListboxBoxTagDeclaration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeListboxBoxTagDeclaration.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java Sun Apr 6 14:53:32 2008
@@ -35,7 +35,8 @@
* The String is directly passed to the Navigationhandler.
*/
@TagAttribute
- @UIComponentTagAttribute(type = {}, expression = DynamicExpression.METHOD_BINDING)
+ @UIComponentTagAttribute(type = {}, expression = DynamicExpression.METHOD_BINDING,
+ methodReturnType = "java.lang.Object")
void setAction(String action);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasBinding.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasBinding.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasBinding.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasBinding.java Sun Apr 6 14:53:32 2008
@@ -18,6 +18,7 @@
*/
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
import javax.servlet.jsp.JspException;
@@ -30,5 +31,6 @@
* component to a property in a backing bean.
*/
@TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
void setBinding(String binding) throws JspException;
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasFor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasFor.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasFor.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasFor.java Sun Apr 6 14:53:32 2008
@@ -19,6 +19,7 @@
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
/**
* $Id$
@@ -28,6 +29,6 @@
* Id of the component, this is related to.
*/
@TagAttribute
- @UIComponentTagAttribute()
+ @UIComponentTagAttribute(expression = DynamicExpression.PROHIBITED)
void setFor(String forComponent);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasId.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasId.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasId.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasId.java Sun Apr 6 14:53:32 2008
@@ -29,7 +29,7 @@
* This value must be unique within the closest
* parent component that is a naming container.
*/
- @TagAttribute
- @UIComponentTagAttribute()
+ @TagAttribute(rtexprvalue = true)
+ @UIComponentTagAttribute(type = "java.lang.String")
void setId(String id);
}
Modified: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java (original)
+++ myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java Sun Apr 6 14:53:32 2008
@@ -18,11 +18,12 @@
*/
import junit.framework.TestCase;
-import org.apache.myfaces.tobago.mock.faces.MockFacesContext;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import java.util.List;
+
+import org.apache.shale.test.mock.MockFacesContext;
/**
* @author lofwyr (latest modification by $Author$)
Modified: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericComponentTagUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericComponentTagUnitTest.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericComponentTagUnitTest.java (original)
+++ myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericComponentTagUnitTest.java Sun Apr 6 14:53:32 2008
@@ -22,20 +22,16 @@
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_HEIGHT;
import org.apache.myfaces.tobago.util.ComponentUtil;
-import org.apache.myfaces.tobago.mock.faces.MockExternalContext;
-import org.apache.myfaces.tobago.mock.faces.MockFacesContext;
-import org.apache.myfaces.tobago.mock.faces.MockRenderKit;
-import org.apache.myfaces.tobago.mock.faces.MockViewTag;
-import org.apache.myfaces.tobago.mock.servlet.MockHttpServletRequest;
-import org.apache.myfaces.tobago.mock.servlet.MockHttpServletResponse;
-import org.apache.myfaces.tobago.mock.servlet.MockPageContext;
-import org.apache.myfaces.tobago.mock.servlet.MockServletContext;
import org.apache.myfaces.tobago.config.TobagoConfig;
import org.apache.myfaces.tobago.context.Theme;
import org.apache.myfaces.tobago.context.RenderersConfig;
-import org.apache.myfaces.tobago.internal.taglib.ButtonTag;
-import org.apache.myfaces.tobago.internal.taglib.LinkTag;
import org.apache.myfaces.tobago.internal.taglib.TobagoTag;
+import org.apache.myfaces.tobago.mock.faces.MockFacesContext;
+import org.apache.myfaces.tobago.mock.faces.MockExternalContext;
+import org.apache.myfaces.tobago.mock.faces.MockRenderKit;
+import org.apache.myfaces.tobago.mock.servlet.MockServletContext;
+import org.apache.myfaces.tobago.mock.servlet.MockHttpServletRequest;
+import org.apache.myfaces.tobago.mock.servlet.MockHttpServletResponse;
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
@@ -68,7 +64,7 @@
private Application application;
private MockFacesContext facesContext;
- private PageContext pageContext;
+ //private PageContext pageContext;
public GenericComponentTagUnitTest(String name) {
@@ -93,7 +89,7 @@
servletContext.setAttribute(TobagoConfig.TOBAGO_CONFIG, tobagoConfig);
HttpServletRequest request = new MockHttpServletRequest();
HttpServletResponse response = new MockHttpServletResponse();
- pageContext = new MockPageContext(request);
+ //pageContext = new MockPageContext(request);
ExternalContext externalContext =
new MockExternalContext(servletContext, request, response);
Lifecycle lifecycle = null;
@@ -151,12 +147,12 @@
private void testComponent(Tag tag) throws JspException {
if (tag instanceof TobagoTag) {
TobagoTag tobagoTag = (TobagoTag) tag;
- MockViewTag root = new MockViewTag();
- root.setPageContext(pageContext);
- root.setRendered("false");
- root.doStartTag();
- tobagoTag.setParent(root);
- tobagoTag.setPageContext(pageContext);
+ //MockViewTag root = new MockViewTag();
+ //root.setPageContext(pageContext);
+ //root.setRendered("false");
+ //root.doStartTag();
+ //tobagoTag.setParent(root);
+ //tobagoTag.setPageContext(pageContext);
// tobagoTag.setRendered("true");
//tobagoTag.setDisabled("#{peter.male}");
//tobagoTag.setHeight("#{marry.size}");
Modified: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericTestBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericTestBase.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericTestBase.java (original)
+++ myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/taglib/component/GenericTestBase.java Sun Apr 6 14:53:32 2008
@@ -20,8 +20,16 @@
import junit.framework.TestCase;
import javax.servlet.jsp.tagext.Tag;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
+import javax.faces.context.ExternalContext;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.FactoryFinder;
+import javax.faces.component.UIViewRoot;
+import javax.faces.application.ApplicationFactory;
+import javax.faces.application.Application;
import net.sf.maventaglib.checker.Tld;
import net.sf.maventaglib.checker.TldParser;
@@ -40,13 +48,20 @@
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.mock.servlet.MockPageContext;
+import org.apache.myfaces.tobago.mock.servlet.MockServletContext;
+import org.apache.myfaces.tobago.mock.servlet.MockHttpServletRequest;
+import org.apache.myfaces.tobago.mock.servlet.MockHttpServletResponse;
+import org.apache.myfaces.tobago.mock.faces.MockExternalContext;
+import org.apache.myfaces.tobago.mock.faces.MockFacesContext;
+//import org.apache.myfaces.tobago.mock.servlet.MockPageContext;
public abstract class GenericTestBase extends TestCase {
private static final Log LOG = LogFactory.getLog(GenericTestBase.class);
protected Tld[] tlds;
protected String[] tldPaths;
+ private Application application;
+ private MockFacesContext facesContext;
public GenericTestBase(String name) {
super(name);
@@ -60,6 +75,37 @@
tlds[i] = getTld(tldPaths[i], stream);
stream.close();
}
+
+ MockServletContext servletContext = new MockServletContext();
+ HttpServletRequest request = new MockHttpServletRequest();
+ HttpServletResponse response = new MockHttpServletResponse();
+ //pageContext = new MockPageContext(request);
+ ExternalContext externalContext =
+ new MockExternalContext(servletContext, request, response);
+ Lifecycle lifecycle = null;
+ facesContext = new MockFacesContext(externalContext, lifecycle);
+ // Set up Faces API Objects
+ FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY,
+ "org.apache.myfaces.tobago.mock.faces.MockApplicationFactory");
+ FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY,
+ "org.apache.myfaces.tobago.mock.faces.MockRenderKitFactory");
+
+ ApplicationFactory applicationFactory = (ApplicationFactory)
+ FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
+ application = applicationFactory.getApplication();
+ application.addComponent("javax.faces.ViewRoot", "org.apache.myfaces.tobago.component.UIViewRoot");
+ application.addComponent("javax.faces.Command", "javax.faces.component.UICommand");
+ application.addComponent("org.apache.myfaces.tobago.Command", "org.apache.myfaces.tobago.component.UICommand");
+ application
+ .addComponent("org.apache.myfaces.tobago.LinkCommand", "org.apache.myfaces.tobago.component.UILinkCommand");
+ application
+ .addComponent("org.apache.myfaces.tobago.ButtonCommand", "org.apache.myfaces.tobago.component.UIButtonCommand");
+
+ facesContext.setApplication(application);
+ UIViewRoot root = facesContext
+ .getApplication().getViewHandler().createView(facesContext, "testViewId");
+ root.setViewId("/viewId");
+ facesContext.setViewRoot(root);
}
public void testRelease() throws IllegalAccessException,
@@ -110,7 +156,7 @@
private void checkRelease(javax.servlet.jsp.tagext.Tag tag) throws NoSuchMethodException,
IllegalAccessException, InvocationTargetException, IOException,
SAXException {
- tag.setPageContext(new MockPageContext());
+ //tag.setPageContext(new MockPageContext());
HashMap initialValues = new HashMap();
PropertyDescriptor descriptors[] =
Modified: myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java (original)
+++ myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/DynamicTag.java Sun Apr 6 14:53:32 2008
@@ -34,7 +34,7 @@
(Controller) VariableResolverUtil.resolveVariable(FacesContext.getCurrentInstance(), controllerName);
// Controller controller = (Controller) pageContext.getSession().getAttribute(controllerName);
if (controller != null) {
- tag = controller.createTag();
+ //tag = controller.createTag();
tag.setPageContext(pageContext);
tag.setParent(getParent());
tag.doStartTag();
Modified: myfaces/tobago/trunk/extension/facelets/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/facelets/pom.xml?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/facelets/pom.xml (original)
+++ myfaces/tobago/trunk/extension/facelets/pom.xml Sun Apr 6 14:53:32 2008
@@ -61,6 +61,7 @@
<version>${project.version}</version>
<type>jar</type>
<classifier>sources</classifier>
+ <includes>org/apache/myfaces/tobago/taglib/decl/**/*,org/apache/myfaces/tobago/taglib/component/**/*</includes>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/tobago-core-sources</outputDirectory>
@@ -143,6 +144,7 @@
<layout>legacy</layout>
</repository>
</repositories>
+
<dependencies>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
@@ -178,31 +180,65 @@
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</dependency>
-<!--
- testing jetty dependency
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jsp-2.1</artifactId>
- <version>6.0.1</version>
- <scope>provided</scope>
- </dependency>
--->
-
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
+ <!--version>${myfaces12.version}</version-->
<scope>provided</scope>
</dependency>
-
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
</dependencies>
+
+ <profiles>
+ <profile>
+ <id>tools.jar</id>
+ <activation>
+ <os><family>!mac</family></os>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.5.0</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>jsf-1.2</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${myfaces12.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
Modified: myfaces/tobago/trunk/extension/tobago-taglib-extension/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/pom.xml?rev=645313&r1=645312&r2=645313&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/pom.xml (original)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/pom.xml Sun Apr 6 14:53:32 2008
@@ -53,6 +53,20 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <encoding>UTF-8</encoding>
+ <showWarnings>true</showWarnings>
+ <excludes>
+ <exclude>org/apache/myfaces/tobago/taglib/component/*</exclude>
+ <exclude>${taglib.exclude}</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.myfaces.tobago</groupId>
@@ -65,11 +79,10 @@
<phase>compile</phase>
<configuration>
<targetFiles>
- <targetFile>org/apache/myfaces/tobago/taglib/extension/tobago-extension.tld</targetFile>
+ <targetFile>${taglib.file}</targetFile>
</targetFiles>
<excludes>
- <exclude>org/apache/myfaces/tobago/util/CommonsLoggingLogger.java</exclude>
- <exclude>org/apache/myfaces/tobago/application/FopConverter.java</exclude>
+ <exclude>${taglib.exclude}</exclude>
<exclude>org/apache/myfaces/tobago/taglib/component/*</exclude>
</excludes>
<aptSourceRoots>
@@ -80,6 +93,7 @@
<factory>org.apache.myfaces.tobago.apt.TaglibAnnotationProcessorFactory</factory>
<nocompile>true</nocompile>
<encoding>UTF-8</encoding>
+ <A>jsf-version=${jsf.target}</A>
</configuration>
</execution>
@@ -158,10 +172,44 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
-
</dependencies>
<profiles>
+ <profile>
+ <id>jsf-1.2</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${myfaces12.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <jsf.target>1.2</jsf.target>
+ <taglib.exclude>org/apache/myfaces/tobago/taglib/extension/*</taglib.exclude>
+ <taglib.file>org/apache/myfaces/tobago/taglib/extension12/tobago-extension.tld</taglib.file>
+ </properties>
+ </profile>
<!-- Mac OS X has not a tools.jar! -->
<profile>
<id>tools.jar</id>
@@ -299,4 +347,8 @@
</dependencies>
</profile>
</profiles>
+ <properties>
+ <taglib.exclude>org/apache/myfaces/tobago/taglib/extension12/*</taglib.exclude>
+ <taglib.file>org/apache/myfaces/tobago/taglib/extension/tobago-extension.tld</taglib.file>
+ </properties>
</project>
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/DateExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/DateExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/DateExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/DateExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,378 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import org.apache.myfaces.tobago.internal.taglib.DatePickerTag;
+import org.apache.myfaces.tobago.internal.taglib.DateTag;
+import org.apache.myfaces.tobago.internal.taglib.FormTag;
+
+import javax.servlet.jsp.JspException;
+
+/*
+ * Date: 19.12.2005
+ * Time: 20:13:26
+ */
+/**
+ * Renders a date input field with a date picker and a label.
+ * <br />
+ * Short syntax of:
+ * <p/>
+ * <pre>
+ * <tc:panel>
+ * <f:facet name="layout">
+ * <tc:gridLayout columns="fixed;*"/>
+ * </f:facet>
+ * <tc:label value="#{label}" for="@auto"/>
+ * <tc:date value="#{value}">
+ * ...
+ * </tc:in>
+ * </tc:panel>
+ * </pre>
+ */
+@Tag(name = "date")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.DateTag")
+public class DateExtensionTag extends TobagoExtensionBodyTagSupport {
+
+ private static final long serialVersionUID = 2044784791513107420L;
+
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression converter;
+ private javax.el.MethodExpression validator;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression focus;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression readonly;
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression required;
+ private javax.el.ValueExpression tip;
+ private javax.el.ValueExpression value;
+ private javax.el.MethodExpression valueChangeListener;
+ private javax.el.ValueExpression inline;
+ private javax.el.ValueExpression onchange;
+ private javax.el.ValueExpression tabIndex;
+ private javax.el.ValueExpression markup;
+
+ private javax.el.ValueExpression labelWidth;
+ private LabelExtensionTag labelTag;
+ private DateTag dateTag;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ labelTag = new LabelExtensionTag();
+ labelTag.setPageContext(pageContext);
+ if (label != null) {
+ labelTag.setValue(label);
+ }
+
+ if (labelWidth != null) {
+ labelTag.setColumns(createStringValueExpression(labelWidth.getExpressionString() + ";*;fixed"));
+ } else {
+ labelTag.setColumns(createStringValueExpression("fixed;*;fixed"));
+ }
+ if (tip != null) {
+ labelTag.setTip(tip);
+ }
+ if (rendered != null) {
+ labelTag.setRendered(rendered);
+ }
+ labelTag.setParent(getParent());
+ labelTag.doStartTag();
+
+ dateTag = new DateTag();
+ dateTag.setPageContext(pageContext);
+ if (value != null) {
+ dateTag.setValue(value);
+ }
+ if (valueChangeListener != null) {
+ dateTag.setValueChangeListener(valueChangeListener);
+ }
+ if (binding != null) {
+ dateTag.setBinding(binding);
+ }
+ if (converter != null) {
+ dateTag.setConverter(converter);
+ }
+ if (validator != null) {
+ dateTag.setValidator(validator);
+ }
+ if (disabled != null) {
+ dateTag.setDisabled(disabled);
+ }
+ if (onchange != null) {
+ dateTag.setOnchange(onchange);
+ }
+ if (focus != null) {
+ dateTag.setFocus(focus);
+ }
+ if (id != null) {
+ dateTag.setId(id);
+ }
+ if (inline != null) {
+ dateTag.setInline(inline);
+ }
+ if (readonly != null) {
+ dateTag.setReadonly(readonly);
+ }
+ if (required != null) {
+ dateTag.setRequired(required);
+ }
+ if (markup != null) {
+ dateTag.setMarkup(markup);
+ }
+ if (tabIndex != null) {
+ dateTag.setTabIndex(tabIndex);
+ }
+ dateTag.setParent(labelTag);
+ dateTag.doStartTag();
+
+ return super.doStartTag();
+ }
+
+
+
+ @Override
+ public int doEndTag() throws JspException {
+ dateTag.doEndTag();
+ FormTag formTag = new FormTag();
+ formTag.setPageContext(pageContext);
+ formTag.setParent(labelTag);
+ formTag.doStartTag();
+
+ DatePickerTag datePicker = new DatePickerTag();
+ datePicker.setPageContext(pageContext);
+ datePicker.setFor("@auto");
+ if (tabIndex != null) {
+ datePicker.setTabIndex(tabIndex);
+ }
+ datePicker.setParent(formTag);
+ datePicker.doStartTag();
+ datePicker.doEndTag();
+ formTag.doEndTag();
+
+ labelTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ binding = null;
+ converter = null;
+ validator = null;
+ disabled = null;
+ labelWidth = null;
+ focus = null;
+ label = null;
+ inline = null;
+ readonly = null;
+ rendered = null;
+ required = null;
+ tip = null;
+ value = null;
+ valueChangeListener = null;
+ onchange = null;
+ markup = null;
+ tabIndex = null;
+ labelTag = null;
+ dateTag = null;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * MethodBinding representing a value change listener method
+ * that will be notified when a new value has been set for this input component.
+ * The expression must evaluate to a public method that takes a ValueChangeEvent
+ * parameter, with a return type of void.
+ *
+ * @param valueChangeListener
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = {},
+ expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ValueChangeEvent")
+ public void setValueChangeListener(javax.el.MethodExpression valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ /**
+ * Clientside script function to add to this component's onchange handler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnchange(javax.el.ValueExpression onchange) {
+ this.onchange = onchange;
+ }
+
+ /**
+ * Flag indicating this component should recieve the focus.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setFocus(javax.el.ValueExpression focus) {
+ this.focus = focus;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) {
+ this.binding = binding;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * An expression that specifies the Converter for this component.
+ * If the value binding expression is a String,
+ * the String is used as an ID to look up a Converter.
+ * If the value binding expression is a Converter,
+ * uses that instance as the converter.
+ * The value can either be a static value (ID case only)
+ * or an EL expression.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
+ expression = DynamicExpression.VALUE_BINDING)
+ public void setConverter(javax.el.ValueExpression converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * A method binding EL expression,
+ * accepting FacesContext, UIComponent,
+ * and Object parameters, and returning void, that validates
+ * the component's local value.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {},
+ expression = DynamicExpression.METHOD_BINDING,
+ methodSignature = { "javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object" })
+ public void setValidator(javax.el.MethodExpression validator) {
+ this.validator = validator;
+ }
+
+ /**
+ * Flag indicating this component should rendered as an inline element.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setInline(javax.el.ValueExpression inline) {
+ this.inline = inline;
+ }
+
+ /**
+ * Flag indicating that this component will prohibit changes by the user.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setReadonly(javax.el.ValueExpression readonly) {
+ this.readonly = readonly;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * Flag indicating that a value is required.
+ * If the value is an empty string a
+ * ValidationError occurs and a Error Message is rendered.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setRequired(javax.el.ValueExpression required) {
+ this.required = required;
+ }
+
+ /**
+ * Text value to display as tooltip.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setTip(javax.el.ValueExpression tip) {
+ this.tip = tip;
+ }
+
+ /**
+ * The width for the label component. Default: 'fixed'.
+ * This value is used in the gridLayouts columns attribute.
+ * See gridLayout tag for valid values.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabelWidth(javax.el.ValueExpression labelWidth) {
+ this.labelWidth = labelWidth;
+ }
+
+ /**
+ * Indicate markup of this component.
+ * Possible value is 'none'. But this can be overridden in the theme.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
+ public void setMarkup(javax.el.ValueExpression markup) {
+ this.markup = markup;
+ }
+
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Integer")
+ public void setTabIndex(javax.el.ValueExpression tabIndex) {
+ this.tabIndex = tabIndex;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/DateExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/DateExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/FileExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/FileExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/FileExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/FileExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,286 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import org.apache.myfaces.tobago.internal.taglib.FileTag;
+
+import javax.servlet.jsp.JspException;
+
+/**
+ * Renders a file input field with a label.
+ * <p/>
+ * Short syntax of:
+ * <p/>
+ * <pre>
+ * <tc:panel>
+ * <f:facet name="layout">
+ * <tc:gridLayout columns="fixed;*"/>
+ * </f:facet>
+ * <tc:label value="#{label}" for="@auto"/>
+ * <tc:file value="#{value}">
+ * ...
+ * </tc:in>
+ * </tc:panel>
+ * </pre>
+ */
+
+@Tag(name = "file")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.FileTag")
+public class FileExtensionTag extends TobagoExtensionBodyTagSupport {
+
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression value;
+ private javax.el.MethodExpression valueChangeListener;
+ private javax.el.MethodExpression validator;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression tip;
+ private javax.el.ValueExpression onchange;
+ private javax.el.ValueExpression labelWidth;
+ private javax.el.ValueExpression required;
+ private javax.el.ValueExpression tabIndex;
+ private javax.el.ValueExpression focus;
+
+ private LabelExtensionTag labelTag;
+ private FileTag fileTag;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ labelTag = new LabelExtensionTag();
+ labelTag.setPageContext(pageContext);
+ if (label != null) {
+ labelTag.setValue(label);
+ }
+ if (tip != null) {
+ labelTag.setTip(tip);
+ }
+ if (rendered != null) {
+ labelTag.setRendered(rendered);
+ }
+ if (labelWidth != null) {
+ labelTag.setLabelWidth(createStringValueExpression(labelWidth.getExpressionString() + ";*"));
+ }
+ labelTag.setParent(getParent());
+ labelTag.doStartTag();
+
+ fileTag = new FileTag();
+ fileTag.setPageContext(pageContext);
+ if (value != null) {
+ fileTag.setValue(value);
+ }
+ if (valueChangeListener != null) {
+ fileTag.setValueChangeListener(valueChangeListener);
+ }
+ if (binding != null) {
+ fileTag.setBinding(binding);
+ }
+ if (validator != null) {
+ fileTag.setValidator(validator);
+ }
+ if (disabled != null) {
+ fileTag.setDisabled(disabled);
+ }
+ if (id != null) {
+ fileTag.setId(id);
+ }
+ if (onchange != null) {
+ fileTag.setOnchange(onchange);
+ }
+ if (required != null) {
+ fileTag.setRequired(required);
+ }
+ if (tabIndex != null) {
+ fileTag.setTabIndex(tabIndex);
+ }
+
+ if (focus != null) {
+ //fileTag.set
+ }
+ fileTag.setParent(labelTag);
+ fileTag.doStartTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ fileTag.doEndTag();
+ labelTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ binding = null;
+ validator = null;
+ disabled = null;
+ label = null;
+ labelWidth = null;
+ tip = null;
+ onchange = null;
+ value = null;
+ rendered = null;
+ valueChangeListener = null;
+ required = null;
+ tabIndex = null;
+ fileTag = null;
+ labelTag = null;
+ focus = null;
+ }
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * MethodBinding representing a value change listener method
+ * that will be notified when a new value has been set for this input component.
+ * The expression must evaluate to a public method that takes a ValueChangeEvent
+ * parameter, with a return type of void.
+ *
+ * @param valueChangeListener
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = {},
+ expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ValueChangeEvent")
+ public void setValueChangeListener(javax.el.MethodExpression valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ /**
+ * Clientside script function to add to this component's onchange handler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnchange(javax.el.ValueExpression onchange) {
+ this.onchange = onchange;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) {
+ this.binding = binding;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * A method binding EL expression,
+ * accepting FacesContext, UIComponent,
+ * and Object parameters, and returning void, that validates
+ * the component's local value.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {},
+ expression = DynamicExpression.METHOD_BINDING,
+ methodSignature = { "javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object" })
+ public void setValidator(javax.el.MethodExpression validator) {
+ this.validator = validator;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * Text value to display as tooltip.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setTip(javax.el.ValueExpression tip) {
+ this.tip = tip;
+ }
+ /**
+ * The width for the label component. Default: 'fixed'.
+ * This value is used in the gridLayouts columns attribute.
+ * See gridLayout tag for valid values.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabelWidth(javax.el.ValueExpression labelWidth) {
+ this.labelWidth = labelWidth;
+ }
+
+ /**
+ * Flag indicating that a value is required.
+ * If the value is an empty string a
+ * ValidationError occurs and a Error Message is rendered.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setRequired(javax.el.ValueExpression required) {
+ this.required = required;
+ }
+
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Integer")
+ public void setTabIndex(javax.el.ValueExpression tabIndex) {
+ this.tabIndex = tabIndex;
+ }
+
+ /**
+ * Flag indicating this component should recieve the focus.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setFocus(javax.el.ValueExpression focus) {
+ this.focus = focus;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/FileExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/FileExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/InExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/InExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/InExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/InExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,367 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import org.apache.myfaces.tobago.internal.taglib.InTag;
+
+import javax.servlet.jsp.JspException;
+
+/**
+ * Renders a text input field with a label.
+ * <br />
+ * Short syntax of:
+ * <p/>
+ * <pre>
+ * <tc:panel>
+ * <f:facet name="layout">
+ * <tc:gridLayout columns="fixed;*"/>
+ * </f:facet>
+ * <tc:label value="#{label}" for="@auto"/>
+ * <tc:in value="#{value}">
+ * ...
+ * </tc:in>
+ * </tc:panel>
+ * </pre>
+ */
+
+@Tag(name = "in")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.InTag")
+public class InExtensionTag extends TobagoExtensionBodyTagSupport {
+
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression converter;
+ private javax.el.MethodExpression validator;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression focus;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression password;
+ private javax.el.ValueExpression readonly;
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression required;
+ private javax.el.ValueExpression tip;
+ private javax.el.ValueExpression value;
+ private javax.el.MethodExpression valueChangeListener;
+ private javax.el.ValueExpression onchange;
+ private javax.el.MethodExpression suggestMethod;
+ private javax.el.ValueExpression markup;
+ private javax.el.ValueExpression labelWidth;
+ private javax.el.ValueExpression tabIndex;
+
+ private LabelExtensionTag labelTag;
+ private InTag inTag;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ labelTag = new LabelExtensionTag();
+ labelTag.setPageContext(pageContext);
+ if (label != null) {
+ labelTag.setValue(label);
+ }
+ if (tip != null) {
+ labelTag.setTip(tip);
+ }
+ if (rendered != null) {
+ labelTag.setRendered(rendered);
+ }
+ if (labelWidth != null) {
+ labelTag.setColumns(createStringValueExpression(labelWidth.getExpressionString() + ";*"));
+ }
+
+ labelTag.setParent(getParent());
+ labelTag.doStartTag();
+
+ inTag = new InTag();
+ inTag.setPageContext(pageContext);
+ if (value != null) {
+ inTag.setValue(value);
+ }
+ if (valueChangeListener != null) {
+ inTag.setValueChangeListener(valueChangeListener);
+ }
+ if (binding != null) {
+ inTag.setBinding(binding);
+ }
+ if (converter != null) {
+ inTag.setConverter(converter);
+ }
+ if (validator != null) {
+ inTag.setValidator(validator);
+ }
+ if (onchange != null) {
+ inTag.setOnchange(onchange);
+ }
+ if (suggestMethod != null) {
+ inTag.setSuggestMethod(suggestMethod);
+ }
+ if (disabled != null) {
+ inTag.setDisabled(disabled);
+ }
+ if (focus != null) {
+ inTag.setFocus(focus);
+ }
+ if (id != null) {
+ inTag.setId(id);
+ }
+ if (password != null) {
+ inTag.setPassword(password);
+ }
+ if (readonly != null) {
+ inTag.setReadonly(readonly);
+ }
+ if (required != null) {
+ inTag.setRequired(required);
+ }
+ if (markup != null) {
+ inTag.setMarkup(markup);
+ }
+ if (tabIndex != null) {
+ inTag.setTabIndex(tabIndex);
+ }
+ inTag.setParent(labelTag);
+ inTag.doStartTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ inTag.doEndTag();
+ labelTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ binding = null;
+ converter = null;
+ validator = null;
+ disabled = null;
+ labelWidth = null;
+ focus = null;
+ label = null;
+ password = null;
+ readonly = null;
+ rendered = null;
+ required = null;
+ tip = null;
+ value = null;
+ valueChangeListener = null;
+ onchange = null;
+ suggestMethod = null;
+ markup = null;
+ tabIndex = null;
+ inTag = null;
+ labelTag = null;
+ }
+
+ /**
+ * Indicate markup of this component.
+ * Possible value is 'none'. But this can be overridden in the theme.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
+ public void setMarkup(javax.el.ValueExpression markup) {
+ this.markup = markup;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * MethodBinding representing a value change listener method
+ * that will be notified when a new value has been set for this input component.
+ * The expression must evaluate to a public method that takes a ValueChangeEvent
+ * parameter, with a return type of void.
+ *
+ * @param valueChangeListener
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = {},
+ expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ValueChangeEvent")
+ public void setValueChangeListener(javax.el.MethodExpression valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ /**
+ * Flag indicating this component should recieve the focus.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setFocus(javax.el.ValueExpression focus) {
+ this.focus = focus;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) {
+ this.binding = binding;
+ }
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * An expression that specifies the Converter for this component.
+ * If the value binding expression is a String,
+ * the String is used as an ID to look up a Converter.
+ * If the value binding expression is a Converter,
+ * uses that instance as the converter.
+ * The value can either be a static value (ID case only)
+ * or an EL expression.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
+ expression = DynamicExpression.VALUE_BINDING)
+ public void setConverter(javax.el.ValueExpression converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * Clientside script function to add to this component's onchange handler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnchange(javax.el.ValueExpression onchange) {
+ this.onchange = onchange;
+ }
+
+ /**
+ * @param suggestMethod
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {},
+ expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "java.lang.String")
+ public void setSuggestMethod(javax.el.MethodExpression suggestMethod) {
+ this.suggestMethod = suggestMethod;
+ }
+
+ /**
+ * A method binding EL expression,
+ * accepting FacesContext, UIComponent,
+ * and Object parameters, and returning void, that validates
+ * the component's local value.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {},
+ expression = DynamicExpression.METHOD_BINDING,
+ methodSignature = { "javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object" })
+ public void setValidator(javax.el.MethodExpression validator) {
+ this.validator = validator;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered as
+ * password field , so you will not see the typed charakters.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setPassword(javax.el.ValueExpression password) {
+ this.password = password;
+ }
+
+ /**
+ * Flag indicating that this component will prohibit changes by the user.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setReadonly(javax.el.ValueExpression readonly) {
+ this.readonly = readonly;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * Flag indicating that a value is required.
+ * If the value is an empty string a
+ * ValidationError occurs and a Error Message is rendered.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setRequired(javax.el.ValueExpression required) {
+ this.required = required;
+ }
+
+ /**
+ * Text value to display as tooltip.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setTip(javax.el.ValueExpression tip) {
+ this.tip = tip;
+ }
+
+ /**
+ * The width for the label component. Default: 'fixed'.
+ * This value is used in the gridLayouts columns attribute.
+ * See gridLayout tag for valid values.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabelWidth(javax.el.ValueExpression labelWidth) {
+ this.labelWidth = labelWidth;
+ }
+
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Integer")
+ public void setTabIndex(javax.el.ValueExpression tabIndex) {
+ this.tabIndex = tabIndex;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/InExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/InExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/LabelExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/LabelExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/LabelExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/LabelExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,173 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_LAYOUT;
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.internal.taglib.GridLayoutTag;
+import org.apache.myfaces.tobago.internal.taglib.LabelTag;
+import org.apache.myfaces.tobago.internal.taglib.PanelTag;
+import org.apache.myfaces.tobago.util.LayoutUtil;
+
+import javax.faces.webapp.FacetTag;
+import javax.servlet.jsp.JspException;
+import javax.el.ValueExpression;
+
+@Tag(name = "label")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.LabelTag")
+public class LabelExtensionTag extends TobagoExtensionBodyTagSupport {
+
+ private static final Log LOG = LogFactory.getLog(LabelExtensionTag.class);
+
+ public static final String DEFAULT_COLUMNS = "fixed;*";
+
+ private javax.el.ValueExpression value;
+ private javax.el.ValueExpression tip;
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression columns;
+ private String rows = "fixed";
+ private javax.el.ValueExpression labelWidth;
+
+ private PanelTag panelTag;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ panelTag = new PanelTag();
+ panelTag.setPageContext(pageContext);
+ panelTag.setParent(getParent());
+ if (rendered != null) {
+ panelTag.setRendered(rendered);
+ }
+ panelTag.doStartTag();
+
+ FacetTag facetTag = new FacetTag();
+ facetTag.setPageContext(pageContext);
+ facetTag.setName(FACET_LAYOUT);
+ facetTag.setParent(panelTag);
+ facetTag.doStartTag();
+
+ if (columns == null) {
+ if (labelWidth != null) {
+ setColumns(createStringValueExpression(labelWidth.getExpressionString() + ";*"));
+ } else {
+ setColumns(createStringValueExpression(DEFAULT_COLUMNS));
+ }
+ }
+ GridLayoutTag gridLayoutTag = new GridLayoutTag();
+ gridLayoutTag.setPageContext(pageContext);
+ gridLayoutTag.setColumns(columns);
+ javax.el.ValueExpression ve = createStringValueExpression(rows);
+ gridLayoutTag.setRows(ve);
+ gridLayoutTag.setParent(facetTag);
+ gridLayoutTag.doStartTag();
+ gridLayoutTag.doEndTag();
+
+ facetTag.doEndTag();
+
+ LabelTag labelTag = new LabelTag();
+ labelTag.setPageContext(pageContext);
+ if (value != null) {
+ labelTag.setValue(value);
+ }
+ if (tip != null) {
+ labelTag.setTip(tip);
+ }
+ labelTag.setFor("@auto");
+ labelTag.setParent(panelTag);
+ labelTag.doStartTag();
+ labelTag.doEndTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ panelTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ value = null;
+ tip = null;
+ rendered = null;
+ columns = null;
+ rows = "fixed";
+ panelTag = null;
+ labelWidth = null;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * Text value to display as tooltip.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setTip(javax.el.ValueExpression tip) {
+ this.tip = tip;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ void setColumns(javax.el.ValueExpression columns) {
+ if (!(!columns.isLiteralText() || LayoutUtil.checkTokens(columns.getExpressionString()))) {
+ LOG.warn("Illegal value for columns = \"" + columns.getExpressionString() + "\" replacing with default: \"" + DEFAULT_COLUMNS + "\"");
+ this.columns = createStringValueExpression(DEFAULT_COLUMNS);
+ } else {
+ this.columns = columns;
+ }
+ }
+
+ void setRows(String rows) {
+ this.rows = rows;
+ }
+
+ /**
+ * The width for the label component. Default: 'fixed'.
+ * This value is used in the gridLayouts columns attribute.
+ * See gridLayout tag for valid values.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabelWidth(ValueExpression labelWidth) {
+ this.labelWidth = labelWidth;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/LabelExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/LabelExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL