Skip to content
Browse files

Switch on public repo

  • Loading branch information...
0 parents commit 4c4b0d64499524e9436ba49cfd763068349ecfd7 @lguerin lguerin committed Aug 23, 2011
Showing with 3,966 additions and 0 deletions.
  1. +7 −0 .gitignore
  2. 0 README
  3. +149 −0 pom.xml
  4. +41 −0 src/main/java/fr/exanpe/t5/demo/components/ComponentDemoLayout.java
  5. +16 −0 src/main/java/fr/exanpe/t5/demo/components/HighlightBody.java
  6. +48 −0 src/main/java/fr/exanpe/t5/demo/components/HighlightTMLPage.java
  7. +44 −0 src/main/java/fr/exanpe/t5/demo/components/Layout.java
  8. +23 −0 src/main/java/fr/exanpe/t5/demo/data/CountryEnum.java
  9. +6 −0 src/main/java/fr/exanpe/t5/demo/data/FranceCityEnum.java
  10. +6 −0 src/main/java/fr/exanpe/t5/demo/data/ThirdEnum.java
  11. +6 −0 src/main/java/fr/exanpe/t5/demo/data/UKCityEnum.java
  12. +6 −0 src/main/java/fr/exanpe/t5/demo/data/USACityEnum.java
  13. +31 −0 src/main/java/fr/exanpe/t5/demo/data/User.java
  14. +73 −0 src/main/java/fr/exanpe/t5/demo/grouping/Mail.java
  15. +59 −0 src/main/java/fr/exanpe/t5/demo/grouping/MailboxSumUp.java
  16. +6 −0 src/main/java/fr/exanpe/t5/demo/pages/About.java
  17. +6 −0 src/main/java/fr/exanpe/t5/demo/pages/Contact.java
  18. +10 −0 src/main/java/fr/exanpe/t5/demo/pages/Index.java
  19. +99 −0 src/main/java/fr/exanpe/t5/demo/pages/components/Grouping.java
  20. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example1.java
  21. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example2.java
  22. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example3.java
  23. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example4.java
  24. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example5.java
  25. +21 −0 src/main/java/fr/exanpe/t5/demo/pages/components/ajaxLoader/Example1.java
  26. +21 −0 src/main/java/fr/exanpe/t5/demo/pages/components/ajaxLoader/Example2.java
  27. +19 −0 src/main/java/fr/exanpe/t5/demo/pages/components/ajaxLoader/Example3.java
  28. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/border/Example1.java
  29. +13 −0 src/main/java/fr/exanpe/t5/demo/pages/components/colorPicker/Example1.java
  30. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/dialog/Example1.java
  31. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/dialog/Example2.java
  32. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/dialog/Example3.java
  33. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/dialog/Example4.java
  34. +68 −0 src/main/java/fr/exanpe/t5/demo/pages/components/exanpeSkin/Example1.java
  35. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/hideablePanel/Example1.java
  36. +5 −0 src/main/java/fr/exanpe/t5/demo/pages/components/hideablePanel/Example2.java
  37. +21 −0 src/main/java/fr/exanpe/t5/demo/pages/components/securePassword/Example1.java
  38. +21 −0 src/main/java/fr/exanpe/t5/demo/pages/components/securePassword/Example2.java
  39. +17 −0 src/main/java/fr/exanpe/t5/demo/pages/components/securePassword/Example3.java
  40. +85 −0 src/main/java/fr/exanpe/t5/demo/pages/components/selectLoader/Example1.java
  41. +147 −0 src/main/java/fr/exanpe/t5/demo/pages/components/selectLoader/Example2.java
  42. +11 −0 src/main/java/fr/exanpe/t5/demo/pages/components/slider/Example1.java
  43. +11 −0 src/main/java/fr/exanpe/t5/demo/pages/components/slider/Example2.java
  44. +11 −0 src/main/java/fr/exanpe/t5/demo/pages/components/slider/Example3.java
  45. +11 −0 src/main/java/fr/exanpe/t5/demo/pages/components/slider/Example4.java
  46. +6 −0 src/main/java/fr/exanpe/t5/demo/pages/components/tabview/Example1.java
  47. +6 −0 src/main/java/fr/exanpe/t5/demo/pages/components/tabview/Example2.java
  48. +6 −0 src/main/java/fr/exanpe/t5/demo/pages/components/tabview/Example3.java
  49. +20 −0 src/main/java/fr/exanpe/t5/demo/pages/components/tabview/Example4.java
  50. +6 −0 src/main/java/fr/exanpe/t5/demo/pages/components/tooltip/Example1.java
  51. +6 −0 src/main/java/fr/exanpe/t5/demo/pages/components/tooltip/Example2.java
  52. +6 −0 src/main/java/fr/exanpe/t5/demo/pages/components/tooltip/Example3.java
  53. +148 −0 src/main/java/fr/exanpe/t5/demo/services/AppModule.java
  54. +46 −0 src/main/java/fr/exanpe/t5/demo/services/DataService.java
  55. +30 −0 src/main/java/fr/exanpe/t5/demo/services/MailboxService.java
  56. +46 −0 src/main/resources/fr/exanpe/t5/demo/components/ComponentDemoLayout.tml
  57. +10 −0 src/main/resources/fr/exanpe/t5/demo/components/HighlightBody.tml
  58. +8 −0 src/main/resources/fr/exanpe/t5/demo/components/HighlightTMLPage.tml
  59. +68 −0 src/main/resources/fr/exanpe/t5/demo/components/Layout.tml
  60. +22 −0 src/main/resources/fr/exanpe/t5/demo/pages/components/Grouping.properties
  61. +6 −0 src/main/resources/fr/exanpe/t5/demo/pages/components/accordion/Example2.properties
  62. +1 −0 src/main/resources/fr/exanpe/t5/demo/pages/components/ajaxLoader/Example2.properties
  63. +2 −0 src/main/resources/fr/exanpe/t5/demo/pages/components/dialog/Example3.properties
  64. +2 −0 src/main/resources/fr/exanpe/t5/demo/pages/components/dialog/Example4.properties
  65. +5 −0 src/main/resources/fr/exanpe/t5/demo/pages/components/tabview/Example3.properties
  66. +1 −0 src/main/resources/fr/exanpe/t5/demo/pages/components/tooltip/Example1.properties
  67. +1 −0 src/main/resources/fr/exanpe/t5/demo/pages/components/tooltip/Example2.properties
  68. +45 −0 src/main/resources/log4j.properties
  69. +7 −0 src/main/webapp/About.tml
  70. +7 −0 src/main/webapp/Contact.tml
  71. +107 −0 src/main/webapp/Index.tml
  72. +4 −0 src/main/webapp/WEB-INF/app.properties
  73. +7 −0 src/main/webapp/WEB-INF/appengine-web.xml
  74. +22 −0 src/main/webapp/WEB-INF/web.xml
  75. +101 −0 src/main/webapp/components/Grouping.tml
  76. +19 −0 src/main/webapp/components/accordion/Example1.tml
  77. +30 −0 src/main/webapp/components/accordion/Example2.tml
  78. +21 −0 src/main/webapp/components/accordion/Example3.tml
  79. +21 −0 src/main/webapp/components/accordion/Example4.tml
  80. +27 −0 src/main/webapp/components/accordion/Example5.tml
  81. +18 −0 src/main/webapp/components/ajaxLoader/Example1.tml
  82. +25 −0 src/main/webapp/components/ajaxLoader/Example2.tml
  83. +31 −0 src/main/webapp/components/ajaxLoader/Example3.tml
  84. +17 −0 src/main/webapp/components/border/Example1.tml
  85. +29 −0 src/main/webapp/components/colorPicker/Example1.tml
  86. +18 −0 src/main/webapp/components/dialog/Example1.tml
  87. +17 −0 src/main/webapp/components/dialog/Example2.tml
  88. +24 −0 src/main/webapp/components/dialog/Example3.tml
  89. +25 −0 src/main/webapp/components/dialog/Example4.tml
  90. +59 −0 src/main/webapp/components/exanpeSkin/Example1.tml
  91. +32 −0 src/main/webapp/components/hideablePanel/Example1.tml
  92. +34 −0 src/main/webapp/components/hideablePanel/Example2.tml
  93. +35 −0 src/main/webapp/components/securePassword/Example1.tml
  94. +20 −0 src/main/webapp/components/securePassword/Example2.tml
  95. +30 −0 src/main/webapp/components/securePassword/Example3.tml
  96. +74 −0 src/main/webapp/components/selectLoader/Example1.tml
  97. +33 −0 src/main/webapp/components/selectLoader/Example2.tml
  98. +29 −0 src/main/webapp/components/slider/Example1.tml
  99. +29 −0 src/main/webapp/components/slider/Example2.tml
  100. +29 −0 src/main/webapp/components/slider/Example3.tml
  101. +28 −0 src/main/webapp/components/slider/Example4.tml
  102. +30 −0 src/main/webapp/components/tabview/Example1.tml
  103. +31 −0 src/main/webapp/components/tabview/Example2.tml
  104. +36 −0 src/main/webapp/components/tabview/Example3.tml
  105. +44 −0 src/main/webapp/components/tabview/Example4.tml
  106. +30 −0 src/main/webapp/components/tooltip/Example1.tml
  107. +25 −0 src/main/webapp/components/tooltip/Example2.tml
  108. +26 −0 src/main/webapp/components/tooltip/Example3.tml
  109. +129 −0 src/main/webapp/css/github.css
  110. BIN src/main/webapp/favicon.ico
  111. BIN src/main/webapp/img/grouping/email_open.png
  112. BIN src/main/webapp/img/grouping/emails.png
  113. BIN src/main/webapp/img/grouping/information.png
  114. BIN src/main/webapp/img/tab/application.png
  115. BIN src/main/webapp/img/tab/comments.png
  116. BIN src/main/webapp/img/tab/email.png
  117. +2 −0 src/main/webapp/js/exanpe-demo.js
  118. +1 −0 src/main/webapp/js/highlight.js
  119. +36 −0 src/main/webapp/layout/highlight.css
  120. BIN src/main/webapp/layout/images/img01.jpg
  121. BIN src/main/webapp/layout/images/img02.jpg
  122. BIN src/main/webapp/layout/images/img03.jpg
  123. BIN src/main/webapp/layout/images/img04.jpg
  124. BIN src/main/webapp/layout/images/img05.gif
  125. BIN src/main/webapp/layout/images/img06.gif
  126. BIN src/main/webapp/layout/images/img07.gif
  127. BIN src/main/webapp/layout/images/img08.gif
  128. BIN src/main/webapp/layout/images/img09.gif
  129. BIN src/main/webapp/layout/images/img10.gif
  130. BIN src/main/webapp/layout/images/img11.gif
  131. BIN src/main/webapp/layout/images/img12.gif
  132. BIN src/main/webapp/layout/images/img13.gif
  133. BIN src/main/webapp/layout/images/img14.gif
  134. BIN src/main/webapp/layout/images/img15.gif
  135. BIN src/main/webapp/layout/images/img16.gif
  136. BIN src/main/webapp/layout/images/img17.gif
  137. BIN src/main/webapp/layout/images/img18.gif
  138. BIN src/main/webapp/layout/images/img19.gif
  139. BIN src/main/webapp/layout/images/img20.gif
  140. BIN src/main/webapp/layout/images/spacer.gif
  141. +340 −0 src/main/webapp/layout/layout.css
  142. +243 −0 src/main/webapp/layout/license.txt
  143. +9 −0 src/site/apt/index.apt
  144. +17 −0 src/site/site.xml
  145. +8 −0 src/test/conf/testng.xml
  146. +278 −0 src/test/conf/webdefault.xml
  147. +1 −0 src/test/java/PLACEHOLDER
  148. +1 −0 src/test/resources/PLACEHOLDER
7 .gitignore
@@ -0,0 +1,7 @@
+test-output
+bin
+.classpath
+.project
+.settings
+target
+.metadata
0 README
No changes.
149 pom.xml
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>exanpe-t5-demo</artifactId>
+ <groupId>fr.exanpe</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>exanpe-t5-demo</name>
+ <description>Showcase for exanpe-t5-lib project.</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>fr.exanpe</groupId>
+ <artifactId>exanpe-t5-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-core</artifactId>
+ <version>${tapestry-release-version}</version>
+ </dependency>
+ <!-- A dependency on either JUnit or TestNG is required, or the surefire
+ plugin (which runs the tests) will fail, preventing Maven from packaging
+ the WAR. Tapestry includes a large number of testing facilities designed
+ for use with TestNG (http://testng.org/), so it's recommended. -->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.12.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>2.5.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-test</artifactId>
+ <version>${tapestry-release-version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ </dependency>
+
+
+ <!-- Provided by the servlet container, but sometimes referenced in the
+ application code. -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <developers>
+ <developer>
+ <id>lguerin</id>
+ <name>Laurent Guerin</name>
+ <email>zlau.dreamcat@gmail.com</email>
+ </developer>
+ <developer>
+ <id>jmaupoux</id>
+ <name>Julien Maupoux</name>
+ <email>attonnnn@gmail.com</email>
+ </developer>
+ </developers>
+
+ <build>
+ <finalName>exanpe-t5-demo</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+
+ <!-- Run the application using "mvn jetty:run" -->
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.16</version>
+ <configuration>
+ <!-- Log to the console. -->
+ <requestLog implementation="org.mortbay.jetty.NCSARequestLog">
+ <!-- This doesn't do anything for Jetty, but is a workaround for a
+ Maven bug that prevents the requestLog from being set. -->
+ <append>true</append>
+ </requestLog>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>net.kindleit</groupId>
+ <artifactId>maven-gae-plugin</artifactId>
+ <version>0.8.4</version>
+ <configuration>
+ <serverId>gae</serverId>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>net.kindleit</groupId>
+ <artifactId>gae-runtime</artifactId>
+ <version>${gae.version}</version>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <pluginRepositories>
+
+ <!-- As above, this can be commented out when access to the snapshot version
+ of a Tapestry Maven plugin is not required. -->
+ <pluginRepository>
+ <id>apache-snapshots</id>
+ <url>http://repository.apache.org/snapshots/</url>
+ </pluginRepository>
+
+ </pluginRepositories>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <tapestry-release-version>5.2.6</tapestry-release-version>
+ <gae.version>1.5.1</gae.version>
+ </properties>
+</project>
41 src/main/java/fr/exanpe/t5/demo/components/ComponentDemoLayout.java
@@ -0,0 +1,41 @@
+package fr.exanpe.t5.demo.components;
+
+import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.Block;
+import org.apache.tapestry5.annotations.Import;
+import org.apache.tapestry5.annotations.Parameter;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.services.javascript.JavaScriptSupport;
+
+/**
+ * Layout component for pages of application exanpe-t5-demo.
+ */
+@Import(stylesheet="context:layout/layout.css")
+public class ComponentDemoLayout
+{
+
+ @Property
+ @Parameter(required = true, allowNull = false, defaultPrefix = BindingConstants.LITERAL)
+ private String title;
+
+ @Property
+ @Parameter
+ private Block description;
+
+ @Property
+ @Parameter
+ private Block code;
+
+ @Property
+ @Parameter
+ private Block javacode;
+
+ @Property
+ @Parameter
+ private Block notice;
+
+ @Inject
+ private JavaScriptSupport javaScriptSupport;
+
+}
16 src/main/java/fr/exanpe/t5/demo/components/HighlightBody.java
@@ -0,0 +1,16 @@
+package fr.exanpe.t5.demo.components;
+
+import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.annotations.Import;
+import org.apache.tapestry5.annotations.Parameter;
+import org.apache.tapestry5.annotations.Property;
+
+@Import(stylesheet="context:css/github.css", library={"context:js/highlight.js", "context:js/exanpe-demo.js"})
+public class HighlightBody {
+
+ @Property
+ @Parameter(defaultPrefix = BindingConstants.LITERAL, required = true, allowNull = false, value="xml")
+ private String type;
+
+
+}
48 src/main/java/fr/exanpe/t5/demo/components/HighlightTMLPage.java
@@ -0,0 +1,48 @@
+package fr.exanpe.t5.demo.components;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.PersistenceConstants;
+import org.apache.tapestry5.annotations.AfterRender;
+import org.apache.tapestry5.annotations.Import;
+import org.apache.tapestry5.annotations.Parameter;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SetupRender;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.services.RequestGlobals;
+
+@Import(stylesheet="context:css/github.css", library={"context:js/highlight.js", "context:js/exanpe-demo.js"})
+public class HighlightTMLPage {
+
+ @Property
+ @Parameter(defaultPrefix = BindingConstants.LITERAL, required = true, allowNull = false, value="<p:code>")
+ private String codeStart;
+
+ @Property
+ @Parameter(defaultPrefix = BindingConstants.LITERAL, required = true, allowNull = false, value="</p:code>")
+ private String codeEnd;
+
+ @Property
+ private String highlight;
+
+ @Inject
+ private RequestGlobals request;
+
+ @SetupRender
+ public void init() throws IOException{
+ InputStream stream = request.getHTTPServletRequest().getSession().getServletContext().getResourceAsStream("/"+request.getActivePageName()+".tml");
+
+ String s = IOUtils.toString(stream);
+
+ int start = s.indexOf(codeStart);
+ if(start == -1)
+ throw new IllegalStateException("The hightlight component requires a "+codeStart+" tag in the calling page");
+
+ highlight = s.substring(start+codeStart.length(), s.indexOf(codeEnd));
+ }
+
+}
44 src/main/java/fr/exanpe/t5/demo/components/Layout.java
@@ -0,0 +1,44 @@
+package fr.exanpe.t5.demo.components;
+
+import org.apache.tapestry5.*;
+import org.apache.tapestry5.annotations.*;
+import org.apache.tapestry5.ioc.annotations.*;
+import org.apache.tapestry5.BindingConstants;
+
+/**
+ * Layout component for pages of application exanpe-t5-demo.
+ */
+@Import(stylesheet="context:layout/layout.css")
+public class Layout
+{
+ /** The page title, for the <title> element and the <h1> element. */
+ @Property
+ @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
+ private String title;
+
+ @Property
+ private String pageName;
+
+ @Property
+ @Parameter(defaultPrefix = BindingConstants.LITERAL)
+ private String sidebarTitle;
+
+ @Property
+ @Parameter(defaultPrefix = BindingConstants.LITERAL)
+ private Block sidebar;
+
+ @Inject
+ private ComponentResources resources;
+
+ public String getClassForPageName()
+ {
+ return resources.getPageName().equalsIgnoreCase(pageName)
+ ? "current_page_item"
+ : null;
+ }
+
+ public String[] getPageNames()
+ {
+ return new String[] { "Index", "About", "Contact" };
+ }
+}
23 src/main/java/fr/exanpe/t5/demo/data/CountryEnum.java
@@ -0,0 +1,23 @@
+package fr.exanpe.t5.demo.data;
+
+import java.io.Serializable;
+
+public enum CountryEnum implements Serializable
+{
+ FRANCE(new String[]
+ { "Paris", "Lyon", "Marseille" }), UK(new String[]
+ { "London", "Liverpool", "Manchester" }), USA(new String[]
+ { "New York", "Washington", "Los Angeles", "San Francisco", "Miami" });
+
+ private final String[] cities;
+
+ private CountryEnum(String[] cities)
+ {
+ this.cities = cities;
+ }
+
+ public String[] getCities()
+ {
+ return cities;
+ }
+}
6 src/main/java/fr/exanpe/t5/demo/data/FranceCityEnum.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.data;
+
+public enum FranceCityEnum
+{
+ PARIS, LYON, NANTES;
+}
6 src/main/java/fr/exanpe/t5/demo/data/ThirdEnum.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.data;
+
+public enum ThirdEnum
+{
+ HOUSE, FLAT, CAVE;
+}
6 src/main/java/fr/exanpe/t5/demo/data/UKCityEnum.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.data;
+
+public enum UKCityEnum
+{
+ LONDON, MANCHESTER, LIVERPOOL;
+}
6 src/main/java/fr/exanpe/t5/demo/data/USACityEnum.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.data;
+
+public enum USACityEnum
+{
+ NEW_YORK, WASHINGTON, LOS_ANGELES, SAN_FRANCISCO, MIAMI;
+}
31 src/main/java/fr/exanpe/t5/demo/data/User.java
@@ -0,0 +1,31 @@
+package fr.exanpe.t5.demo.data;
+
+import org.apache.tapestry5.beaneditor.NonVisual;
+
+public class User
+{
+ @NonVisual
+ private long id;
+
+ private String firstName;
+
+ private String lastName;
+
+ private int age;
+
+ public long getId() { return id; }
+
+ public void setId(long id) { this.id = id; }
+
+ public String getFirstName() { return firstName; }
+
+ public void setFirstName(String firstName) { this.firstName = firstName; }
+
+ public String getLastName() { return lastName; }
+
+ public void setLastName(String lastName) { this.lastName = lastName; }
+
+ public int getAge() { return age; }
+
+ public void setAge(int age) { this.age = age; }
+}
73 src/main/java/fr/exanpe/t5/demo/grouping/Mail.java
@@ -0,0 +1,73 @@
+package fr.exanpe.t5.demo.grouping;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Mail implements Serializable
+{
+ private int id;
+ private String subject;
+ private String content;
+ private Date date;
+ private String from;
+
+ public Mail(int id, String subject, String content, Date date, String from)
+ {
+ this.id = id;
+ this.subject = subject;
+ this.content = content;
+ this.date = date;
+ this.from = from;
+ }
+
+ public int getId()
+ {
+ return id;
+ }
+
+ public void setId(int id)
+ {
+ this.id = id;
+ }
+
+ public String getSubject()
+ {
+ return subject;
+ }
+
+ public void setSubject(String subject)
+ {
+ this.subject = subject;
+ }
+
+ public String getContent()
+ {
+ return content;
+ }
+
+ public void setContent(String content)
+ {
+ this.content = content;
+ }
+
+ public Date getDate()
+ {
+ return date;
+ }
+
+ public void setDate(Date date)
+ {
+ this.date = date;
+ }
+
+ public String getFrom()
+ {
+ return from;
+ }
+
+ public void setFrom(String from)
+ {
+ this.from = from;
+ }
+
+}
59 src/main/java/fr/exanpe/t5/demo/grouping/MailboxSumUp.java
@@ -0,0 +1,59 @@
+package fr.exanpe.t5.demo.grouping;
+
+public class MailboxSumUp
+{
+ private int total;
+ private int unread;
+ private int sent;
+ private int deleted;
+
+ public MailboxSumUp(int total, int unread, int sent, int deleted)
+ {
+ super();
+ this.total = total;
+ this.unread = unread;
+ this.sent = sent;
+ this.deleted = deleted;
+ }
+
+ public int getTotal()
+ {
+ return total;
+ }
+
+ public void setTotal(int total)
+ {
+ this.total = total;
+ }
+
+ public int getUnread()
+ {
+ return unread;
+ }
+
+ public void setUnread(int unread)
+ {
+ this.unread = unread;
+ }
+
+ public int getSent()
+ {
+ return sent;
+ }
+
+ public void setSent(int sent)
+ {
+ this.sent = sent;
+ }
+
+ public int getDeleted()
+ {
+ return deleted;
+ }
+
+ public void setDeleted(int deleted)
+ {
+ this.deleted = deleted;
+ }
+
+}
6 src/main/java/fr/exanpe/t5/demo/pages/About.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.pages;
+
+public class About
+{
+
+}
6 src/main/java/fr/exanpe/t5/demo/pages/Contact.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.pages;
+
+public class Contact
+{
+
+}
10 src/main/java/fr/exanpe/t5/demo/pages/Index.java
@@ -0,0 +1,10 @@
+package fr.exanpe.t5.demo.pages;
+
+
+/**
+ * Start page of application exanpe-t5-demo.
+ */
+public class Index
+{
+
+}
99 src/main/java/fr/exanpe/t5/demo/pages/components/Grouping.java
@@ -0,0 +1,99 @@
+package fr.exanpe.t5.demo.pages.components;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.tapestry5.EventConstants;
+import org.apache.tapestry5.annotations.Component;
+import org.apache.tapestry5.annotations.OnEvent;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.ioc.annotations.Inject;
+
+import fr.exanpe.t5.demo.grouping.Mail;
+import fr.exanpe.t5.demo.grouping.MailboxSumUp;
+import fr.exanpe.t5.demo.services.MailboxService;
+import fr.exanpe.t5.lib.components.TabView;
+
+public class Grouping
+{
+ @Property
+ private MailboxSumUp sumUp;
+
+ @Property
+ @Persist
+ private List<Mail> mailsOpen;
+
+ @Property
+ @Persist
+ private List<Mail> mailsReceived;
+
+ @Property
+ private Mail iteMail;
+
+ @Inject
+ private MailboxService service;
+
+ @Component(id = "tabview")
+ private TabView tabView;
+
+ void onActivate()
+ {
+ sumUp = service.getSumUp();
+ }
+
+ @OnEvent(value = EventConstants.ACTION, component = "received")
+ void initReceivedMails()
+ {
+ mailsReceived = service.getMailsReceived();
+ tabView.setSelectedTab("tabReceived");
+ }
+
+ void onActionFromOpen(int mailId)
+ {
+ if (mailsOpen == null)
+ mailsOpen = new LinkedList<Mail>();
+
+ for (Mail m : mailsReceived)
+ if (m.getId() == mailId)
+ {
+ mailsOpen.add(m);
+ break;
+ }
+ }
+
+ void onActionFromClose(int mailId)
+ {
+ if (mailsOpen == null)
+ return;
+
+ for (Mail m : mailsReceived)
+ if (m.getId() == mailId)
+ {
+ mailsOpen.remove(m);
+ break;
+ }
+ tabView.setSelectedTab("tabReceived");
+ }
+
+ public String getShortenedSubject()
+ {
+ if (iteMail.getSubject().length() > 20)
+ return iteMail.getSubject().substring(0, 20) + "...";
+ return iteMail.getSubject();
+ }
+
+ public String getShortenedContent()
+ {
+ if (iteMail.getContent().length() > 40)
+ return iteMail.getContent().substring(0, 40) + "...";
+ return iteMail.getContent();
+ }
+
+ public String getShortenedFrom()
+ {
+ if (iteMail.getFrom().length() > 20)
+ return iteMail.getFrom().substring(0, 20) + "...";
+ return iteMail.getFrom();
+ }
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example1.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.accordion;
+
+public class Example1 {
+
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example2.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.accordion;
+
+public class Example2 {
+
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example3.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.accordion;
+
+public class Example3 {
+
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example4.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.accordion;
+
+public class Example4 {
+
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/accordion/Example5.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.accordion;
+
+public class Example5 {
+
+}
21 src/main/java/fr/exanpe/t5/demo/pages/components/ajaxLoader/Example1.java
@@ -0,0 +1,21 @@
+package fr.exanpe.t5.demo.pages.components.ajaxLoader;
+
+public class Example1
+{
+
+ public String getSleep()
+ {
+ try
+ {
+ Thread.currentThread().sleep(2000);
+ }
+ catch (InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return "";
+ }
+
+}
21 src/main/java/fr/exanpe/t5/demo/pages/components/ajaxLoader/Example2.java
@@ -0,0 +1,21 @@
+package fr.exanpe.t5.demo.pages.components.ajaxLoader;
+
+public class Example2
+{
+
+ public String getSleep()
+ {
+ try
+ {
+ Thread.currentThread().sleep(2000);
+ }
+ catch (InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return "";
+ }
+
+}
19 src/main/java/fr/exanpe/t5/demo/pages/components/ajaxLoader/Example3.java
@@ -0,0 +1,19 @@
+package fr.exanpe.t5.demo.pages.components.ajaxLoader;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.apache.tapestry5.annotations.Property;
+
+public class Example3
+{
+
+ @Property
+ private String date;
+
+ public void onActivate()
+ {
+ date = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss").format(new Date());
+ }
+
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/border/Example1.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.border;
+
+public class Example1 {
+
+}
13 src/main/java/fr/exanpe/t5/demo/pages/components/colorPicker/Example1.java
@@ -0,0 +1,13 @@
+package fr.exanpe.t5.demo.pages.components.colorPicker;
+
+import java.awt.Color;
+
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+
+public class Example1
+{
+ @Property
+ @Persist
+ private Color color;
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/dialog/Example1.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.dialog;
+
+public class Example1 {
+
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/dialog/Example2.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.dialog;
+
+public class Example2 {
+
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/dialog/Example3.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.dialog;
+
+public class Example3 {
+
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/dialog/Example4.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.dialog;
+
+public class Example4 {
+
+}
68 src/main/java/fr/exanpe/t5/demo/pages/components/exanpeSkin/Example1.java
@@ -0,0 +1,68 @@
+package fr.exanpe.t5.demo.pages.components.exanpeSkin;
+
+import java.util.List;
+
+import org.apache.tapestry5.SelectModel;
+import org.apache.tapestry5.ValueEncoder;
+import org.apache.tapestry5.annotations.Import;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SetupRender;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.util.EnumSelectModel;
+import org.apache.tapestry5.util.EnumValueEncoder;
+
+import fr.exanpe.t5.demo.data.User;
+import fr.exanpe.t5.demo.services.DataService;
+
+@Import(stylesheet = "${exanpe.asset-base}/css/exanpe-t5-lib-skin.css")
+public class Example1
+{
+ @Inject
+ private DataService dataService;
+
+ @Inject
+ private Messages messages;
+
+ /** GRID **/
+ @Property
+ private List<User> users;
+
+ @Property
+ private User iteUser;
+
+ /** Auto Complete **/
+ @Property
+ private String country;
+
+ public List<String> onProvideCompletionsFromCountryName(String partial)
+ {
+ return dataService.getListOfString();
+ }
+
+ /** Palette **/
+
+ @Property
+ private final ValueEncoder<PaletteEnum> encoder = new EnumValueEncoder(PaletteEnum.class);
+
+ @Property
+ private final SelectModel model = new EnumSelectModel(PaletteEnum.class, messages);
+
+ @Property
+ private List<PaletteEnum> selected;
+
+ public enum PaletteEnum
+ {
+ TEST, TEST2, TEST3, TEST4;
+ }
+
+ /** BeanEditor */
+ @Property
+ private User userEdit;
+
+ @SetupRender
+ public void init()
+ {
+ users = dataService.getListUsers();
+ }
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/hideablePanel/Example1.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.hideablePanel;
+
+public class Example1 {
+
+}
5 src/main/java/fr/exanpe/t5/demo/pages/components/hideablePanel/Example2.java
@@ -0,0 +1,5 @@
+package fr.exanpe.t5.demo.pages.components.hideablePanel;
+
+public class Example2 {
+
+}
21 src/main/java/fr/exanpe/t5/demo/pages/components/securePassword/Example1.java
@@ -0,0 +1,21 @@
+package fr.exanpe.t5.demo.pages.components.securePassword;
+
+import org.apache.tapestry5.PersistenceConstants;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+
+public class Example1
+{
+ @Property
+ private String passwordValue;
+
+ @Persist(PersistenceConstants.FLASH)
+ @Property
+ private String val;
+
+ void onSubmit()
+ {
+ val = passwordValue;
+ }
+
+}
21 src/main/java/fr/exanpe/t5/demo/pages/components/securePassword/Example2.java
@@ -0,0 +1,21 @@
+package fr.exanpe.t5.demo.pages.components.securePassword;
+
+import org.apache.tapestry5.PersistenceConstants;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+
+public class Example2
+{
+ @Property
+ private String passwordValue;
+
+ @Persist(PersistenceConstants.FLASH)
+ @Property
+ private String val;
+
+ void onSubmit()
+ {
+ val = passwordValue;
+ }
+
+}
17 src/main/java/fr/exanpe/t5/demo/pages/components/securePassword/Example3.java
@@ -0,0 +1,17 @@
+package fr.exanpe.t5.demo.pages.components.securePassword;
+
+import org.apache.tapestry5.PersistenceConstants;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+
+public class Example3
+{
+ @Persist(PersistenceConstants.FLASH)
+ @Property
+ private String passwordValue;
+
+ void onSubmit()
+ {
+ }
+
+}
85 src/main/java/fr/exanpe/t5/demo/pages/components/selectLoader/Example1.java
@@ -0,0 +1,85 @@
+package fr.exanpe.t5.demo.pages.components.selectLoader;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.tapestry5.OptionModel;
+import org.apache.tapestry5.PersistenceConstants;
+import org.apache.tapestry5.SelectModel;
+import org.apache.tapestry5.ValueEncoder;
+import org.apache.tapestry5.annotations.OnEvent;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SetupRender;
+import org.apache.tapestry5.internal.OptionModelImpl;
+import org.apache.tapestry5.internal.SelectModelImpl;
+import org.apache.tapestry5.internal.services.EnumValueEncoderFactory;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.util.EnumSelectModel;
+
+import fr.exanpe.t5.demo.data.CountryEnum;
+import fr.exanpe.t5.demo.services.DataService;
+import fr.exanpe.t5.lib.constants.ExanpeEventConstants;
+
+public class Example1
+{
+ @Inject
+ private DataService dataService;
+
+ @Inject
+ private Messages messages;
+
+ @Property
+ private ValueEncoder<CountryEnum> countryEncoder = new EnumValueEncoderFactory().create(CountryEnum.class);
+
+ @Property
+ private SelectModel country;
+
+ @Property
+ @Persist(PersistenceConstants.FLASH)
+ private CountryEnum countryValue;
+
+ @Property
+ private SelectModel city;
+
+ @Property
+ @Persist(PersistenceConstants.FLASH)
+ private String cityValue;
+
+ @SetupRender
+ public void ini()
+ {
+ country = new EnumSelectModel(CountryEnum.class, messages);
+ loadCountrySelect();
+ }
+
+ public void onSubmit()
+ {
+ loadCountrySelect();
+ }
+
+ private void loadCountrySelect()
+ {
+ if (countryValue == null)
+ city = new SelectModelImpl(new OptionModelImpl[0]);
+ else
+ city = populateSelect(countryValue.toString());
+ }
+
+ @OnEvent(value = ExanpeEventConstants.SELECTLOADER_EVENT)
+ public SelectModel populateSelect(String value)
+ {
+ if (StringUtils.isEmpty(value))
+ return null;
+
+ String[] cities = dataService.getCitiesFromCountry(CountryEnum.valueOf(value));
+
+ OptionModel[] om = new OptionModel[cities.length];
+
+ for (int i = 0; i < cities.length; i++)
+ om[i] = new OptionModelImpl(cities[i]);
+
+ city = new SelectModelImpl(om);
+
+ return city;
+ }
+}
147 src/main/java/fr/exanpe/t5/demo/pages/components/selectLoader/Example2.java
@@ -0,0 +1,147 @@
+package fr.exanpe.t5.demo.pages.components.selectLoader;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.tapestry5.OptionModel;
+import org.apache.tapestry5.PersistenceConstants;
+import org.apache.tapestry5.SelectModel;
+import org.apache.tapestry5.ValueEncoder;
+import org.apache.tapestry5.annotations.OnEvent;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SetupRender;
+import org.apache.tapestry5.internal.OptionModelImpl;
+import org.apache.tapestry5.internal.SelectModelImpl;
+import org.apache.tapestry5.internal.services.EnumValueEncoderFactory;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.util.EnumSelectModel;
+
+import fr.exanpe.t5.demo.data.CountryEnum;
+import fr.exanpe.t5.demo.data.ThirdEnum;
+import fr.exanpe.t5.demo.services.DataService;
+import fr.exanpe.t5.lib.constants.ExanpeEventConstants;
+
+public class Example2
+{
+ @Inject
+ private DataService dataService;
+
+ @Inject
+ private Messages messages;
+
+ @Property
+ private ValueEncoder<CountryEnum> countryEncoder = new EnumValueEncoderFactory().create(CountryEnum.class);
+
+ @Property
+ private SelectModel country;
+
+ @Property
+ private SelectModel city;
+
+ @Property
+ private SelectModel type;
+
+ @Property
+ @Persist(PersistenceConstants.FLASH)
+ private CountryEnum countryValue;
+
+ @Property
+ @Persist(PersistenceConstants.FLASH)
+ private String cityValue;
+
+ @Property
+ @Persist(PersistenceConstants.FLASH)
+ private String typeValue;
+
+ @SetupRender
+ public void ini()
+ {
+ country = new EnumSelectModel(CountryEnum.class, messages);
+ loadCitySelect();
+ loadTypeSelect();
+
+ }
+
+ private void loadCitySelect()
+ {
+ if (countryValue == null)
+ city = new SelectModelImpl(new OptionModelImpl[0]);
+ else
+ {
+ List<OptionModel> opts = createCityOpt(countryValue.toString());
+ OptionModel[] om = new OptionModel[opts.size()];
+ city = new SelectModelImpl((OptionModel[]) opts.toArray(om));
+ }
+ }
+
+ private void loadTypeSelect()
+ {
+ if (cityValue == null)
+ type = new SelectModelImpl(new OptionModelImpl[0]);
+ else
+ {
+ List<OptionModel> opts = createTypeOpt(cityValue.toString());
+ OptionModel[] om = new OptionModel[opts.size()];
+ type = new SelectModelImpl((OptionModel[]) opts.toArray(om));
+ }
+ }
+
+ public void onSubmit()
+ {
+
+ }
+
+ private List<OptionModel> createCityOpt(String value)
+ {
+ if (StringUtils.isEmpty(value))
+ return null;
+
+ List<OptionModel> opts = new ArrayList<OptionModel>();
+
+ String[] cities = dataService.getCitiesFromCountry(CountryEnum.valueOf(value));
+
+ for (int i = 0; i < cities.length; i++)
+ opts.add(new OptionModelImpl(cities[i]));
+
+ return opts;
+ }
+
+ private List<OptionModel> createTypeOpt(String value)
+ {
+ if (StringUtils.isEmpty(value))
+ return null;
+
+ ThirdEnum[] te = ThirdEnum.values();
+
+ List<OptionModel> opts = new ArrayList<OptionModel>(3);
+
+ for (int i = 0; i < te.length; i++)
+ opts.add(new OptionModelImpl(te[i].toString()));
+
+ return opts;
+ }
+
+ @OnEvent(value = ExanpeEventConstants.SELECTLOADER_EVENT, component = "country")
+ public SelectModel populateSelectCity(String value)
+ {
+ List<OptionModel> opts = createCityOpt(value);
+ opts.add(0, new OptionModelImpl(" ", " "));
+
+ OptionModel[] om = new OptionModel[opts.size()];
+
+ return new SelectModelImpl((OptionModel[]) opts.toArray(om));
+ }
+
+ @OnEvent(value = ExanpeEventConstants.SELECTLOADER_EVENT, component = "city")
+ public SelectModel populateSelectType(String value)
+ {
+ List<OptionModel> opts = createTypeOpt(value);
+
+ OptionModel[] om = new OptionModel[opts.size()];
+
+ return new SelectModelImpl((OptionModel[]) opts.toArray(om));
+ }
+}
11 src/main/java/fr/exanpe/t5/demo/pages/components/slider/Example1.java
@@ -0,0 +1,11 @@
+package fr.exanpe.t5.demo.pages.components.slider;
+
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+
+public class Example1
+{
+ @Property
+ @Persist
+ private int sliderValue;
+}
11 src/main/java/fr/exanpe/t5/demo/pages/components/slider/Example2.java
@@ -0,0 +1,11 @@
+package fr.exanpe.t5.demo.pages.components.slider;
+
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+
+public class Example2
+{
+ @Property
+ @Persist
+ private float sliderValue;
+}
11 src/main/java/fr/exanpe/t5/demo/pages/components/slider/Example3.java
@@ -0,0 +1,11 @@
+package fr.exanpe.t5.demo.pages.components.slider;
+
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+
+public class Example3
+{
+ @Property
+ @Persist
+ private int sliderValue;
+}
11 src/main/java/fr/exanpe/t5/demo/pages/components/slider/Example4.java
@@ -0,0 +1,11 @@
+package fr.exanpe.t5.demo.pages.components.slider;
+
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+
+public class Example4
+{
+ @Property
+ @Persist
+ private int sliderValue;
+}
6 src/main/java/fr/exanpe/t5/demo/pages/components/tabview/Example1.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.pages.components.tabview;
+
+public class Example1
+{
+
+}
6 src/main/java/fr/exanpe/t5/demo/pages/components/tabview/Example2.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.pages.components.tabview;
+
+public class Example2
+{
+
+}
6 src/main/java/fr/exanpe/t5/demo/pages/components/tabview/Example3.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.pages.components.tabview;
+
+public class Example3
+{
+
+}
20 src/main/java/fr/exanpe/t5/demo/pages/components/tabview/Example4.java
@@ -0,0 +1,20 @@
+package fr.exanpe.t5.demo.pages.components.tabview;
+
+import org.apache.tapestry5.annotations.Component;
+import org.apache.tapestry5.annotations.Property;
+
+import fr.exanpe.t5.lib.components.TabView;
+
+public class Example4
+{
+ @Component(id = "tabv")
+ private TabView tabView;
+
+ @Property
+ private String defaultTab = "tab2";
+
+ public void onActionFromSetThird()
+ {
+ tabView.setSelectedTab("tab3");
+ }
+}
6 src/main/java/fr/exanpe/t5/demo/pages/components/tooltip/Example1.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.pages.components.tooltip;
+
+public class Example1
+{
+
+}
6 src/main/java/fr/exanpe/t5/demo/pages/components/tooltip/Example2.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.pages.components.tooltip;
+
+public class Example2
+{
+
+}
6 src/main/java/fr/exanpe/t5/demo/pages/components/tooltip/Example3.java
@@ -0,0 +1,6 @@
+package fr.exanpe.t5.demo.pages.components.tooltip;
+
+public class Example3
+{
+
+}
148 src/main/java/fr/exanpe/t5/demo/services/AppModule.java
@@ -0,0 +1,148 @@
+package fr.exanpe.t5.demo.services;
+
+import java.io.IOException;
+
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.ioc.Configuration;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+import org.apache.tapestry5.ioc.OrderedConfiguration;
+import org.apache.tapestry5.ioc.ServiceBinder;
+import org.apache.tapestry5.ioc.annotations.Local;
+import org.apache.tapestry5.ioc.annotations.SubModule;
+import org.apache.tapestry5.ioc.services.Coercion;
+import org.apache.tapestry5.ioc.services.CoercionTuple;
+import org.apache.tapestry5.services.Request;
+import org.apache.tapestry5.services.RequestFilter;
+import org.apache.tapestry5.services.RequestHandler;
+import org.apache.tapestry5.services.Response;
+import org.apache.tapestry5.util.StringToEnumCoercion;
+import org.slf4j.Logger;
+
+import fr.exanpe.t5.demo.data.CountryEnum;
+import fr.exanpe.t5.demo.data.FranceCityEnum;
+import fr.exanpe.t5.demo.data.ThirdEnum;
+import fr.exanpe.t5.lib.services.ExanpeLibraryModule;
+
+/**
+ * This module is automatically included as part of the Tapestry IoC Registry, it's a good place to
+ * configure and extend Tapestry, or to place your own service definitions.
+ */
+@SubModule(ExanpeLibraryModule.class)
+public class AppModule
+{
+ public static void bind(ServiceBinder binder)
+ {
+ // binder.bind(MyServiceInterface.class, MyServiceImpl.class);
+
+ // Make bind() calls on the binder object to define most IoC services.
+ // Use service builder methods (example below) when the implementation
+ // is provided inline, or requires more initialization than simply
+ // invoking the constructor.
+ binder.bind(DataService.class, DataService.class);
+ binder.bind(MailboxService.class, MailboxService.class);
+ }
+
+ public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration)
+ {
+ // Contributions to ApplicationDefaults will override any contributions to
+ // FactoryDefaults (with the same key). Here we're restricting the supported
+ // locales to just "en" (English). As you add localised message catalogs and other assets,
+ // you can extend this list of locales (it's a comma separated series of locale names;
+ // the first locale name is the default when there's no reasonable match).
+
+ configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
+
+ // The factory default is true but during the early stages of an application
+ // overriding to false is a good idea. In addition, this is often overridden
+ // on the command line as -Dtapestry.production-mode=false
+ configuration.add(SymbolConstants.PRODUCTION_MODE, "true");
+
+ // The application version number is incorprated into URLs for some
+ // assets. Web browsers will cache assets because of the far future expires
+ // header. If existing assets are changed, the version number should also
+ // change, to force the browser to download new versions.
+ configuration.add(SymbolConstants.APPLICATION_VERSION, "1.0.0-SNAPSHOT");
+ }
+
+ /**
+ * This is a service definition, the service will be named "TimingFilter". The interface,
+ * RequestFilter, is used within the RequestHandler service pipeline, which is built from the
+ * RequestHandler service configuration. Tapestry IoC is responsible for passing in an
+ * appropriate Logger instance. Requests for static resources are handled at a higher level, so
+ * this filter will only be invoked for Tapestry related requests.
+ * <p>
+ * Service builder methods are useful when the implementation is inline as an inner class (as
+ * here) or require some other kind of special initialization. In most cases, use the static
+ * bind() method instead.
+ * <p>
+ * If this method was named "build", then the service id would be taken from the service
+ * interface and would be "RequestFilter". Since Tapestry already defines a service named
+ * "RequestFilter" we use an explicit service id that we can reference inside the contribution
+ * method.
+ */
+ public RequestFilter buildTimingFilter(final Logger log)
+ {
+ return new RequestFilter()
+ {
+ public boolean service(Request request, Response response, RequestHandler handler) throws IOException
+ {
+ long startTime = System.currentTimeMillis();
+
+ try
+ {
+ // The responsibility of a filter is to invoke the corresponding method
+ // in the handler. When you chain multiple filters together, each filter
+ // received a handler that is a bridge to the next filter.
+
+ return handler.service(request, response);
+ }
+ finally
+ {
+ long elapsed = System.currentTimeMillis() - startTime;
+
+ log.info(String.format("Request time: %d ms", elapsed));
+ }
+ }
+ };
+ }
+
+ /**
+ * This is a contribution to the RequestHandler service configuration. This is how we extend
+ * Tapestry using the timing filter. A common use for this kind of filter is transaction
+ * management or security. The @Local annotation selects the desired service by type, but only
+ * from the same module. Without @Local, there would be an error due to the other service(s)
+ * that implement RequestFilter (defined in other modules).
+ */
+ public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration, @Local
+ RequestFilter filter)
+ {
+ // Each contribution to an ordered configuration has a name, When necessary, you may
+ // set constraints to precisely control the invocation order of the contributed filter
+ // within the pipeline.
+
+ configuration.add("Timing", filter);
+ }
+
+ public static void contributeTypeCoercer(@SuppressWarnings("rawtypes")
+ Configuration<CoercionTuple> configuration)
+ {
+ configuration.add(CoercionTuple.create(String.class, CountryEnum.class, StringToEnumCoercion.create(CountryEnum.class)));
+ configuration.add(CoercionTuple.create(String.class, FranceCityEnum.class, StringToEnumCoercion.create(FranceCityEnum.class)));
+ configuration.add(CoercionTuple.create(String.class, ThirdEnum.class, StringToEnumCoercion.create(ThirdEnum.class)));
+ // configuration.add(CoercionTuple.create(String.class, CountryEnum.class,
+ // StringToEnumCoercion.create(CountryEnum.class)));
+ // configuration.add(CoercionTuple.create(String.class, CountryEnum.class,
+ // StringToEnumCoercion.create(CountryEnum.class)));
+
+ Coercion<CountryEnum, String> countryEnum = new Coercion<CountryEnum, String>()
+ {
+ public String coerce(CountryEnum input)
+ {
+ return input.toString();
+ }
+ };
+
+ configuration.add(new CoercionTuple<CountryEnum, String>(CountryEnum.class, String.class, countryEnum));
+ }
+
+}
46 src/main/java/fr/exanpe/t5/demo/services/DataService.java
@@ -0,0 +1,46 @@
+package fr.exanpe.t5.demo.services;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import fr.exanpe.t5.demo.data.CountryEnum;
+import fr.exanpe.t5.demo.data.User;
+
+public class DataService
+{
+
+ private User createUser(int id, String name, String firstName, int age)
+ {
+ User u = new User();
+ u.setId(id);
+ u.setLastName(name);
+ u.setFirstName(firstName);
+ u.setAge(age);
+ return u;
+ }
+
+ public List<User> getListUsers()
+ {
+ List<User> users = new ArrayList<User>();
+
+ for (int i = 0; i < 50; i++)
+ users.add(createUser(i, "Name " + i, "First Name " + i, 20 + i));
+
+ return users;
+ }
+
+ public List<String> getListOfString()
+ {
+ List<String> list = new ArrayList<String>();
+
+ for (int i = 0; i < 30; i++)
+ list.add("Hello World " + i);
+
+ return list;
+ }
+
+ public String[] getCitiesFromCountry(CountryEnum e)
+ {
+ return e.getCities();
+ }
+}
30 src/main/java/fr/exanpe/t5/demo/services/MailboxService.java
@@ -0,0 +1,30 @@
+package fr.exanpe.t5.demo.services;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import fr.exanpe.t5.demo.grouping.Mail;
+import fr.exanpe.t5.demo.grouping.MailboxSumUp;
+
+public class MailboxService
+{
+ private static final int NB_MAIL_RECEIVED = 32;
+
+ public MailboxSumUp getSumUp()
+ {
+ return new MailboxSumUp(NB_MAIL_RECEIVED, 4, 12, 120);
+ }
+
+ public List<Mail> getMailsReceived()
+ {
+ List<Mail> list = new ArrayList<Mail>(NB_MAIL_RECEIVED);
+
+ for (int i = 1; i < NB_MAIL_RECEIVED + 1; i++)
+ list.add(new Mail(i, "Subject " + i,
+ "Hey what's up ! \n This representents a mail content. No real interest writing a new one everytime ! Just to notice this is the mail number "
+ + i, new Date(), "sender" + i + "@mail.com"));
+
+ return list;
+ }
+}
46 src/main/resources/fr/exanpe/t5/demo/components/ComponentDemoLayout.tml
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html t:type="layout" title="prop:title"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter">
+
+ <div class="description">
+ Description
+ </div>
+ <t:delegate to="description"/>
+ <br/><br/><br/>
+
+ <t:if test="code">
+ <div class="inaction">
+ In Action
+ </div>
+ <t:delegate to="code"/>
+ <br/><br/><br/>
+
+ <div class="tmlSource">
+ TML Source code
+ </div>
+ <t:highlightTMLPage/>
+ <br/><br/><br/>
+ </t:if>
+
+ <t:body/>
+
+ <t:if test="javacode">
+ <div class="javacode">
+ Java code
+ </div>
+ <t:highlightBody type="java">
+ <t:delegate to="javacode"/>
+ </t:highlightBody>
+ <br/>
+ </t:if>
+
+ <t:if test="notice">
+ <div class="notice">
+ Notice
+ </div>
+ <t:delegate to="notice"/>
+ <br/>
+ </t:if>
+
+</html>
10 src/main/resources/fr/exanpe/t5/demo/components/HighlightBody.tml
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
+ <div class="${type}">
+ <pre>
+ <code>
+ <t:body/>
+ </code>
+ </pre>
+ </div>
+</t:container>
8 src/main/resources/fr/exanpe/t5/demo/components/HighlightTMLPage.tml
@@ -0,0 +1,8 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
+ <div class="xml">
+ <pre>
+ <code>${highlight}</code>
+ </pre>
+ </div>
+</t:container>
68 src/main/resources/fr/exanpe/t5/demo/components/Layout.tml
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--
+
+Design by Free CSS Templates
+http://www.freecsstemplates.org
+Released for free under a Creative Commons Attribution 2.5 License
+
+Title : Concrete
+Version : 1.0
+Released : 20080825
+Description: A Web 2.0 design with fluid width suitable for blogs and small websites.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <title>${title}</title>
+ </head>
+ <body>
+ <!-- start header -->
+ <div id="header">
+ <div id="logo">
+ <h1>
+ <t:pagelink page="index">fr.exanpe:exanpe-t5-demo</t:pagelink>
+ </h1>
+ </div>
+ <div id="menu">
+ <ul>
+ <li t:type="loop" source="pageNames" value="pageName" class="prop:classForPageName">
+ <t:pagelink page="prop:pageName">${pageName}</t:pagelink>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <!-- end header -->
+ <!-- start page -->
+ <div id="page">
+ <!-- start content -->
+ <div id="content">
+ <div class="post">
+ <div class="title">
+ <h2>${title}</h2>
+ </div>
+ <div class="entry">
+ <t:body/>
+ </div>
+ </div>
+ </div>
+ <!-- end content -->
+ <br style="clear: both;"/>
+ </div>
+ <!-- end page -->
+ <!-- start footer -->
+ <div id="footer">
+ <p class="legal">
+ &copy;2009 fr.exanpe. All Rights Reserved.
+ &nbsp;&nbsp;&bull;&nbsp;&nbsp;
+ Design by
+ <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>
+ &nbsp;&nbsp;&bull;&nbsp;&nbsp;
+ Icons by
+ <a href="http://famfamfam.com/">FAMFAMFAM</a>.
+ </p>
+ </div>
+ <!-- end footer -->
+ </body>
+</html>
22 src/main/resources/fr/exanpe/t5/demo/pages/components/Grouping.properties
@@ -0,0 +1,22 @@
+cat-title=Webmail
+
+mail-title=Mailbox
+calendar-title=Calendar
+calendar-content=Not implemented
+tasks-title=Tasks
+tasks-content=Not implemented
+
+receivedLink=Received
+sentLink=Sent
+deletedLink=Deleted
+
+tabpres-title=Presentation
+tabpres-icon=context:/img/grouping/information.png
+
+tabReceived-title=Received
+tabReceived-icon=context:/img/grouping/emails.png
+
+showInTab-label=Show in new tab
+
+not-implemented=This action is not implemented
+not-implemented-title=Sorry !
6 src/main/resources/fr/exanpe/t5/demo/pages/components/accordion/Example2.properties
@@ -0,0 +1,6 @@
+item1-title=Title of item 1
+item2-title=Title of item 2
+
+item1-content=Content of item 1
+item2-content=Content of item 2
+
1 src/main/resources/fr/exanpe/t5/demo/pages/components/ajaxLoader/Example2.properties
@@ -0,0 +1 @@
+please-wait=Please wait...
2 src/main/resources/fr/exanpe/t5/demo/pages/components/dialog/Example3.properties
@@ -0,0 +1,2 @@
+dialogtitle=Information
+dialogmessage=This link is currently not active
2 src/main/resources/fr/exanpe/t5/demo/pages/components/dialog/Example4.properties
@@ -0,0 +1,2 @@
+link1-title=Information
+link1-message=This link is currently not active
5 src/main/resources/fr/exanpe/t5/demo/pages/components/tabview/Example3.properties
@@ -0,0 +1,5 @@
+tab1-title=Title of tab 1
+tab1-icon=context:/img/tab/application.png
+
+tab2-title=Title of tab 2
+tab2-icon=context:/img/tab/comments.png
1 src/main/resources/fr/exanpe/t5/demo/pages/components/tooltip/Example1.properties
@@ -0,0 +1 @@
+tooltip-message-example=Do you see me ?
1 src/main/resources/fr/exanpe/t5/demo/pages/components/tooltip/Example2.properties
@@ -0,0 +1 @@
+tooltip-tooltip=This is the tooltip content
45 src/main/resources/log4j.properties
@@ -0,0 +1,45 @@
+# Default to info level output; this is very handy if you eventually use Hibernate as well.
+log4j.rootCategory=info, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=[%p] %c{2} %m%n
+
+# Service category names are the name of the defining module class
+# and then the service id.
+log4j.category.fr.exanpe.t5.demo.services.AppModule.TimingFilter=info
+
+# Outputs a list of pages, components and mixins at startup.
+log4j.category.org.apache.tapestry5.services.TapestryModule.ComponentClassResolver=info
+
+# Outputs startup statistics; elapsed time to setup and initialize the registry, and a list of
+# available services.
+log4j.category.org.apache.tapestry5.TapestryFilter=info
+#log4j.category.fr.exanpe.t5.lib=debug
+
+
+# Turning on debug mode for a page's or component's transformer logger
+# will show all of the code changes that occur when the
+# class is loaded.
+
+# log4j.category.tapestry.transformer.fr.exanpe.t5.demo.pages.Index=debug
+
+# Turning on debug mode for a component's events logger will show all the events triggered on the
+# component, and which component methods are invoked as a result.
+
+# log4j.category.tapestry.events.fr.exanpe.t5.demo.pages.Index=debug
+
+# Turning on trace mode for a page's render logger provides extended information about every step
+# in rendering (this is not generally helpful). Turning on debug mode will add a one-line
+# summary that includes the elapsed render time, which can be useful in tracking down
+# performance issues.
+
+# log4j.category.tapestry.render.fr.exanpe.t5.demo.pages.Index=debug
+
+# Turn on some verbose debugging about everything in the application. This is nice initially,
+# while getting everything set up. You'll probably want to remove this once you are
+# up and running, replacing it with more selective debugging output.
+log4j.category.fr.exanpe.t5.demo=debug
7 src/main/webapp/About.tml
@@ -0,0 +1,7 @@
+<html t:type="layout" title="About exanpe-t5-demo"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter">
+
+ <p>About exanpe-t5-demo application ...</p>
+
+</html>
7 src/main/webapp/Contact.tml
@@ -0,0 +1,7 @@
+<html t:type="layout" title="Contact fr.exanpe"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter">
+
+ <p>Contact fr.exanpe ...</p>
+
+</html>
107 src/main/webapp/Index.tml
@@ -0,0 +1,107 @@
+<html t:type="layout" title="exanpe-t5-demo Index"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter">
+ <!-- Most of the page content, including <head>, <body>, etc. tags, comes from Layout.tml -->
+
+ <p>
+ <b>Welcome to the Exanpe T5 lib Demo !</b> <br/>
+ This application have been created to show the components in action and help you get on with them by displaying some samples of code for every component's use case.</p>
+ Here are the components in action: <br/><br/>
+
+ <ul>
+ <li>
+ Have a look to our showcase <t:pagelink page="components/grouping">page grouping many components</t:pagelink>
+ </li>
+ <li>
+ See our <t:pagelink page="components/exanpeSkin/example1">Tapestry core components skinned by Exanpe</t:pagelink>
+ </li>
+ </ul>
+ <br/>
+ <table width="100%">
+ <tr><td width="50%">
+ <ul>
+ <li><b>Accordion</b>
+ <ul>
+ <li><t:pagelink page="components/accordion/example1">Standard Accordion</t:pagelink></li>
+ <li><t:pagelink page="components/accordion/example2">Accordion built from resources file</t:pagelink></li>
+ <li><t:pagelink page="components/accordion/example3">Accordion event on mouseover</t:pagelink></li>
+ <li><t:pagelink page="components/accordion/example4">Accordion with a single item open allowed</t:pagelink></li>
+ <li><t:pagelink page="components/accordion/example5">Accordion and JavaScript interaction</t:pagelink></li>
+ </ul>
+ </li>
+ <li><b>AjaxLoader</b>
+ <ul>
+ <li><t:pagelink page="components/ajaxLoader/example1">Basic AjaxLoader</t:pagelink></li>
+ <li><t:pagelink page="components/ajaxLoader/example2">AjaxLoader with text customized</t:pagelink></li>
+ <li><t:pagelink page="components/ajaxLoader/example3">AjaxLoader loaded on demand, without panel</t:pagelink></li>
+ </ul>
+ </li>
+ <li><b>Border</b>
+ <ul>
+ <li><t:pagelink page="components/border/example1">A simple Border</t:pagelink></li>
+ </ul>
+ </li>
+ <li><b>ColorPicker</b>
+ <ul>
+ <li><t:pagelink page="components/colorPicker/example1">The Color Picker component in action</t:pagelink></li>
+ </ul>
+ </li>
+ <li><b>Dialog</b>
+ <ul>
+ <li><t:pagelink page="components/dialog/example1">A Dialog presentation displaying an information</t:pagelink></li>
+ <li><t:pagelink page="components/dialog/example2">A Dialog displaying a confirmation</t:pagelink></li>
+ <li><t:pagelink page="components/dialog/example3">A Dialog with title and message customized</t:pagelink></li>
+ <li><t:pagelink page="components/dialog/example4">A Dialog with title and message consolidated through injected id</t:pagelink></li>
+ </ul>
+ </li>
+ <li><b>Hideable Panel</b>
+ <ul>
+ <li><t:pagelink page="components/hideablePanel/example1">A basic Hideable Panel</t:pagelink></li>
+ <li><t:pagelink page="components/hideablePanel/example2">A Hideable Panel with some customing and JavaScript interaction</t:pagelink></li>
+ </ul>
+ </li>
+ </ul>
+ </td><td width="50%" style="border-left:1px solid silver">
+ <ul>
+ <li><b>Secure Password</b>
+ <ul>
+ <li><t:pagelink page="components/securePassword/example1">A basic Secure Password</t:pagelink></li>
+ <li><t:pagelink page="components/securePassword/example2">A Secure Password with some hover recording and maxlength customised</t:pagelink></li>
+ <li><t:pagelink page="components/securePassword/example3">Secure Password with character set and grid size redefined</t:pagelink></li>
+ </ul>
+ </li>
+ <li><b>SelectLoader</b>
+ <ul>
+ <li><t:pagelink page="components/selectLoader/example1">SelectLoader mixin demonstration</t:pagelink></li>
+ <li><t:pagelink page="components/selectLoader/example2">Chain 3 selects</t:pagelink></li>
+ </ul>
+ </li>
+ <li><b>Slider</b>
+ <ul>
+ <li><t:pagelink page="components/slider/example1">Basic Slider example</t:pagelink></li>
+ <li><t:pagelink page="components/slider/example2">Slider with selection customized : min, max, and gap value</t:pagelink></li>
+ <li><t:pagelink page="components/slider/example3">Slider displaying the real time value in a custom html element</t:pagelink></li>
+ <li><t:pagelink page="components/slider/example4">Slider vertically oriented</t:pagelink></li>
+ </ul>
+ </li>
+ <li><b>TabView</b>
+ <ul>
+ <li><t:pagelink page="components/tabview/example1">A basic TabView</t:pagelink></li>
+ <li><t:pagelink page="components/tabview/example2">A "client side" TabView</t:pagelink></li>
+ <li><t:pagelink page="components/tabview/example3">Load the tabs attributes (text + icon) from a resources file</t:pagelink></li>
+ <li><t:pagelink page="components/tabview/example4">A tabView with full control over the selected tab</t:pagelink></li>
+ </ul>
+ </li>
+ <li><b>Tooltip</b>
+ <ul>
+ <li><t:pagelink page="components/tooltip/example1">A basic Tooltip</t:pagelink></li>
+ <li><t:pagelink page="components/tooltip/example2">Tooltip built from resources file</t:pagelink></li>
+ <li><t:pagelink page="components/tooltip/example3">Tooltip displaying a rich content defined in the page</t:pagelink></li>
+ </ul>
+ </li>
+ </ul>
+ </td>
+ </tr>
+ </table>
+
+</html>
4 src/main/webapp/WEB-INF/app.properties
@@ -0,0 +1,4 @@
+# This is where global application properties go.
+# You can also have individual message catalogs for each page and each
+# component that override these defaults.
+# The name of this file is based on the <filter-name> element in web.
7 src/main/webapp/WEB-INF/appengine-web.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
+ <application>exanpe-t5-lib</application>
+ <!-- No '.', '_', no capital letter -->
+ <version>1-0-0-snapshot</version>
+ <sessions-enabled>true</sessions-enabled>
+</appengine-web-app>
22 src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>exanpe-t5-demo Tapestry 5 Application</display-name>
+ <context-param>
+ <!-- The only significant configuration for Tapestry 5, this informs Tapestry
+of where to look for pages, components and mixins. -->
+ <param-name>tapestry.app-package</param-name>
+ <param-value>fr.exanpe.t5.demo</param-value>
+ </context-param>
+ <filter>
+ <filter-name>app</filter-name>
+ <filter-class>org.apache.tapestry5.TapestryFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>app</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-app>
+
101 src/main/webapp/components/Grouping.tml
@@ -0,0 +1,101 @@
+<html t:type="layout" title="Components grouping"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter"
+ xmlns:ex="tapestry-library:exanpe">
+
+ <style type="text/css">
+ .gridWrapper {
+ width:803px !important;
+ width/**/:/**/ 813px;
+ }
+ </style>
+
+ This page displays a webmail including the Exanpe components.<br/><br/>
+
+ <div class="exanpe-skin">
+ <ex:HideablePanel t:id="webmailLayout" hideWidth="200" class="paddingtop">
+ <t:parameter name="hideable">
+
+ <ex:accordion t:id="categories" t:title="cat-title">
+ <ex:accordionItem t:id="mail" opened="true">
+ <ex:tooltip t:message="${sumUp.total } received / ${sumUp.unread } unread">
+ <t:actionlink t:id="received">${message:receivedLink}</t:actionlink><br/>
+ </ex:tooltip>
+ <span t:type="any" t:mixins="exanpe/dialog" t:renderMode="INFO" t:message="not-implemented" t:title="not-implemented-title">
+ <ex:tooltip t:message="prop:sumUp.sent">
+ <t:actionlink t:id="sent">${message:sentLink}</t:actionlink><br/>
+ </ex:tooltip>
+ </span>
+ <span t:type="any" t:mixins="exanpe/dialog" t:renderMode="INFO" t:message="not-implemented" t:title="not-implemented-title">
+ <ex:tooltip t:message="prop:sumUp.deleted">
+ <t:actionlink t:id="deleted">${message:deletedLink}</t:actionlink><br/>
+ </ex:tooltip>
+ </span>
+ </ex:accordionItem>
+ <ex:accordionItem t:id="calendar"/>
+ <ex:accordionItem t:id="tasks"/>
+ </ex:accordion>
+
+ </t:parameter>
+ <t:parameter name="visible">
+ <ex:tabview t:id="tabview" defaultActiveTabId="tabpres">
+ <ex:tab t:id="tabpres">
+ This page presents many components of Exanpe library and Tapestry core grouped together to render a "real" view.<br/>
+ Here is a case that demonstrate the Exanpe library :
+ <ul>
+ <li>On the left site, an <b>Accordion</b> groups some actions.</li>
+ <li>The layout is built over a <b>HideablePanel</b>, allowing the right zone to be increased.</li>
+ <li>The right side is structured over a TabView</li>
+ <li>On the left site, hover Received. A <b>Tooltip</b> appears.</li>
+ <li>Click Received.</li>
+ <li>A skinned Tapestry Grid appears on the right side, into a new Tab.</li>
+ <li>For a mail :
+ <ul>
+ <li>If you click Open Mail, the mail will open in a new Tab.</li>
+ <li>If you click Delete Mail, a <b>Dialog</b> component appear, informing that we did not implement that functionality.</li>
+ </ul>
+ </li>
+ </ul>
+ </ex:tab>
+ <t:if test="mailsReceived">
+
+ <ex:tab t:id="tabReceived">
+ <br/>
+ <div class="gridWrapper">
+ <t:grid source="mailsReceived" row="iteMail" rowsPerPage="10"
+ add="showInTab,delete" exclude="id">
+ <p:subjectCell>
+ ${shortenedSubject }
+ </p:subjectCell>
+ <p:contentCell>
+ ${shortenedContent }
+ </p:contentCell>
+ <p:fromCell>
+ ${shortenedFrom }
+ </p:fromCell>
+ <p:showInTabCell>
+ <t:actionLink t:id="open" context="iteMail.id">Open mail</t:actionLink>
+ </p:showInTabCell>
+ <p:deleteCell>
+ <t:actionLink t:id="delete" context="iteMail.id"
+ t:mixins="exanpe/dialog" t:renderMode="INFO" t:message="not-implemented" t:title="not-implemented-title">Delete mail</t:actionLink>
+ </p:deleteCell>
+ </t:grid>
+ </div>
+ </ex:tab>
+
+ </t:if>
+ <t:if test="mailsOpen">
+ <t:loop source="mailsOpen" value="iteMail">
+ <ex:tab title="${iteMail.subject}" icon="context:/img/grouping/email_open.png">
+ ${iteMail.content}<br/><br/>
+ <hr/>
+ <t:actionlink t:id="close" t:context="iteMail.id">Close mail</t:actionlink>
+ </ex:tab>
+ </t:loop>
+ </t:if>
+ </ex:tabview>
+ </t:parameter>
+ </ex:HideablePanel>
+ </div>
+</html>
19 src/main/webapp/components/accordion/Example1.tml
@@ -0,0 +1,19 @@
+<html t:type="componentDemoLayout" title="Accordion demo"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter"
+ xmlns:ex="tapestry-library:exanpe">
+
+ <p:description>
+ This page shows a standard accordion, with a title and the first item opened.
+ </p:description>
+