You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
(41) |
Sep
(44) |
Oct
(31) |
Nov
(54) |
Dec
(53) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(71) |
Feb
(66) |
Mar
(65) |
Apr
(73) |
May
(68) |
Jun
(69) |
Jul
(28) |
Aug
(49) |
Sep
(44) |
Oct
(77) |
Nov
(64) |
Dec
(78) |
| 2009 |
Jan
(50) |
Feb
(28) |
Mar
(41) |
Apr
(30) |
May
(5) |
Jun
(30) |
Jul
(6) |
Aug
(2) |
Sep
(18) |
Oct
(11) |
Nov
(6) |
Dec
(10) |
| 2010 |
Jan
(5) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <tri...@us...> - 2007-12-11 15:03:20
|
Revision: 193
http://equanda.svn.sourceforge.net/equanda/?rev=193&view=rev
Author: triathlon98
Date: 2007-12-11 07:03:15 -0800 (Tue, 11 Dec 2007)
Log Message:
-----------
EQ-100 allow "lowerFirst" conversion on variable replacement
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java
Modified: trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java 2007-12-10 13:02:19 UTC (rev 192)
+++ trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java 2007-12-11 15:03:15 UTC (rev 193)
@@ -925,7 +925,14 @@
pos = input.indexOf( '}' );
String var = input.substring( 0, pos );
input = input.substring( pos + 1 );
+ boolean lower = false;
+ if ( var.length() > 0 && var.charAt( 0 ) == '_' )
+ {
+ lower = true;
+ var = var.substring( 1 );
+ }
var = vars.get( var );
+ if ( lower ) var = lowerFirst( var );
if ( var != null ) res.append( var );
}
res.append( input );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-10 13:02:27
|
Revision: 192
http://equanda.svn.sourceforge.net/equanda/?rev=192&view=rev
Author: triathlon98
Date: 2007-12-10 05:02:19 -0800 (Mon, 10 Dec 2007)
Log Message:
-----------
EQ-98 create t5gui module with base impl
Modified Paths:
--------------
trunk/equanda-tapestry5/pom.xml
trunk/pom.xml
Added Paths:
-----------
trunk/equanda-t5gui/
trunk/equanda-t5gui/pom.xml
trunk/equanda-t5gui/src/
trunk/equanda-t5gui/src/main/
trunk/equanda-t5gui/src/main/java/
trunk/equanda-t5gui/src/main/java/org/
trunk/equanda-t5gui/src/main/java/org/equanda/
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/EquandaGridDataSource.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/ListGetter.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSetter.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettings.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/AppModule.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/translators/
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/translators/UoidTranslator.java
trunk/equanda-t5gui/src/main/site/
trunk/equanda-t5gui/src/main/site/site.xml
trunk/equanda-t5gui/src/main/site/wiki/
trunk/equanda-t5gui/src/main/site/wiki/index.wiki
Added: trunk/equanda-t5gui/pom.xml
===================================================================
--- trunk/equanda-t5gui/pom.xml (rev 0)
+++ trunk/equanda-t5gui/pom.xml 2007-12-10 13:02:19 UTC (rev 192)
@@ -0,0 +1,47 @@
+<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">
+ <parent>
+ <groupId>org.equanda</groupId>
+ <artifactId>equanda</artifactId>
+ <version>0.9-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.equanda</groupId>
+ <artifactId>equanda-t5gui</artifactId>
+ <packaging>jar</packaging>
+ <version>0.9-SNAPSHOT</version>
+ <name>equanda-t5gui</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Tapestry-Module-Classes>org.equanda.t5gui.services.EquandaModule</Tapestry-Module-Classes>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.equanda</groupId>
+ <artifactId>equanda-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-core</artifactId>
+ <version>${tapestry-release-version}</version>
+ </dependency>
+ </dependencies>
+</project>
Added: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/EquandaGridDataSource.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/EquandaGridDataSource.java (rev 0)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/EquandaGridDataSource.java 2007-12-10 13:02:19 UTC (rev 192)
@@ -0,0 +1,92 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.t5gui;
+
+import org.apache.tapestry.beaneditor.PropertyModel;
+import org.apache.tapestry.grid.GridDataSource;
+import org.equanda.persistence.om.LazyList;
+import org.equanda.persistence.om.SelectorsState;
+
+import java.util.List;
+
+/**
+ * Grid datasource for results of (equanda) selectors
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class EquandaGridDataSource<T>
+ implements GridDataSource
+{
+ private List<T> orgList;
+ private ListGetter<T> listGetter;
+ private Class rowType;
+ private String table;
+ private int size = -1;
+
+ public EquandaGridDataSource( Class objectClass, String table, ListGetter<T> listGetter )
+ {
+ rowType = objectClass;
+ this.table = table;
+ this.listGetter = listGetter;
+ }
+
+ public int getAvailableRows()
+ {
+ if ( size == -1 )
+ {
+ if ( orgList == null ) orgList = listGetter.getList();
+ size = orgList.size();
+ }
+ return size;
+ }
+
+ public void prepare( int i, int i1, PropertyModel propertyModel, boolean descending )
+ {
+ if ( propertyModel != null )
+ {
+ SelectorsState.setSorting( table, ( descending ? "" : "-" ) + propertyModel.getPropertyName() );
+ if ( orgList != null && orgList instanceof LazyList )
+ {
+ ( (LazyList) orgList ).refresh();
+ size = -1;
+ }
+ }
+ if ( orgList == null ) orgList = listGetter.getList();
+
+ }
+
+ public T getRowValue( int i )
+ {
+ if ( getAvailableRows() == 0 ) return null;
+ if ( orgList == null ) orgList = listGetter.getList();
+ return orgList.get( i );
+ }
+
+ public Class getRowType()
+ {
+ return rowType;
+ }
+
+}
Added: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/ListGetter.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/ListGetter.java (rev 0)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/ListGetter.java 2007-12-10 13:02:19 UTC (rev 192)
@@ -0,0 +1,37 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.t5gui;
+
+import java.util.List;
+
+/**
+ * Get list of objects (to allow update)
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public interface ListGetter<T>
+{
+ public List<T> getList();
+}
Added: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSetter.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSetter.java (rev 0)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSetter.java 2007-12-10 13:02:19 UTC (rev 192)
@@ -0,0 +1,40 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.t5gui;
+
+/**
+ * Allow reply from a (single) selection to be set
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public interface SelectedSetter<T>
+{
+ /**
+ * Set the value which was selected from the list
+ *
+ * @param value value to set
+ */
+ void setSelected( T value);
+}
Added: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettings.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettings.java (rev 0)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettings.java 2007-12-10 13:02:19 UTC (rev 192)
@@ -0,0 +1,61 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.t5gui;
+
+import java.util.List;
+
+/**
+ * Encapsulate the settings which need to be passed when selecting objects.
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class SelectedSettings<T>
+{
+ private Object selectedReturnPage;
+ private List<T> selectedList;
+ private SelectedSetter<T> selectedSetter;
+
+ public SelectedSettings( Object returnPage, List<T> list, SelectedSetter<T> ss )
+ {
+ selectedReturnPage = returnPage;
+ selectedList = list;
+ selectedSetter = ss;
+ }
+
+ public Object getSelectedReturnPage()
+ {
+ return selectedReturnPage;
+ }
+
+ public List<T> getSelectedList()
+ {
+ return selectedList;
+ }
+
+ public SelectedSetter<T> getSelectedSetter()
+ {
+ return selectedSetter;
+ }
+}
Added: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/AppModule.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/AppModule.java (rev 0)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/AppModule.java 2007-12-10 13:02:19 UTC (rev 192)
@@ -0,0 +1,95 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.t5gui.services;
+
+import org.equanda.t5gui.translators.UoidTranslator;
+import javassist.runtime.Desc;
+import org.apache.tapestry.Translator;
+import org.apache.tapestry.ioc.Configuration;
+import org.apache.tapestry.ioc.MappedConfiguration;
+import org.apache.tapestry.ioc.ServiceBinder;
+import org.apache.tapestry.ioc.services.Coercion;
+import org.apache.tapestry.ioc.services.CoercionTuple;
+import org.equanda.persistence.om.UOID;
+
+/**
+ * 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.
+ */
+public class AppModule
+{
+ /**
+ * Bind extra services.
+ *
+ * @param binder object to bind services to
+ */
+ 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.
+
+ // assure that the ContextClassLoader is used by javassist (seems to not be the default)
+ System.out.println( "Desc.useContextClassLoader = " + Desc.useContextClassLoader );
+ javassist.runtime.Desc.useContextClassLoader = true;
+ }
+
+ /**
+ * Contribute coercers which are necessary for full equanda support
+ *
+ * @param configuration configuration to add to
+ */
+ public static void contributeTypeCoercer( Configuration<CoercionTuple> configuration )
+ {
+ configuration.add( new CoercionTuple<String, UOID>( String.class, UOID.class, new Coercion<String, UOID>()
+ {
+ public UOID coerce( String input )
+ {
+ return new UOID( input );
+ }
+ } ) );
+ configuration.add( new CoercionTuple<UOID, String>( UOID.class, String.class, new Coercion<UOID, String>()
+ {
+ public String coerce( UOID input )
+ {
+ return input.getId();
+ }
+ } ) );
+ }
+
+ /**
+ * Contributes the following translators: <ul> <li>Uoid : translator for UOID values</li> </ul>
+ *
+ * @param configuration configuration to add to
+ */
+ public static void contributeTranslatorDefaultSource( MappedConfiguration<Class, Translator> configuration )
+ {
+ configuration.add( UOID.class, new UoidTranslator() );
+ }
+
+}
Added: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/translators/UoidTranslator.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/translators/UoidTranslator.java (rev 0)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/translators/UoidTranslator.java 2007-12-10 13:02:19 UTC (rev 192)
@@ -0,0 +1,66 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.t5gui.translators;
+
+import org.apache.tapestry.Translator;
+import org.apache.tapestry.ValidationException;
+import org.apache.tapestry.ioc.Messages;
+import org.apache.tapestry.ioc.internal.util.InternalUtils;
+import org.equanda.persistence.om.UOID;
+
+public class UoidTranslator
+ implements Translator<UOID>
+{
+ /**
+ * Parses blank values to null, otherwise parses the client value to a UOID
+ *
+ * @throws ValidationException if the clientValue can not be parsed
+ */
+ public UOID parseClient( String clientValue, Messages messages )
+ throws ValidationException
+ {
+ if ( InternalUtils.isBlank( clientValue ) )
+ {
+ return null;
+ }
+
+ try
+ {
+ return new UOID( clientValue.trim() );
+ }
+ catch ( NumberFormatException ex )
+ {
+ throw new ValidationException( messages.format( "invalid-uoid", clientValue ) );
+ }
+ }
+
+ /**
+ * Converts null to the blank string, non-null to a string representation.
+ */
+ public String toClient( UOID value )
+ {
+ return value == null ? "" : value.toString();
+ }
+}
Added: trunk/equanda-t5gui/src/main/site/site.xml
===================================================================
--- trunk/equanda-t5gui/src/main/site/site.xml (rev 0)
+++ trunk/equanda-t5gui/src/main/site/site.xml 2007-12-10 13:02:19 UTC (rev 192)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="equanda-t5gui">
+ <body>
+ <links>
+ <item name="equanda" href="http://www.equanda.org/"/>
+ <item name="staticwiki" href="http://www.staticwiki.org/"/>
+ </links>
+
+ <menu name="t5gui">
+ <item name="Introduction" href="index.html"/>
+ </menu>
+ </body>
+</project>
Added: trunk/equanda-t5gui/src/main/site/wiki/index.wiki
===================================================================
--- trunk/equanda-t5gui/src/main/site/wiki/index.wiki (rev 0)
+++ trunk/equanda-t5gui/src/main/site/wiki/index.wiki 2007-12-10 13:02:19 UTC (rev 192)
@@ -0,0 +1,4 @@
+h1. t5gui
+
+These are classes which are used to build and equanda generated tapestry5 (crud) user interface for the object model.
+Contrary to the tapestry5 component, this is equanda specific and not intended to be used without dependencies on the rest of equanda.
\ No newline at end of file
Modified: trunk/equanda-tapestry5/pom.xml
===================================================================
--- trunk/equanda-tapestry5/pom.xml 2007-12-07 21:28:40 UTC (rev 191)
+++ trunk/equanda-tapestry5/pom.xml 2007-12-10 13:02:19 UTC (rev 192)
@@ -13,19 +13,20 @@
<name>equanda-tapestry5</name>
<build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestEntries>
- <Tapestry-Module-Classes>org.equanda.tapestry5.services.EquandaModule</Tapestry-Module-Classes>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
- </plugins>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Tapestry-Module-Classes>org.equanda.tapestry5.services.EquandaModule
+ </Tapestry-Module-Classes>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
<dependencies>
<dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2007-12-07 21:28:40 UTC (rev 191)
+++ trunk/pom.xml 2007-12-10 13:02:19 UTC (rev 192)
@@ -103,6 +103,7 @@
<module>equanda-t4-template</module>
<module>equanda-tapestry4</module>
<module>equanda-tapestry5</module>
+ <module>equanda-t5gui</module>
<module>equanda-client</module>
<module>equanda-server</module>
<module>equanda-generate</module>
@@ -189,7 +190,7 @@
<index>true</index>
</archive>
</configuration>
- </plugin>
+ </plugin>
</plugins>
</build>
<reporting>
@@ -513,4 +514,8 @@
</profile>
</profiles>
+ <properties>
+ <tapestry-release-version>5.0.7-SNAPSHOT</tapestry-release-version>
+ </properties>
+
</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-07 21:29:04
|
Revision: 191
http://equanda.svn.sourceforge.net/equanda/?rev=191&view=rev
Author: triathlon98
Date: 2007-12-07 13:28:40 -0800 (Fri, 07 Dec 2007)
Log Message:
-----------
add trim() to the String class, needed for the code to display proper fields for the object type
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js 2007-12-06 18:01:47 UTC (rev 190)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js 2007-12-07 21:28:40 UTC (rev 191)
@@ -1,6 +1,12 @@
/** This file is part of the equanda project, http://equanda.org */
+// add trim() function in String class
+String.prototype.trim = function() {
+ return this.replace(/^\s+|\s+$/g,"");
+}
+
+
// get window height (browser independent)
function equandaWindowHeight()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-06 18:01:49
|
Revision: 190
http://equanda.svn.sourceforge.net/equanda/?rev=190&view=rev
Author: triathlon98
Date: 2007-12-06 10:01:47 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
fix ctrl-enter behaviour
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js 2007-12-06 16:57:40 UTC (rev 189)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js 2007-12-06 18:01:47 UTC (rev 190)
@@ -63,7 +63,7 @@
var submit = $$("."+EQUANDA_FT_DEFAULT_SUBMIT);
if (submit.length>0)
{
- equandaFtClick( submit );
+ equandaFtClick( submit[0] );
return false;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-06 16:57:45
|
Revision: 189
http://equanda.svn.sourceforge.net/equanda/?rev=189&view=rev
Author: triathlon98
Date: 2007-12-06 08:57:40 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
EQ-97 fix size() after refresh()
Modified Paths:
--------------
trunk/equanda-client/src/main/java/org/equanda/persistence/om/LazyList.java
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/om/LazyList.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/om/LazyList.java 2007-12-04 07:38:04 UTC (rev 188)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/om/LazyList.java 2007-12-06 16:57:40 UTC (rev 189)
@@ -561,5 +561,6 @@
timeCache = 0;
cache = null;
data = null;
+ size = -1;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-04 07:38:06
|
Revision: 188
http://equanda.svn.sourceforge.net/equanda/?rev=188&view=rev
Author: triathlon98
Date: 2007-12-03 23:38:04 -0800 (Mon, 03 Dec 2007)
Log Message:
-----------
css improvement
Modified Paths:
--------------
trunk/equanda-tapestry5/src/site/wiki/tabs.wiki
Modified: trunk/equanda-tapestry5/src/site/wiki/tabs.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/tabs.wiki 2007-12-01 21:15:53 UTC (rev 187)
+++ trunk/equanda-tapestry5/src/site/wiki/tabs.wiki 2007-12-04 07:38:04 UTC (rev 188)
@@ -65,6 +65,8 @@
}
.equandaTabsPanel {
border: solid 1px;
+ clear: both;
+ width: auto;
}
.equandaTabsAll {
border-bottom: solid 1px;
@@ -75,10 +77,6 @@
background: white;
padding: 1em;
}
-.equandaTabs div {
- clear: both;
- width: auto;
-}
a.equandaTabsActive:link,
a.equandaTabsActive:visited,
a.equandaTabsActive:active,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-01 21:15:54
|
Revision: 187
http://equanda.svn.sourceforge.net/equanda/?rev=187&view=rev
Author: triathlon98
Date: 2007-12-01 13:15:53 -0800 (Sat, 01 Dec 2007)
Log Message:
-----------
fix layout size
Modified Paths:
--------------
t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml
Modified: t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml
===================================================================
--- t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml 2007-12-01 21:11:35 UTC (rev 186)
+++ t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml 2007-12-01 21:15:53 UTC (rev 187)
@@ -74,7 +74,7 @@
var padItem = 20; /* padding + border (top+bottom) for item */
var total = getWindowHeight() - 4 * ( one + padTitle ) - padItem;
var info = getWindowHeight() - document.getElementById("layout-context").getHeight();
- var main = info - 90;
+ var main = info - 90 - 10;
var open = String.fromCharCode( 60 );
var close = String.fromCharCode( 62 );
document.write(open+'style'+close+'.accordion_title { height:'+one+'px; } .accordion_content { height: '+total+'px; } #layout-info { height:'+info+'px; } #layout-main { height:'+main+'px; } '+open+'/style'+close);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-01 21:11:39
|
Revision: 186
http://equanda.svn.sourceforge.net/equanda/?rev=186&view=rev
Author: triathlon98
Date: 2007-12-01 13:11:35 -0800 (Sat, 01 Dec 2007)
Log Message:
-----------
fix link
Modified Paths:
--------------
trunk/equanda-tapestry5/src/site/wiki/index.wiki
Modified: trunk/equanda-tapestry5/src/site/wiki/index.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/index.wiki 2007-12-01 20:25:32 UTC (rev 185)
+++ trunk/equanda-tapestry5/src/site/wiki/index.wiki 2007-12-01 21:11:35 UTC (rev 186)
@@ -3,7 +3,7 @@
This module contains [tapestry5|http://tapestry.apache.org/tapestry5/] components which are completely independent of the equanda generated stuff.
This is done to increase the reusability of these components without pulling in too many dependencies.
-There is a [online sample application|http://app.spoon-it.be/t5-equanad-example/] demonstrating these components, the subversion repository is [browsable here|http://equanda.svn.sourceforge.net/viewvc/equanda/t5-equanda-example/].
+There is a [online sample application|http://app.spoon-it.be/t5example/] demonstrating these components, the subversion repository is [browsable here|http://equanda.svn.sourceforge.net/viewvc/equanda/t5-equanda-example/].
The following components are provided
- [Accordion|accordion.html]
@@ -13,5 +13,4 @@
Useful services, translators and other
- DoubleTranslator : assures both dot or comma can be used as decimal seperator.
- TimestampTranslator : translator for using java.sql.Timestamp values.
-- [useful scripts|script.html]
-
+- [useful scripts|script.html]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-01 20:25:38
|
Revision: 185
http://equanda.svn.sourceforge.net/equanda/?rev=185&view=rev
Author: triathlon98
Date: 2007-12-01 12:25:32 -0800 (Sat, 01 Dec 2007)
Log Message:
-----------
fixes cfr modifications for FormTraverse component
Modified Paths:
--------------
t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml
t5-equanda-example/src/main/webapp/css/style.css
Modified: t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml
===================================================================
--- t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml 2007-12-01 18:42:28 UTC (rev 184)
+++ t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml 2007-12-01 20:25:32 UTC (rev 185)
@@ -9,6 +9,10 @@
<p>This is the example for the <a href="http://equanda.org/equanda-tapesty5/">tapestry5 component</a> which are part
of <a href="http://equanda.org">equanda</a>.</p>
+ <p>Invisible, but not less useful, is the <em>FormTraverse</em> component which makes the it possible to use the
+ site without mouse. There is a tight integration between the FormTraverse and Tabs components, which makes
+ switching between tab pages automatic when pressing tab.
+ </p>
<p>This project can be found in SVN at <a href="https://equanda.svn.sourceforge.net/svnroot/equanda/t5-equanda-example">https://equanda.svn.sourceforge.net/svnroot/equanda/t5-equanda-example</a></p>
<span t:type="equanda/Tabs" t:id="maintabs">
Modified: t5-equanda-example/src/main/webapp/css/style.css
===================================================================
--- t5-equanda-example/src/main/webapp/css/style.css 2007-12-01 18:42:28 UTC (rev 184)
+++ t5-equanda-example/src/main/webapp/css/style.css 2007-12-01 20:25:32 UTC (rev 185)
@@ -45,7 +45,7 @@
#layout-right { position:static; width:100%; height:100%; left:200px; right:auto; top:0; bottom: auto; }
#layout-context { position:static; width:100%; height:auto; background-color: lightgray; text-align:center; }
#layout-info { position:static; width:100%; height:220px; } /* height should be corrected by script */
-#layout-main { position:static; height:100%; overflow:auto; overflow-y:scroll; background-color:white; }
+#layout-main { position:static; height:100%; overflow:auto; overflow-y:scroll; background-color:white; padding: 5px; }
iframe { display:block; clear:none; overflow:hidden; }
.submit {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-01 18:42:39
|
Revision: 184
http://equanda.svn.sourceforge.net/equanda/?rev=184&view=rev
Author: triathlon98
Date: 2007-12-01 10:42:28 -0800 (Sat, 01 Dec 2007)
Log Message:
-----------
fixes cfr modifications for FormTraverse component
Modified Paths:
--------------
t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml
t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml
t5-equanda-example/src/main/webapp/css/style.css
Modified: t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml
===================================================================
--- t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml 2007-11-29 14:39:18 UTC (rev 183)
+++ t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml 2007-12-01 18:42:28 UTC (rev 184)
@@ -7,7 +7,7 @@
</head>
<body>
-
+<span t:type="equanda/FormTraversal"/>
<div id="layout-left">
<span t:type="equanda/Accordion" t:id="accordion">
<t:parameter name="title1">Menu First Part</t:parameter>
Modified: t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml
===================================================================
--- t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml 2007-11-29 14:39:18 UTC (rev 183)
+++ t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml 2007-12-01 18:42:28 UTC (rev 184)
@@ -4,7 +4,7 @@
<title>equanda tapestry5 components demo</title>
</t:parameter>
<t:parameter name="context">
- <span id="context">context info</span>
+ <span id="context">t5-equanda-example</span>
</t:parameter>
<p>This is the example for the <a href="http://equanda.org/equanda-tapesty5/">tapestry5 component</a> which are part
Modified: t5-equanda-example/src/main/webapp/css/style.css
===================================================================
--- t5-equanda-example/src/main/webapp/css/style.css 2007-11-29 14:39:18 UTC (rev 183)
+++ t5-equanda-example/src/main/webapp/css/style.css 2007-12-01 18:42:28 UTC (rev 184)
@@ -12,6 +12,14 @@
cursor: pointer;
}
+.accordion_title a:link,
+.accordion_title a:hover,
+.accordion_title a:active,
+.accordion_title a:visited {
+ text-decoration: none;
+ color: black;
+}
+
.accordion_title_active {
font-weight: bold;
}
@@ -44,54 +52,60 @@
font-weight: bold;
}
-div.domtab {
+.equandaTabs {
padding:0 3em;
width:80%;
}
-ul.domtabs {
+.equandaTabsTitles {
float:left;
width:100%;
margin: 0 0 0 0;
list-style:none;
}
-ul.domtabs li {
+.equandaTabsTitles li {
float:left;
padding:0 .5em 0 0;
}
-ul.domtabs a:link,
-ul.domtabs a:visited,
-ul.domtabs a:active,
-ul.domtabs a:hover {
- width:8em;
- padding:.2em 1em;
- display:block;
- background:lightgray;
- color:black;
- font-weight:bold;
- text-decoration:none;
+.equandaTabsTitles a:link,
+.equandaTabsTitles a:visited,
+.equandaTabsTitles a:active,
+.equandaTabsTitles a:hover {
+ width: 8em;
+ padding: .2em 1em;
+ display: block;
+ background: lightgray;
+ color: black;
+ font-weight: bold;
+ text-decoration: none;
}
-ul.domtabs a:hover {
- background:gray;
- color:white;
+.equandaTabsTitles a:hover {
+ background: gray;
+ color: white;
}
-div.domtab>div {
- clear:both;
- width:auto;
- background:white;
- border:solid 1px;
- color:black;
- padding:1em 3em;
+.equandaTabsPanel {
+ border: solid 1px;
}
-ul.domtabs li.active a:link,
-ul.domtabs li.active a:visited,
-ul.domtabs li.active a:active,
-ul.domtabs li.active a:hover {
+.equandaTabsAll {
+ border-bottom: solid 1px;
+ background: #FFFF99;
+ padding: 1em;
+}
+.equandaTabsPanelContent {
+ background: white;
+ padding: 1em;
+}
+.equandaTabs div {
+ clear: both;
+ width: auto;
+}
+a.equandaTabsActive:link,
+a.equandaTabsActive:visited,
+a.equandaTabsActive:active,
+a.equandaTabsActive:hover {
background:black;
color:white;
}
-
-.equandaTabsAll{
- background: #FFFF99;
- padding: 0;
- color: black;
+.equandaTraverseForward,
+.equandaTraverseBackward {
+ display: none;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-29 14:39:23
|
Revision: 183
http://equanda.svn.sourceforge.net/equanda/?rev=183&view=rev
Author: triathlon98
Date: 2007-11-29 06:39:18 -0800 (Thu, 29 Nov 2007)
Log Message:
-----------
EQ-92 documentation
Modified Paths:
--------------
trunk/equanda-tapestry5/src/site/wiki/accordion.wiki
trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki
trunk/equanda-tapestry5/src/site/wiki/index.wiki
trunk/equanda-tapestry5/src/site/wiki/tabs.wiki
Modified: trunk/equanda-tapestry5/src/site/wiki/accordion.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/accordion.wiki 2007-11-29 13:33:35 UTC (rev 182)
+++ trunk/equanda-tapestry5/src/site/wiki/accordion.wiki 2007-11-29 14:39:18 UTC (rev 183)
@@ -39,6 +39,14 @@
cursor: pointer;
}
+.accordion_title a:link,
+.accordion_title a:visited,
+.accordion_title a:active,
+.accordion_title a:hover {
+ color: black;
+ text-decoration: none;
+}
+
.accordion_title_active {
font-weight: bold;
}
Modified: trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki 2007-11-29 13:33:35 UTC (rev 182)
+++ trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki 2007-11-29 14:39:18 UTC (rev 183)
@@ -1,6 +1,6 @@
h1. FormTraversal
-This component is intended to give consistent uer interface behaviour which allows easy and efficient form completion without using a mouse.
+This component is intended to give consistent user interface behaviour which allows easy and efficient form completion without using a mouse.
It achieves this by
- assuring focus starts in the first editable input element on the page
- allow traversing the (useable) form elements using tab or enter
@@ -13,11 +13,12 @@
{code}
The exact behaviour is influenced by the class on the elements.
-- formTraversalSkip : .....
-- formTraversalInvokeForward : .....
-- formTraversalInvokeBackward : .....
-- formTraversalMove : .....
-- formTraversalEnter : .....
+- defaultSubmit : the first element which can be found with this class is "clicked on" when the user presses ctrl-enter.
+- equandaTraverseSkip : any element marked with this class never receives focus
+- formTraversalInvokeForward : when going forward through the form using tab or enter, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
+- formTraversalInvokeBackward : when going backward through the form using shift-tab, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
+- equandaTraverseMove : when an element is encountered with this class, then searching the next object continues at the objet with the id given in the "href" attribute for the element (optionally preceded by a hash).
+- equandaTraverseEnter : when a textarea is marked using this class, then enter jumps to a new line in the form.
h2. ctrl-enter
@@ -32,11 +33,13 @@
h2. enter
To assure behaviour is consistent, pressing enter is (normally) considered the same as pressing tab.
-When inside a textarea (which is not marked with the class "formTraversalEnter"), the user should press shift-enter to go to a new line.
+When inside a textarea (which is not marked with the class "equandaTraverseEnter"), the user should press shift-enter to go to a new line.
Differences with tab behaviour are
- shift-enter does not move backwards
-- when pressing enter on an element marked with the class "defaultButton" then that element is clicked on.
--
+- when pressing enter on an element marked with the class "defaultButton" then that element is "clicked on".
+- when pressing enter in a textarea, focus is still moved to the next element, except when the element is marked using the "equandaTraverseEnter" class.
-h2. tab
\ No newline at end of file
+h2. tab
+
+This moves forward or backward through the page. It only considers visible, enabled links, buttons and form elements, with the extra handling based on the classes as mentioned above.
\ No newline at end of file
Modified: trunk/equanda-tapestry5/src/site/wiki/index.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/index.wiki 2007-11-29 13:33:35 UTC (rev 182)
+++ trunk/equanda-tapestry5/src/site/wiki/index.wiki 2007-11-29 14:39:18 UTC (rev 183)
@@ -3,6 +3,8 @@
This module contains [tapestry5|http://tapestry.apache.org/tapestry5/] components which are completely independent of the equanda generated stuff.
This is done to increase the reusability of these components without pulling in too many dependencies.
+There is a [online sample application|http://app.spoon-it.be/t5-equanad-example/] demonstrating these components, the subversion repository is [browsable here|http://equanda.svn.sourceforge.net/viewvc/equanda/t5-equanda-example/].
+
The following components are provided
- [Accordion|accordion.html]
- [Tabs|tabs.html]
Modified: trunk/equanda-tapestry5/src/site/wiki/tabs.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/tabs.wiki 2007-11-29 13:33:35 UTC (rev 182)
+++ trunk/equanda-tapestry5/src/site/wiki/tabs.wiki 2007-11-29 14:39:18 UTC (rev 183)
@@ -3,7 +3,11 @@
A tabs component which allows grouping objects in tab pages.
You have to pass the title and content panes as parameters to the tabs component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
+You can specify a "titleIcon" parameter block which allows display a icon (or something else) on each tab.
+Using "contentAll" it is possiblt to have a banner displayed at the top of each tab page.
+The component has some built in features to function well in combination with the [FormTraversal|formtraversal.html] component. Specifically, moving between the fields on the form (using tab or enter) will also traverse to the next ir previous tb page when needed. You probably want to use CSS to hide the links which accomplish this.
+
{code}
<span t:type="equanda/Tabs" t:id="tabs">
<t:parameter name="title1">First title</t:parameter>
@@ -20,6 +24,9 @@
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero ipsum, volutpat nec, posuere vitae, pulvinar ut, quam. Morbi fringilla pulvinar nisi. Cras luctus leo sed orci. In id mi eget nunc blandit nonummy. Morbi at lacus. Ut sed elit. Donec libero. Sed feugiat tempor erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Nam lorem mi, accumsan id, commodo sit amet, interdum sit amet, augue.</p>
<p>Cras massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum accumsan neque vitae odio. Phasellus luctus arcu quis nibh. Maecenas leo. Ut aliquam hendrerit odio. Vestibulum luctus diam nec enim. Nam mi. Etiam eros turpis, ultrices et, ullamcorper nec, posuere sed, nisi. Integer placerat risus sit amet purus. Nulla elit purus, consequat sed, blandit in, feugiat bibendum, quam. In hac habitasse platea dictumst. Ut vel lorem. Ut pharetra leo. Sed sit amet felis. Nunc sed eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed elit metus, euismod sed, laoreet a, aliquam a, enim.</p>
</t:parameter>
+ <t:parameter name="contentAll">
+ <p>This banner should be repeated on all pages.</p>
+ </t:parameter>
</span>
{code}
@@ -44,31 +51,43 @@
.equandaTabsTitles a:visited,
.equandaTabsTitles a:active,
.equandaTabsTitles a:hover {
- width:8em;
- padding:.2em 1em;
- display:block;
- background:lightgray;
- color:black;
- font-weight:bold;
- text-decoration:none;
+ width: 8em;
+ padding: .2em 1em;
+ display: block;
+ background: lightgray;
+ color: black;
+ font-weight: bold;
+ text-decoration: none;
}
.equandaTabsTitles a:hover {
- background:gray;
- color:white;
+ background: gray;
+ color: white;
}
-.equandaTabsPanelContent div {
- clear:both;
- width:auto;
- background:white;
- border:solid 1px;
- color:black;
- padding:1em 3em;
+.equandaTabsPanel {
+ border: solid 1px;
}
-.equandaTabsActive a:link,
-.equandaTabsActivea:visited,
-.equandaTabsActive a:active,
-.equandaTabsActive a:hover {
+.equandaTabsAll {
+ border-bottom: solid 1px;
+ background: beige;
+ padding: 1em;
+}
+.equandaTabsPanelContent {
+ background: white;
+ padding: 1em;
+}
+.equandaTabs div {
+ clear: both;
+ width: auto;
+}
+a.equandaTabsActive:link,
+a.equandaTabsActive:visited,
+a.equandaTabsActive:active,
+a.equandaTabsActive:hover {
background:black;
color:white;
}
+.equandaTraverseForward,
+.equandaTraverseBackward {
+ display: none;
+}
{code}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-29 13:33:41
|
Revision: 182
http://equanda.svn.sourceforge.net/equanda/?rev=182&view=rev
Author: triathlon98
Date: 2007-11-29 05:33:35 -0800 (Thu, 29 Nov 2007)
Log Message:
-----------
EQ-92, EQ-94 finish form traversal, assure that it integrates nicely with both Accordion and Tavs components
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Accordion.tml
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/accordion.js
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js
Added Paths:
-----------
trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java 2007-11-28 23:34:47 UTC (rev 181)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java 2007-11-29 13:33:35 UTC (rev 182)
@@ -41,6 +41,10 @@
public class FormTraversal
{
@Inject
+ @Path( "${tapestry.scriptaculous}/prototype.js" )
+ private Asset prototype;
+
+ @Inject
@Path( "classpath:/org/equanda/tapestry5/resources/formtraversal.js" )
private Asset script;
@@ -50,7 +54,7 @@
@BeginRender
boolean doBeginRender( MarkupWriter writer )
{
- pageRenderSupport.addScriptLink( script );
+ pageRenderSupport.addScriptLink( prototype, script );
return false;
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java 2007-11-28 23:34:47 UTC (rev 181)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java 2007-11-29 13:33:35 UTC (rev 182)
@@ -55,7 +55,7 @@
@Inject
private ComponentResources resources;
-
+
@BeginRender
void doBeginRender( MarkupWriter writer )
{
@@ -82,7 +82,8 @@
*
* @return index for previous tab as string or null
*/
- public String getBackward() {
+ public String getBackward()
+ {
int index = getIndex();
if ( index == 0 ) return null;
return Integer.toString( index - 1 );
@@ -93,26 +94,31 @@
*
* @return index for next tab as string or null
*/
- public String getForward() {
+ public String getForward()
+ {
int index = getIndex() + 1;
if ( index == getPanelCount() ) return null;
return Integer.toString( index );
}
/**
- * indication of whether
+ * Indication (class) of whether this is the active tab.
+ *
* @return style for active tab title
*/
- public String getActive() {
- if ( getIndex() == CURRENT ) return "equandaTabsActive";
+ public String getActive()
+ {
+ if ( getIndex() == CURRENT ) return "equandaTabsActive equandaTraverseSkip";
return "";
}
/**
* display method, depending on "current" panel
+ *
* @return "block" or "none"
- * */
- public String getDisplay() {
+ */
+ public String getDisplay()
+ {
if ( getIndex() == CURRENT ) return "block";
return "none";
}
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Accordion.tml
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Accordion.tml 2007-11-28 23:34:47 UTC (rev 181)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Accordion.tml 2007-11-29 13:33:35 UTC (rev 182)
@@ -4,13 +4,17 @@
<t:loop source="Panels" value="Panel" volatile="true">
<t:if test="${panel.active}">
<div class="${id}_title ${id}_title_active" onClick="equandaAccordion(this)">
- <t:delegate to="titleIcon"/>
- <t:delegate to="panel.title"/>
+ <a href="javascript:;" onClick="equandaAccordion(this)" class="equandaTraverseSkip">
+ <t:delegate to="titleIcon"/>
+ <t:delegate to="panel.title"/>
+ </a>
</div>
<t:parameter name="else">
<div class="${id}_title" onClick="equandaAccordion(this)">
- <t:delegate to="titleIcon"/>
- <t:delegate to="panel.title"/>
+ <a href="javascript:;" onClick="equandaAccordion(this)">
+ <t:delegate to="titleIcon"/>
+ <t:delegate to="panel.title"/>
+ </a>
</div>
</t:parameter>
</t:if>
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml 2007-11-28 23:34:47 UTC (rev 181)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml 2007-11-29 13:33:35 UTC (rev 182)
@@ -16,8 +16,8 @@
<t:loop source="Panels" value="Panel" index="Index" volatile="true">
<div id="${id}c${index}" style="display:${display};">
<div class="equandaTabsPanelContent">
+ <t:if test="backward"><a class="equandaTraverseBackward" href="javascript:;" onclick="equandaTabsClick( $('${id}t${backward}'),$('${id}c${backward}') );">prev</a></t:if>
<t:delegate to="panel.content"/>
- <t:if test="backward"><a class="equandaTraverseBackward" href="javascript:;" onclick="equandaTabsClick( $('${id}t${backward}'),$('${id}c${backward}') );">prev</a></t:if>
<t:if test="forward"><a class="equandaTraverseForward" href="javascript:;" onclick="equandaTabsClick( $('${id}t${forward}'), $('${id}c${forward}') );">next</a></t:if>
</div>
</div>
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/accordion.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/accordion.js 2007-11-28 23:34:47 UTC (rev 181)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/accordion.js 2007-11-29 13:33:35 UTC (rev 182)
@@ -1,46 +1,30 @@
-/**
- * This file is part of the equanda project.
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
- * ANY KIND, either express or implied. See the License for the specific language governing rights and
- * limitations under the License.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- */
+/** This file is part of the equanda project, http://equanda.org */
-function equandaAccordion(el)
+var EQUANDA_ACCORDION_SKIP = "equandaTraverseSkip";
+
+function equandaAccordion( el )
{
+ if (el.tagName == "A" ) el = el.up();
var accordionId = el.parentNode.id;
- if (!Element.hasClassName(el,accordionId+"_title_active")) {
- $$('.'+accordionId+'_title_active').each(function deactivate(object){
- object.next().setStyle({display:'none'});
- object.removeClassName(accordionId+'_title_active');
- });
- el.addClassName(accordionId+'_title_active');
- el.next().setStyle({display:'block'});
+ if ( !Element.hasClassName( el, accordionId + "_title_active" ) )
+ {
+ $$( '.' + accordionId + '_title_active').each( function deactivate( object ) {
+ object.next().style.display = "none";
+ object.removeClassName( accordionId + '_title_active' );
+ object.down().removeClassName( EQUANDA_ACCORDION_SKIP );
+ } );
+ el.addClassName( accordionId + '_title_active' );
+ el.down().addClassName( EQUANDA_ACCORDION_SKIP );
+ el.next().style.display = "block";
}
}
-function equandaAccordionInit(elementName)
+function equandaAccordionInit( elementName )
{
- var objects = $$('#'+elementName+' .'+elementName+'_title');
- objects.each(function hide(object){
- if (!Element.hasClassName(object,elementName+"_title_active")) {
- object.next().setStyle({display:'none'});
+ var objects = $$( '#' + elementName + ' .' + elementName+'_title' );
+ objects.each( function hide( object ) {
+ if ( !Element.hasClassName( object, elementName + "_title_active" ) ) {
+ object.next().style.display = "none";
}
- })
+ } );
}
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js 2007-11-28 23:34:47 UTC (rev 181)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js 2007-11-29 13:33:35 UTC (rev 182)
@@ -1,3 +1,6 @@
+/** This file is part of the equanda project, http://equanda.org */
+
+
// get window height (browser independent)
function equandaWindowHeight()
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js 2007-11-28 23:34:47 UTC (rev 181)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js 2007-11-29 13:33:35 UTC (rev 182)
@@ -1,3 +1,5 @@
+/** This file is part of the equanda project, http://equanda.org */
+
// assure first item in form gets focus
function equandaFtFocus()
@@ -8,7 +10,7 @@
var i, tr, td, elem, tbody;
for (i=0; i<form.elements.length; i++)
{
- elem=form.elements[i];
+ elem = $( form.elements[i] );
if (((elem.tagName=="INPUT" ) && ((elem.type=="text") || (elem.type=="checkbox"))) || (elem.tagName=="SELECT"))
{
if ((elem.style.display!="none") && !(elem.disabled) && (elem.className!="nodisplay"))
@@ -30,295 +32,162 @@
// form traversal
-var equandaFt_SUBMIT_CLASS = "submitButton";
-var equandaFt_SKIP_FIELD_CLASS = "skipField";
-var equandaFtLastKeyTime = null;
-var equandaFt_MAX_DEPTH_CHECK_VISIBILITY = 10;
-// check so many parents to be visible
+var EQUANDA_FT_DEFAULT_SUBMIT = "defaultSubmit";
+var EQUANDA_FT_VISCHECK = 25; // check so many parents to be visible
+var EQUANDA_FT_SKIP = "equandaTraverseSkip";
+var EQUANDA_FT_INVOKELINK_FORWARD = "equandaTraverseForward";
+var EQUANDA_FT_INVOKELINK_BACKWARD = "equandaTraverseBackward";
+var EQUANDA_FT_MOVELINK = "equandaTraverseMove";
+var EQUANDA_FT_ENTEROVERRIDE = "equandaTraverseEnter";
function equandaFtInit()
{
- var agt = navigator.userAgent.toLowerCase();
- if ( agt.indexOf('msie') != -1 || agt.indexOf('opera') != -1 )
- {
- // there is a problem with shift/ctrl keys to detect when they are pressed
- // onkeydown=shift key can be checked (ctrl+enter doesn't work)
- // onkeypress=ctrl key can be checked (shift+tab acts as default)
- // document.onkeydown = KeyHandlerIE;
- document.onkeypress = equandaFtKeyHandlerIE;
- }
- if ( agt.indexOf('gecko') != -1 )
- {
- document.onkeypress = equandaFtKeyHandlerNetscape;
- }
+ document.onkeypress = equandaFtKeyHandler;
}
-function equandaFtGetStyleClass( element )
+function equandaFtKeyHandler( evnt )
{
- var nav = !(window.Event);
- if ( nav )
- return element.getAttribute("class");
- else
- return element.getAttribute("className");
-}
-
-function equandaFtGetCssRules( styleSheet )
-{
- var nav = !(window.Event);
- if ( nav )
- return styleSheet.cssRules ? styleSheet.cssRules : null;
- else
- return styleSheet.rules;
-}
-
-function equandaFtClassDisplayNone( className )
-{
- var i, j;
- for ( i = 0 ; i < document.styleSheets.length ; i++ )
+ var key;
+ if (!evnt) evnt = window.event;
+ if (evnt.keyCode) key = evnt.keyCode; else if (evnt.which) key = evnt.which;
+ if ( key == 10 ) key = 13; // assure \n and \r are treated the same (for IE)
+ var input = $( evnt.target ? evnt.target : window.event.srcElement );
+ if ( key == 9 || key == 13 )
{
- var rules = equandaFtGetCssRules(document.styleSheets[i]);
- for ( j = 0 ; j < rules.length ; j++ )
+ // special enter handling
+ if ( key == 13 )
{
- var name = rules[j].selectorText;
- if ( name != null )
- if ( ( (name.substring(1) == className) && (name.charAt(0) == '.' )) ||
- ( name.selectorText == className ) )
+ // ctrl-enter should invoke default submit (if any)
+ if ( evnt.ctrlKey )
+ {
+ var submit = $$("."+EQUANDA_FT_DEFAULT_SUBMIT);
+ if (submit.length>0)
{
- return rules[j].style.display == "none";
+ equandaFtClick( submit );
+ return false;
}
- }
- }
- return false;
-}
+ }
-function equandaFtHasClass( element, _className )
-{
- var classes = equandaFtGetStyleClass(element);
- if ( classes == null || classes == "" ) return false;
- while ( 1 == 1 )
- {
- if ( classes.indexOf(" ") == -1 )
- {
- if ( classes == _className ) return true;
- break;
+ // shift-enter should work as usual (needed for textarea)
+ if ( evnt.shiftKey ) return true;
+
+ // enter should work as normal when overridden
+ if ( input.hasClassName( EQUANDA_FT_ENTEROVERRIDE ) ) return true;
+
+ // enter on default submit should just submit
+ if ( input.hasClassName( EQUANDA_FT_DEFAULT_SUBMIT ) )
+ {
+ equandaFtClick( input );
+ return false;
+ }
}
- else
- {
- var className = classes.substring(0, classes.indexOf(" "));
- if ( className == _className ) return true;
- classes = classes.substring(classes.indexOf(" ") + 1);
- }
- }
- return false;
-}
-function equandaFtIsVisible( element )
-{
- var depth = equandaFt_MAX_DEPTH_CHECK_VISIBILITY;
- while ( depth > 0 && element != null && element.tagName != "FORM" )
- {
- depth--;
- if ( element.style.display == "none" ) return false;
- var classes = equandaFtGetStyleClass(element);
- if ( classes != null && classes != "" )
+ var direction = 1;
+ if ( key != 13 && evnt.shiftKey ) direction = -1;
+
+ while ( 1 == 1 )
{
- while ( true )
+ input = equandaFtTraverse( input, direction );
+ if ( input.hasClassName( EQUANDA_FT_SKIP ) ) continue;
+ if ( direction > 0 && input.hasClassName( EQUANDA_FT_INVOKELINK_FORWARD ) ) equandaFtClick( input );
+ if ( direction < 0 && input.hasClassName( EQUANDA_FT_INVOKELINK_BACKWARD ) ) equandaFtClick( input );
+ if ( input.hasClassName( EQUANDA_FT_MOVELINK ) )
{
- if ( classes.indexOf(" ") == -1 )
- {
- if ( equandaFtClassDisplayNone(classes) ) return false;
- if ( classes == equandaFt_SKIP_FIELD_CLASS ) return false;
- break;
- }
- else
- {
- // Commented the next 2 lines.
- // This is for the case of class="tabset_content tabset_content_active" in tabtastic.
- // (I think it's correct to consider only the last class, like "tabset_content_active" in this case)
+ var attr = input.getAttribute( 'href' );
+ if ( attr && attr.charAt(0)=='#') attr=attr.substring(1);
+ input=$(attr);
+ }
- // var className = classes.substring(0, classes.indexOf(" "));
- // if ( classDisplayNone(className)==true ) return false;
- classes = classes.substring(classes.indexOf(" ") + 1);
- }
+ if ( equandaFtIsFocusable( input ) && equandaFtIsVisible( input ) )
+ {
+ input.focus();
+//alert("next "+input.tagName+"#"+input.id+"."+input.classNames()+" onclick "+input.onclick);
+ return false;
}
}
- element = element.parentNode;
}
+ else
+ {
+ if ( key == 32 ) equandaFtClick( input );
+ }
return true;
}
-function equandaFtNetscapeKeyHandler( input, event )
+function equandaFtIsVisible( element )
{
- var pos, i;
- equandaFtLastKeyTime = new Date();
- if ( input.form )
+ // need to move up the tree as getStyle doew not check parent style (which is reasonable enough)
+ var depth = EQUANDA_FT_VISCHECK;
+ while ( depth > 0 && element != null && element.tagName != "BODY" )
{
- if ( event.which == 13 && event.ctrlKey )
- {
- pos = equandaFtGetIndex(input);
- var btn = null;
- if ( pos + 1 == input.form.length ) pos = 0;
- for ( i = pos + 1 ; i != pos ; i++ )
- {
- if ( ( input.form[i].type == "submit" || input.form[i].type == "button" ) &&
- !(input.form[i].disabled) && input.form[i].style.display != "none" )
- {
- if ( btn == null ) btn = input.form[i];
- if ( equandaFtHasClass(input.form[i], equandaFt_SUBMIT_CLASS) )
- {
- input.form[i].click();
- return false;
- }
- }
- if ( i == input.form.length - 1 ) i = -1;
- }
- if ( btn != null )
- {
- btn.click();
- return false;
- }
- return false;
- }
- if ( event.which == 13 || event.keyCode == 9 )
- {
- if ( event.which == 13 &&
- ( (( input.type == "submit" ) || ( input.type == "button" )) && equandaFtHasClass(input, equandaFt_SUBMIT_CLASS) ) )
- {
- input.click();
- return false;
- }
- if ( event.which == 13 && input.tagName == 'TEXTAREA' )
- {
- return true;
- }
- var direction = 1;
- if ( event.shiftKey ) direction = -1;
- pos = ( equandaFtGetIndex(input) + direction ) % input.form.length;
- if ( pos == -1 ) pos = input.form.length - 1;
- while ( 1 == 1 )
- {
- if ( !input.form[ pos ].type )
- pos += direction;
- else if ( input.form[ pos ].type == "hidden" )
- pos += direction;
- else if ( input.form[ pos ].disabled )
- pos += direction;
- else if ( input.form[ pos ].style.display == "none" )
- pos += direction;
- else if ( !equandaFtIsVisible(input.form[ pos ] ) )
- pos += direction;
- else
- break;
- if ( pos == input.form.length ) pos = 0;
- if ( pos == -1 ) pos = input.form.length - 1;
- }
- input.form[ pos ].focus();
- return false;
- }
+ if ( element.getStyle('display')=='none' || element.hasClassName( 'nodisplay' ) ) return false;
+ element = element.up();
}
return true;
}
-function equandaFtMicrosoftKeyHandler( input )
+function equandaFtIsFocusable( element )
{
- var pos, i;
- equandaFtLastKeyTime = new Date();
- if ( event.keyCode == 10 && event.ctrlKey )
+ if ( element.disabled ) return false;
+ if ( element.tagName == "A" && element.href ) return true;
+ if ( element.tagName == "INPUT" && element.type != "hidden" ) return true;
+ if ( element.tagName == "TEXTAREA" && element.type != "hidden" ) return true;
+ if ( element.tagName == "SELECT" ) return true;
+ if ( element.tagName == "BUTTON" ) return true;
+ return false;
+}
+
+function equandaFtTraverse( element, direction )
+{
+ var next;
+ if ( direction > 0 )
{
- pos = equandaFtGetIndex(input);
- var btn = null;
- if ( pos + 1 == input.form.length ) pos = 0;
- for ( i = pos + 1 ; i != pos ; i++ )
+ next = element.down();
+ if (!next) next = element.next();
+ while ( !next && element && element.tagName != "BODY" )
{
- if ( ( input.form[i].type == "submit" || input.form[i].type == "button" ) &&
- !(input.form[i].disabled) && input.form[i].style.display != "none" )
- {
- if ( btn == null ) btn = input.form[i];
- if ( equandaFtHasClass(input.form[i], equandaFt_SUBMIT_CLASS) )
- {
- input.form[i].click();
- return true;
- }
- }
- if ( i == input.form.length - 1 ) i = -1;
+ element = element.up();
+ next = element.next();
}
- if ( btn != null )
- {
- btn.click();
- return true;
- }
- return true;
+ if ( !next ) next = $$( 'body' )[0];
}
- if ( event.keyCode == 13 || event.keyCode == 9 )
+ else
{
- if ( event.keyCode == 13 &&
- ( (( input.type == "submit" ) || ( input.type == "button" )) && equandaFtHasClass(input, equandaFt_SUBMIT_CLASS) ) )
- {
- input.form[pos].click();
- return false;
- }
- if ( event.keyCode == 13 && input.tagName == 'TEXTAREA' )
- {
- return true;
- }
- var direction = 1;
- if ( event.shiftKey ) direction = -1;
- pos = ( equandaFtGetIndex(input) + direction) % input.form.length;
- if ( pos == -1 ) pos = input.form.length - 1;
- while ( 1 == 1 )
- {
- if ( !input.form[ pos ].type )
- pos += direction;
- else if ( input.form[ pos ].type == "hidden" )
- pos += direction;
- else if ( input.form[ pos ].disabled )
- pos += direction;
- else if ( input.form[ pos ].style.display == "none" )
- pos += direction;
- else if ( !equandaFtIsVisible(input.form[ pos ] ) )
- pos += direction;
- else
- break;
- if ( pos == input.form.length ) pos = 0;
- if ( pos == -1 ) pos = input.form.length - 1;
- }
- input.form[ pos ].focus();
- input = input.form[pos];
- if ( input.type == "text" )
- {
- if ( input.createTextRange )
- {
- var v = input.value;
- var r = input.createTextRange();
- r.moveStart('character', v.length);
- r.select();
- }
- }
- return false;
+ next = element.previous();
+ if ( next ) next = equandaFtLastChild( next );
+ if ( !next ) next = element.up();
+ if ( next.tagName == "BODY" ) next = equandaFtLastChild( next );
}
- return true;
+ return next;
}
-function equandaFtGetIndex( input )
+function equandaFtLastChild( element )
{
- if ( input.form != null )
+ while ( element.descendants().length > 0 )
{
- var index = -1, i = 0;
- while ( i < input.form.length && index == -1 )
- if ( input.form[i] == input ) index = i;
- else i++;
- return index;
+ var desc = element.descendants();
+ element = desc[ desc.length - 1 ];
}
- return 0;
+ return $( element );
}
-function equandaFtKeyHandlerIE()
+function equandaFtClick( element )
{
- var target = event.target ? event.target : window.event.srcElement;
- return equandaFtMicrosoftKeyHandler(target);
-}
-function equandaFtKeyHandlerNetscape( event )
-{
- var target = event.target ? event.target : window.event.srcElement;
- return equandaFtNetscapeKeyHandler(target, event);
-}
+ if ( element.click )
+ {
+ element.click();
+ }
+ else if ( element.href )
+ {
+ if ( !element.onclick )
+ {
+ window.location.href = element.href;
+ }
+ else
+ {
+ if ( element.onclick() )
+ {
+ window.location.href = element.href;
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js 2007-11-28 23:34:47 UTC (rev 181)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js 2007-11-29 13:33:35 UTC (rev 182)
@@ -1,4 +1,7 @@
+/** This file is part of the equanda project, http://equanda.org */
+
var EQUANDA_TABS_ACTIVE = "equandaTabsActive";
+var EQUANDA_TABS_TRAVERSE = "equandaTraverseSkip";
var EQUANDA_TABS_ALL = "equandaTabsAll";
function equandaTabsClick( title, content )
@@ -6,7 +9,10 @@
if ( !title.hasClassName( EQUANDA_TABS_ACTIVE ) )
{
title.addClassName( EQUANDA_TABS_ACTIVE );
- title.up().siblings().each( function rem( el ) { el.down().removeClassName( EQUANDA_TABS_ACTIVE ); } );
+ title.addClassName( EQUANDA_TABS_TRAVERSE );
+ title.up().siblings().each( function rem( el ) {
+ el.down().removeClassName( EQUANDA_TABS_ACTIVE ).removeClassName( EQUANDA_TABS_TRAVERSE );
+ } );
content.style.display = "block";
content.siblings().each( function rem( el ) {
if ( !el.hasClassName( EQUANDA_TABS_ALL ) ) el.style.display = "none";
Added: trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki 2007-11-29 13:33:35 UTC (rev 182)
@@ -0,0 +1,42 @@
+h1. FormTraversal
+
+This component is intended to give consistent uer interface behaviour which allows easy and efficient form completion without using a mouse.
+It achieves this by
+- assuring focus starts in the first editable input element on the page
+- allow traversing the (useable) form elements using tab or enter
+- allow page submit by pressing ctrl-enter
+
+To use it, include the following snippet in your template (probably the layout).
+
+{code}
+<span t:type="equanda/FormTraversal"/>
+{code}
+
+The exact behaviour is influenced by the class on the elements.
+- formTraversalSkip : .....
+- formTraversalInvokeForward : .....
+- formTraversalInvokeBackward : .....
+- formTraversalMove : .....
+- formTraversalEnter : .....
+
+
+h2. ctrl-enter
+
+This key is used to submit the form. It looks for (the first) DOM object with class "defaultSubmit" and invokes that. You probably want to highlight that button.
+{code}
+.defaultSubmit {
+ font-weight: bold;
+}
+{code}
+
+h2. enter
+
+To assure behaviour is consistent, pressing enter is (normally) considered the same as pressing tab.
+When inside a textarea (which is not marked with the class "formTraversalEnter"), the user should press shift-enter to go to a new line.
+
+Differences with tab behaviour are
+- shift-enter does not move backwards
+- when pressing enter on an element marked with the class "defaultButton" then that element is clicked on.
+-
+
+h2. tab
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-28 23:34:55
|
Revision: 181
http://equanda.svn.sourceforge.net/equanda/?rev=181&view=rev
Author: triathlon98
Date: 2007-11-28 15:34:47 -0800 (Wed, 28 Nov 2007)
Log Message:
-----------
improve tabs to allow forward/backward links for FormTraversal interaction
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml
trunk/equanda-tapestry5/src/site/wiki/tabs.wiki
Added Paths:
-----------
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js
Removed Paths:
-------------
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/domtab.js
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java 2007-11-28 10:20:37 UTC (rev 180)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java 2007-11-28 23:34:47 UTC (rev 181)
@@ -53,6 +53,7 @@
private TwoBlocks panel;
private int index;
+ private int panelCount;
public String getId()
{
@@ -91,18 +92,25 @@
public List<TwoBlocks> getPanels()
{
+ panelCount = 0;
List<TwoBlocks> list = new ArrayList<TwoBlocks>();
for ( int i = 0; i < MAX_PANELS ; i++ )
{
String index = Integer.toString( i + 1 );
if ( resources.isBound( "title" + index ) && resources.isBound( "content" + index ) )
{
+ panelCount++;
list.add( new TwoBlocks( i + 1 ) );
}
}
return list;
}
+ public int getPanelCount()
+ {
+ return panelCount;
+ }
+
public class TwoBlocks implements Serializable
{
private Block title, content;
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java 2007-11-28 10:20:37 UTC (rev 180)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java 2007-11-28 23:34:47 UTC (rev 181)
@@ -29,9 +29,6 @@
import org.apache.tapestry.ioc.annotations.Inject;
import org.equanda.tapestry5.base.TitleContent;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* Tabs component
*
@@ -41,8 +38,13 @@
public class Tabs
extends TitleContent
{
+ private static final int CURRENT = 0;
@Inject
- @Path( "classpath:/org/equanda/tapestry5/resources/domtab.js" )
+ @Path( "${tapestry.scriptaculous}/prototype.js" )
+ private Asset prototype;
+
+ @Inject
+ @Path( "classpath:/org/equanda/tapestry5/resources/tabs.js" )
private Asset script;
@Parameter
@@ -57,7 +59,7 @@
@BeginRender
void doBeginRender( MarkupWriter writer )
{
- pageRenderSupport.addScriptLink( script );
+ pageRenderSupport.addScriptLink( prototype, script );
}
public Block getContentAll()
@@ -74,4 +76,44 @@
{
this.contentAll = contentAll;
}
+
+ /**
+ * String index for previous tab if any
+ *
+ * @return index for previous tab as string or null
+ */
+ public String getBackward() {
+ int index = getIndex();
+ if ( index == 0 ) return null;
+ return Integer.toString( index - 1 );
+ }
+
+ /**
+ * String index for next tab if any
+ *
+ * @return index for next tab as string or null
+ */
+ public String getForward() {
+ int index = getIndex() + 1;
+ if ( index == getPanelCount() ) return null;
+ return Integer.toString( index );
+ }
+
+ /**
+ * indication of whether
+ * @return style for active tab title
+ */
+ public String getActive() {
+ if ( getIndex() == CURRENT ) return "equandaTabsActive";
+ return "";
+ }
+
+ /**
+ * display method, depending on "current" panel
+ * @return "block" or "none"
+ * */
+ public String getDisplay() {
+ if ( getIndex() == CURRENT ) return "block";
+ return "none";
+ }
}
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml 2007-11-28 10:20:37 UTC (rev 180)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml 2007-11-28 23:34:47 UTC (rev 181)
@@ -1,9 +1,9 @@
-<div class="domtab" id="${id}"
+<div class="equandaTabs" id="${id}"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <ul class="domtabs">
+ <ul class="equandaTabsTitles">
<t:loop source="Panels" value="Panel" index="Index" volatile="true">
- <li><a href="#${id}t${index}">
+ <li><a id="${id}t${index}" href="javascript:;" onclick="equandaTabsClick( $('${id}t${index}'), $('${id}c${index}') );" class="${active}" >
<t:delegate to="titleIcon"/>
<t:delegate to="panel.title"/>
</a></li>
@@ -14,9 +14,13 @@
<div class="equandaTabsAll"><t:delegate to="contentAll"/></div>
</t:if>
<t:loop source="Panels" value="Panel" index="Index" volatile="true">
- <div><a name="${id}t${index}" id="${id}t${index}">
- <div class="equandaTabsPanelContent"><t:delegate to="panel.content"/></div>
- </a></div>
+ <div id="${id}c${index}" style="display:${display};">
+ <div class="equandaTabsPanelContent">
+ <t:delegate to="panel.content"/>
+ <t:if test="backward"><a class="equandaTraverseBackward" href="javascript:;" onclick="equandaTabsClick( $('${id}t${backward}'),$('${id}c${backward}') );">prev</a></t:if>
+ <t:if test="forward"><a class="equandaTraverseForward" href="javascript:;" onclick="equandaTabsClick( $('${id}t${forward}'), $('${id}c${forward}') );">next</a></t:if>
+ </div>
+ </div>
</t:loop>
</div>
Deleted: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/domtab.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/domtab.js 2007-11-28 10:20:37 UTC (rev 180)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/domtab.js 2007-11-28 23:34:47 UTC (rev 181)
@@ -1,261 +0,0 @@
-/*
- DOMtab Version 3.1415927
- Updated March the First 2006
- written by Christian Heilmann
- check blog for updates: http://www.wait-till-i.com
- free to use, not free to resell
- with some fixes to check for boundary cases
-*/
-
-domtab={
- tabClass:'domtab', // class to trigger tabbing
- listClass:'domtabs', // class of the menus
- activeClass:'active', // class of current link
- contentElements:'div', // elements to loop through
- backToLinks:/#top/, // pattern to check "back to top" links
- printID:'domtabprintview', // id of the print all link
- showAllLinkText:'show all content', // text for the print all link
- prevNextIndicator:'doprevnext', // class to trigger prev and next links
- prevNextClass:'prevnext', // class of the prev and next list
- prevLabel:'previous', // HTML content of the prev link
- nextLabel:'next', // HTML content of the next link
- prevClass:'prev', // class for the prev link
- nextClass:'next', // class for the next link
- init:function(){
- var temp;
- if(!document.getElementById || !document.createTextNode){return;}
- var tempelm=document.getElementsByTagName('div');
- for(var i=0;i<tempelm.length;i++){
- if(!domtab.cssjs('check',tempelm[i],domtab.tabClass)){continue;}
- domtab.initTabMenu(tempelm[i]);
- domtab.removeBackLinks(tempelm[i]);
- if(domtab.cssjs('check',tempelm[i],domtab.prevNextIndicator)){
- domtab.addPrevNext(tempelm[i]);
- }
- domtab.checkURL();
- }
- if(document.getElementById(domtab.printID)
- && !document.getElementById(domtab.printID).getElementsByTagName('a')[0]){
- var newlink=document.createElement('a');
- newlink.setAttribute('href','#');
- domtab.addEvent(newlink,'click',domtab.showAll,false);
- newlink.onclick=function(){return false;} // safari hack
- newlink.appendChild(document.createTextNode(domtab.showAllLinkText));
- document.getElementById(domtab.printID).appendChild(newlink);
- }
- },
- checkURL:function(){
- var id;
- var loc=window.location.toString();
- loc=/#/.test(loc)?loc.match(/#(\w.+)/)[1]:'';
- if(loc==''){return;}
- var elm=document.getElementById(loc);
- if(!elm){return;}
- var parentMenu=elm.parentNode.parentNode.parentNode;
- parentMenu.currentSection=loc;
- parentMenu.getElementsByTagName(domtab.contentElements)[0].style.display='none';
- domtab.cssjs('remove',parentMenu.getElementsByTagName('a')[0].parentNode,domtab.activeClass);
- var links=parentMenu.getElementsByTagName('a');
- for(i=0;i<links.length;i++){
- if(!links[i].getAttribute('href')){continue;}
- id=links[i].href.match(/#(\w.+)/)[1];
- if(id==loc){
- var cur=links[i].parentNode.parentNode;
- domtab.cssjs('add',links[i].parentNode,domtab.activeClass);
- break;
- }
- }
- domtab.changeTab(elm,1);
- elm.focus();
- cur.currentLink=links[i];
- cur.currentSection=loc;
- },
- showAll:function(e){
- document.getElementById(domtab.printID).parentNode.removeChild(document.getElementById(domtab.printID));
- var tempelm=document.getElementsByTagName('div');
- for(var i=0;i<tempelm.length;i++){
- if(!domtab.cssjs('check',tempelm[i],domtab.tabClass)){continue;}
- var sec=tempelm[i].getElementsByTagName(domtab.contentElements);
- for(var j=0;j<sec.length;j++){
- sec[j].style.display='block';
- }
- }
- var tempelm=document.getElementsByTagName('ul');
- for(i=0;i<tempelm.length;i++){
- if(!domtab.cssjs('check',tempelm[i],domtab.prevNextClass)){continue;}
- tempelm[i].parentNode.removeChild(tempelm[i]);
- i--;
- }
- domtab.cancelClick(e);
- },
- addPrevNext:function(menu){
- var temp;
- var sections=menu.getElementsByTagName(domtab.contentElements);
- for(var i=0;i<sections.length;i++){
- temp=domtab.createPrevNext();
- if(i==0){
- temp.removeChild(temp.getElementsByTagName('li')[0]);
- }
- if(i==sections.length-1){
- temp.removeChild(temp.getElementsByTagName('li')[1]);
- }
- temp.i=i; // h4xx0r!
- temp.menu=menu;
- sections[i].appendChild(temp);
- }
- },
- removeBackLinks:function(menu){
- var links=menu.getElementsByTagName('a');
- for(var i=0;i<links.length;i++){
- if(!domtab.backToLinks.test(links[i].href)){continue;}
- links[i].parentNode.removeChild(links[i]);
- i--;
- }
- },
- initTabMenu:function(menu){
- var id;
- var lists=menu.getElementsByTagName('ul');
- for(var i=0;i<lists.length;i++){
- if(domtab.cssjs('check',lists[i],domtab.listClass)){
- var thismenu=lists[i];
- break;
- }
- }
- if(!thismenu){return;}
- thismenu.currentSection='';
- thismenu.currentLink='';
- var links=thismenu.getElementsByTagName('a');
- var first=true;
- for(i=0;i<links.length;i++){
- if(!links[i].getAttribute('href')){continue;}
- id=links[i].href.match(/#(\w.+)/)[1];
- if(document.getElementById(id)){
- domtab.addEvent(links[i],'click',domtab.showTab,false);
- links[i].onclick=function(){return false;} // safari hack
- if (first)
- {
- domtab.changeTab(document.getElementById(id),1);
- thismenu.currentSection=id;
- thismenu.currentLink=links[i];
- domtab.cssjs('add',links[i].parentNode,domtab.activeClass);
- first=false;
- }
- else
- {
- domtab.changeTab(document.getElementById(id),0);
- }
- }
- }
- },
- createPrevNext:function(){
- // this would be so much easier with innerHTML, darn you standards fetish!
- var temp=document.createElement('ul');
- temp.className=domtab.prevNextClass;
- temp.appendChild(document.createElement('li'));
- temp.getElementsByTagName('li')[0].appendChild(document.createElement('a'));
- temp.getElementsByTagName('a')[0].setAttribute('href','#');
- temp.getElementsByTagName('a')[0].innerHTML=domtab.prevLabel;
- temp.getElementsByTagName('li')[0].className=domtab.prevClass;
- temp.appendChild(document.createElement('li'));
- temp.getElementsByTagName('li')[1].appendChild(document.createElement('a'));
- temp.getElementsByTagName('a')[1].setAttribute('href','#');
- temp.getElementsByTagName('a')[1].innerHTML=domtab.nextLabel;
- temp.getElementsByTagName('li')[1].className=domtab.nextClass;
- domtab.addEvent(temp.getElementsByTagName('a')[0],'click',domtab.navTabs,false);
- domtab.addEvent(temp.getElementsByTagName('a')[1],'click',domtab.navTabs,false);
- // safari fix
- temp.getElementsByTagName('a')[0].onclick=function(){return false;}
- temp.getElementsByTagName('a')[1].onclick=function(){return false;}
- return temp;
- },
- navTabs:function(e){
- var li=domtab.getTarget(e);
- var menu=li.parentNode.parentNode.menu;
- var count=li.parentNode.parentNode.i;
- var section=menu.getElementsByTagName(domtab.contentElements);
- var links=menu.getElementsByTagName('a');
- var othercount=(li.parentNode.className==domtab.prevClass)?count-1:count+1;
- section[count].style.display='none';
- domtab.cssjs('remove',links[count].parentNode,domtab.activeClass);
- section[othercount].style.display='block';
- domtab.cssjs('add',links[othercount].parentNode,domtab.activeClass);
- var parent=links[count].parentNode.parentNode;
- parent.currentLink=links[othercount];
- parent.currentSection=links[othercount].href.match(/#(\w.+)/)[1];
- domtab.cancelClick(e);
- },
- changeTab:function(elm,state){
- do{
- elm=elm.parentNode;
- } while(elm.nodeName.toLowerCase()!=domtab.contentElements)
- elm.style.display=state==0?'none':'block';
- },
- showTab:function(e){
- var o=domtab.getTarget(e);
- if(o.parentNode.parentNode.currentSection!=''){
- domtab.changeTab(document.getElementById(o.parentNode.parentNode.currentSection),0);
- domtab.cssjs('remove',o.parentNode.parentNode.currentLink.parentNode,domtab.activeClass);
- }
- var id=o.href.match(/#(\w.+)/)[1];
- o.parentNode.parentNode.currentSection=id;
- o.parentNode.parentNode.currentLink=o;
- domtab.cssjs('add',o.parentNode,domtab.activeClass);
- domtab.changeTab(document.getElementById(id),1);
- document.getElementById(id).focus();
- domtab.cancelClick(e);
- },
-/* helper methods */
- getTarget:function(e){
- var target = window.event ? window.event.srcElement : e ? e.target : null;
- if (!target){return false;}
- if (target.nodeName.toLowerCase() != 'a'){target = target.parentNode;}
- return target;
- },
- cancelClick:function(e){
- if (window.event){
- window.event.cancelBubble = true;
- window.event.returnValue = false;
- return;
- }
- if (e){
- e.stopPropagation();
- e.preventDefault();
- }
- },
- addEvent: function(elm, evType, fn, useCapture){
- if (elm.addEventListener)
- {
- elm.addEventListener(evType, fn, useCapture);
- return true;
- } else if (elm.attachEvent) {
- var r = elm.attachEvent('on' + evType, fn);
- return r;
- } else {
- elm['on' + evType] = fn;
- }
- },
- cssjs:function(a,o,c1,c2){
- switch (a){
- case 'swap':
- o.className=!domtab.cssjs('check',o,c1)?o.className.replace(c2,c1):o.className.replace(c1,c2);
- break;
- case 'add':
- if(!domtab.cssjs('check',o,c1)){o.className+=o.className?' '+c1:c1;}
- break;
- case 'remove':
- var rep=o.className.match(' '+c1)?' '+c1:c1;
- o.className=o.className.replace(rep,'');
- break;
- case 'check':
- var found=false;
- var temparray=o.className.split(' ');
- for(var i=0;i<temparray.length;i++){
- if(temparray[i]==c1){found=true;}
- }
- return found;
- break;
- }
- }
-}
-domtab.addEvent(window, 'load', domtab.init, false);
-
Added: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js (rev 0)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js 2007-11-28 23:34:47 UTC (rev 181)
@@ -0,0 +1,16 @@
+var EQUANDA_TABS_ACTIVE = "equandaTabsActive";
+var EQUANDA_TABS_ALL = "equandaTabsAll";
+
+function equandaTabsClick( title, content )
+{
+ if ( !title.hasClassName( EQUANDA_TABS_ACTIVE ) )
+ {
+ title.addClassName( EQUANDA_TABS_ACTIVE );
+ title.up().siblings().each( function rem( el ) { el.down().removeClassName( EQUANDA_TABS_ACTIVE ); } );
+ content.style.display = "block";
+ content.siblings().each( function rem( el ) {
+ if ( !el.hasClassName( EQUANDA_TABS_ALL ) ) el.style.display = "none";
+ } );
+ }
+ return false;
+}
\ No newline at end of file
Modified: trunk/equanda-tapestry5/src/site/wiki/tabs.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/tabs.wiki 2007-11-28 10:20:37 UTC (rev 180)
+++ trunk/equanda-tapestry5/src/site/wiki/tabs.wiki 2007-11-28 23:34:47 UTC (rev 181)
@@ -1,8 +1,8 @@
h1. Tabs
-A tabs component which allows grouping objects in tab pages, based on the [domtab|http://www.onlinetools.org/tools/domtabdata/] library.
+A tabs component which allows grouping objects in tab pages.
-You have to pass the title and content panes as parameters to the accordion component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
+You have to pass the title and content panes as parameters to the tabs component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
{code}
<span t:type="equanda/Tabs" t:id="tabs">
@@ -26,24 +26,24 @@
How the tabs are displayed is handled using CSS. Below is an example of styling for the CSS.
{code}
-div.domtab {
+.equandaTabs {
padding:0 3em;
width:80%;
}
-ul.domtabs {
+.equandaTabsTitles {
float:left;
width:100%;
margin: 0 0 0 0;
list-style:none;
}
-ul.domtabs li {
+.equandaTabsTitles li {
float:left;
padding:0 .5em 0 0;
}
-ul.domtabs a:link,
-ul.domtabs a:visited,
-ul.domtabs a:active,
-ul.domtabs a:hover {
+.equandaTabsTitles a:link,
+.equandaTabsTitles a:visited,
+.equandaTabsTitles a:active,
+.equandaTabsTitles a:hover {
width:8em;
padding:.2em 1em;
display:block;
@@ -52,11 +52,11 @@
font-weight:bold;
text-decoration:none;
}
-ul.domtabs a:hover {
+.equandaTabsTitles a:hover {
background:gray;
color:white;
}
-div.domtab div {
+.equandaTabsPanelContent div {
clear:both;
width:auto;
background:white;
@@ -64,10 +64,10 @@
color:black;
padding:1em 3em;
}
-ul.domtabs li.active a:link,
-ul.domtabs li.active a:visited,
-ul.domtabs li.active a:active,
-ul.domtabs li.active a:hover {
+.equandaTabsActive a:link,
+.equandaTabsActivea:visited,
+.equandaTabsActive a:active,
+.equandaTabsActive a:hover {
background:black;
color:white;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-28 10:20:40
|
Revision: 180
http://equanda.svn.sourceforge.net/equanda/?rev=180&view=rev
Author: triathlon98
Date: 2007-11-28 02:20:37 -0800 (Wed, 28 Nov 2007)
Log Message:
-----------
EQ-93 add utility script
Modified Paths:
--------------
trunk/equanda-tapestry5/src/site/wiki/index.wiki
Added Paths:
-----------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js
trunk/equanda-tapestry5/src/site/wiki/script.wiki
Added: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java (rev 0)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java 2007-11-28 10:20:37 UTC (rev 180)
@@ -0,0 +1,62 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.tapestry5.components;
+
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.annotations.Path;
+import org.apache.tapestry.annotations.BeginRender;
+import org.apache.tapestry.annotations.AfterRender;
+import org.apache.tapestry.annotations.Environmental;
+import org.apache.tapestry.Asset;
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.PageRenderSupport;
+
+/**
+ * When this component is added on the page, the tab and enter keys work differently to assure a better user experience.
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class FormTraversal
+{
+ @Inject
+ @Path( "classpath:/org/equanda/tapestry5/resources/formtraversal.js" )
+ private Asset script;
+
+ @Environmental
+ private PageRenderSupport pageRenderSupport;
+
+ @BeginRender
+ boolean doBeginRender( MarkupWriter writer )
+ {
+ pageRenderSupport.addScriptLink( script );
+ return false;
+ }
+
+ @AfterRender
+ void doAfterRender( MarkupWriter writer )
+ {
+ pageRenderSupport.addScript( "equandaFtFocus(); equandaFtInit();" );
+ }
+}
Added: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js (rev 0)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/equanda.js 2007-11-28 10:20:37 UTC (rev 180)
@@ -0,0 +1,36 @@
+// get window height (browser independent)
+
+function equandaWindowHeight()
+{
+ var height = 0;
+ if( typeof( window.innerWidth ) == 'number' ) {
+ //Non-IE
+ height = window.innerHeight;
+ } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
+ //IE 6+ in 'standards compliant mode'
+ height = document.documentElement.clientHeight;
+ } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
+ //IE 4 compatible
+ height = document.body.clientHeight;
+ }
+ return height;
+}
+
+
+// convert case, use as onkeyup="equandaConvertCase( this, 2);"
+// second parameter is 0 for no conversion, 1 for all lower case, 2 for all upper case
+
+function equandaConvertCase( element, caseConversion )
+{
+ if ( element.value.length == 0 ) return;
+ var start = element.selectionStart;
+ var end = element.selectionEnd;
+ if ( caseConversion == 2 ) element.value = element.value.toUpperCase();
+ if ( caseConversion == 1 ) element.value = element.value.toLowerCase();
+ if ( start != null && end != null )
+ {
+ element.selectionStart = start;
+ element.selectionEnd = end;
+ }
+ return element.value;
+}
Modified: trunk/equanda-tapestry5/src/site/wiki/index.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/index.wiki 2007-11-28 10:02:16 UTC (rev 179)
+++ trunk/equanda-tapestry5/src/site/wiki/index.wiki 2007-11-28 10:20:37 UTC (rev 180)
@@ -6,8 +6,10 @@
The following components are provided
- [Accordion|accordion.html]
- [Tabs|tabs.html]
-- ...
+- [FormTraversal|formtraversal.html]
Useful services, translators and other
- DoubleTranslator : assures both dot or comma can be used as decimal seperator.
- TimestampTranslator : translator for using java.sql.Timestamp values.
+- [useful scripts|script.html]
+
Added: trunk/equanda-tapestry5/src/site/wiki/script.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/script.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/script.wiki 2007-11-28 10:20:37 UTC (rev 180)
@@ -0,0 +1,32 @@
+h1. equanda provided scripts
+
+h2. equanda.js
+
+Can be used by adding the following in your page class :
+{code}
+@Inject
+@Path( "classpath:/org/equanda/tapestry5/resources/equanda.js" )
+private Asset equandaJs;
+
+public Asset getEquandaJs() { return equandaJs; }
+{code}
+And using this in your template as (in the "head" section) :
+{code}
+<script src="${equandaJs}" language="javascript" type="text/javascript" />
+{code}
+
+It provides the following javascript functions
+
+h3. equandaWindowHeight()
+
+Get the browser window height (browser independent). This can for example be used to assure an [Accordion|accordion.html] fills the height of the window.
+
+h3. equandaConvertCase()
+
+This function allow automatic case conversion on a input field. Use by adding a onkeyup event (extra parameter) handler on the input component.
+{code}
+onkeyup="equandaConvertCase( this, 2);"
+{code}
+This function eight does expects the form element to work on, and a value indicating how to convert the case.
+- 1 : convert everything to lower case
+- 2 : convert everything to upper case
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-28 10:02:20
|
Revision: 179
http://equanda.svn.sourceforge.net/equanda/?rev=179&view=rev
Author: triathlon98
Date: 2007-11-28 02:02:16 -0800 (Wed, 28 Nov 2007)
Log Message:
-----------
EQ-92 add FomrTraversal component
Added Paths:
-----------
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js
Added: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js (rev 0)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/formtraversal.js 2007-11-28 10:02:16 UTC (rev 179)
@@ -0,0 +1,324 @@
+// assure first item in form gets focus
+
+function equandaFtFocus()
+{
+ var form=document.forms[0];
+ if (form!=null)
+ {
+ var i, tr, td, elem, tbody;
+ for (i=0; i<form.elements.length; i++)
+ {
+ elem=form.elements[i];
+ if (((elem.tagName=="INPUT" ) && ((elem.type=="text") || (elem.type=="checkbox"))) || (elem.tagName=="SELECT"))
+ {
+ if ((elem.style.display!="none") && !(elem.disabled) && (elem.className!="nodisplay"))
+ {
+ td=elem.parentNode;
+ tr=td.parentNode;
+ tbody=tr.parentNode;
+ if ((td.style.display!="none") && (td.className!="displayNone") && (tr.style.display!="none") && (tr.className!="displayNone") && (tbody.style.display!="none") && (tbody.className!="displayNone"))
+ {
+ elem.focus();
+ if (elem.tagName=="INPUT") elem.select();
+ break;
+ }
+ }
+ }
+ }
+ }
+}
+
+// form traversal
+
+var equandaFt_SUBMIT_CLASS = "submitButton";
+var equandaFt_SKIP_FIELD_CLASS = "skipField";
+var equandaFtLastKeyTime = null;
+var equandaFt_MAX_DEPTH_CHECK_VISIBILITY = 10;
+// check so many parents to be visible
+
+function equandaFtInit()
+{
+ var agt = navigator.userAgent.toLowerCase();
+ if ( agt.indexOf('msie') != -1 || agt.indexOf('opera') != -1 )
+ {
+ // there is a problem with shift/ctrl keys to detect when they are pressed
+ // onkeydown=shift key can be checked (ctrl+enter doesn't work)
+ // onkeypress=ctrl key can be checked (shift+tab acts as default)
+ // document.onkeydown = KeyHandlerIE;
+ document.onkeypress = equandaFtKeyHandlerIE;
+ }
+ if ( agt.indexOf('gecko') != -1 )
+ {
+ document.onkeypress = equandaFtKeyHandlerNetscape;
+ }
+}
+
+function equandaFtGetStyleClass( element )
+{
+ var nav = !(window.Event);
+ if ( nav )
+ return element.getAttribute("class");
+ else
+ return element.getAttribute("className");
+}
+
+function equandaFtGetCssRules( styleSheet )
+{
+ var nav = !(window.Event);
+ if ( nav )
+ return styleSheet.cssRules ? styleSheet.cssRules : null;
+ else
+ return styleSheet.rules;
+}
+
+function equandaFtClassDisplayNone( className )
+{
+ var i, j;
+ for ( i = 0 ; i < document.styleSheets.length ; i++ )
+ {
+ var rules = equandaFtGetCssRules(document.styleSheets[i]);
+ for ( j = 0 ; j < rules.length ; j++ )
+ {
+ var name = rules[j].selectorText;
+ if ( name != null )
+ if ( ( (name.substring(1) == className) && (name.charAt(0) == '.' )) ||
+ ( name.selectorText == className ) )
+ {
+ return rules[j].style.display == "none";
+ }
+ }
+ }
+ return false;
+}
+
+function equandaFtHasClass( element, _className )
+{
+ var classes = equandaFtGetStyleClass(element);
+ if ( classes == null || classes == "" ) return false;
+ while ( 1 == 1 )
+ {
+ if ( classes.indexOf(" ") == -1 )
+ {
+ if ( classes == _className ) return true;
+ break;
+ }
+ else
+ {
+ var className = classes.substring(0, classes.indexOf(" "));
+ if ( className == _className ) return true;
+ classes = classes.substring(classes.indexOf(" ") + 1);
+ }
+ }
+ return false;
+}
+
+function equandaFtIsVisible( element )
+{
+ var depth = equandaFt_MAX_DEPTH_CHECK_VISIBILITY;
+ while ( depth > 0 && element != null && element.tagName != "FORM" )
+ {
+ depth--;
+ if ( element.style.display == "none" ) return false;
+ var classes = equandaFtGetStyleClass(element);
+ if ( classes != null && classes != "" )
+ {
+ while ( true )
+ {
+ if ( classes.indexOf(" ") == -1 )
+ {
+ if ( equandaFtClassDisplayNone(classes) ) return false;
+ if ( classes == equandaFt_SKIP_FIELD_CLASS ) return false;
+ break;
+ }
+ else
+ {
+ // Commented the next 2 lines.
+ // This is for the case of class="tabset_content tabset_content_active" in tabtastic.
+ // (I think it's correct to consider only the last class, like "tabset_content_active" in this case)
+
+ // var className = classes.substring(0, classes.indexOf(" "));
+ // if ( classDisplayNone(className)==true ) return false;
+ classes = classes.substring(classes.indexOf(" ") + 1);
+ }
+ }
+ }
+ element = element.parentNode;
+ }
+ return true;
+}
+
+function equandaFtNetscapeKeyHandler( input, event )
+{
+ var pos, i;
+ equandaFtLastKeyTime = new Date();
+ if ( input.form )
+ {
+ if ( event.which == 13 && event.ctrlKey )
+ {
+ pos = equandaFtGetIndex(input);
+ var btn = null;
+ if ( pos + 1 == input.form.length ) pos = 0;
+ for ( i = pos + 1 ; i != pos ; i++ )
+ {
+ if ( ( input.form[i].type == "submit" || input.form[i].type == "button" ) &&
+ !(input.form[i].disabled) && input.form[i].style.display != "none" )
+ {
+ if ( btn == null ) btn = input.form[i];
+ if ( equandaFtHasClass(input.form[i], equandaFt_SUBMIT_CLASS) )
+ {
+ input.form[i].click();
+ return false;
+ }
+ }
+ if ( i == input.form.length - 1 ) i = -1;
+ }
+ if ( btn != null )
+ {
+ btn.click();
+ return false;
+ }
+ return false;
+ }
+ if ( event.which == 13 || event.keyCode == 9 )
+ {
+ if ( event.which == 13 &&
+ ( (( input.type == "submit" ) || ( input.type == "button" )) && equandaFtHasClass(input, equandaFt_SUBMIT_CLASS) ) )
+ {
+ input.click();
+ return false;
+ }
+ if ( event.which == 13 && input.tagName == 'TEXTAREA' )
+ {
+ return true;
+ }
+ var direction = 1;
+ if ( event.shiftKey ) direction = -1;
+ pos = ( equandaFtGetIndex(input) + direction ) % input.form.length;
+ if ( pos == -1 ) pos = input.form.length - 1;
+ while ( 1 == 1 )
+ {
+ if ( !input.form[ pos ].type )
+ pos += direction;
+ else if ( input.form[ pos ].type == "hidden" )
+ pos += direction;
+ else if ( input.form[ pos ].disabled )
+ pos += direction;
+ else if ( input.form[ pos ].style.display == "none" )
+ pos += direction;
+ else if ( !equandaFtIsVisible(input.form[ pos ] ) )
+ pos += direction;
+ else
+ break;
+ if ( pos == input.form.length ) pos = 0;
+ if ( pos == -1 ) pos = input.form.length - 1;
+ }
+ input.form[ pos ].focus();
+ return false;
+ }
+ }
+ return true;
+}
+
+function equandaFtMicrosoftKeyHandler( input )
+{
+ var pos, i;
+ equandaFtLastKeyTime = new Date();
+ if ( event.keyCode == 10 && event.ctrlKey )
+ {
+ pos = equandaFtGetIndex(input);
+ var btn = null;
+ if ( pos + 1 == input.form.length ) pos = 0;
+ for ( i = pos + 1 ; i != pos ; i++ )
+ {
+ if ( ( input.form[i].type == "submit" || input.form[i].type == "button" ) &&
+ !(input.form[i].disabled) && input.form[i].style.display != "none" )
+ {
+ if ( btn == null ) btn = input.form[i];
+ if ( equandaFtHasClass(input.form[i], equandaFt_SUBMIT_CLASS) )
+ {
+ input.form[i].click();
+ return true;
+ }
+ }
+ if ( i == input.form.length - 1 ) i = -1;
+ }
+ if ( btn != null )
+ {
+ btn.click();
+ return true;
+ }
+ return true;
+ }
+ if ( event.keyCode == 13 || event.keyCode == 9 )
+ {
+ if ( event.keyCode == 13 &&
+ ( (( input.type == "submit" ) || ( input.type == "button" )) && equandaFtHasClass(input, equandaFt_SUBMIT_CLASS) ) )
+ {
+ input.form[pos].click();
+ return false;
+ }
+ if ( event.keyCode == 13 && input.tagName == 'TEXTAREA' )
+ {
+ return true;
+ }
+ var direction = 1;
+ if ( event.shiftKey ) direction = -1;
+ pos = ( equandaFtGetIndex(input) + direction) % input.form.length;
+ if ( pos == -1 ) pos = input.form.length - 1;
+ while ( 1 == 1 )
+ {
+ if ( !input.form[ pos ].type )
+ pos += direction;
+ else if ( input.form[ pos ].type == "hidden" )
+ pos += direction;
+ else if ( input.form[ pos ].disabled )
+ pos += direction;
+ else if ( input.form[ pos ].style.display == "none" )
+ pos += direction;
+ else if ( !equandaFtIsVisible(input.form[ pos ] ) )
+ pos += direction;
+ else
+ break;
+ if ( pos == input.form.length ) pos = 0;
+ if ( pos == -1 ) pos = input.form.length - 1;
+ }
+ input.form[ pos ].focus();
+ input = input.form[pos];
+ if ( input.type == "text" )
+ {
+ if ( input.createTextRange )
+ {
+ var v = input.value;
+ var r = input.createTextRange();
+ r.moveStart('character', v.length);
+ r.select();
+ }
+ }
+ return false;
+ }
+ return true;
+}
+
+function equandaFtGetIndex( input )
+{
+ if ( input.form != null )
+ {
+ var index = -1, i = 0;
+ while ( i < input.form.length && index == -1 )
+ if ( input.form[i] == input ) index = i;
+ else i++;
+ return index;
+ }
+ return 0;
+}
+
+function equandaFtKeyHandlerIE()
+{
+ var target = event.target ? event.target : window.event.srcElement;
+ return equandaFtMicrosoftKeyHandler(target);
+}
+function equandaFtKeyHandlerNetscape( event )
+{
+ var target = event.target ? event.target : window.event.srcElement;
+ return equandaFtNetscapeKeyHandler(target, event);
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-27 16:45:14
|
Revision: 178
http://equanda.svn.sourceforge.net/equanda/?rev=178&view=rev
Author: triathlon98
Date: 2007-11-27 08:45:06 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
EQ-90 add equandaCreationDate access in proxies
Modified Paths:
--------------
trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaEntity.java
trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaMediatorRoot.java
trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaProxyState.java
trunk/equanda-generate/src/main/velocity/ejb3/ObjectBean.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaEntity.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaEntity.java 2007-11-27 16:44:22 UTC (rev 177)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaEntity.java 2007-11-27 16:45:06 UTC (rev 178)
@@ -41,6 +41,8 @@
Timestamp getEquandaModificationDate();
+ Timestamp getEquandaCreationDate();
+
void setEquandaModificationDate( Timestamp modified );
String getEquandaType();
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaMediatorRoot.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaMediatorRoot.java 2007-11-27 16:44:22 UTC (rev 177)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaMediatorRoot.java 2007-11-27 16:45:06 UTC (rev 178)
@@ -51,6 +51,7 @@
public UOID getUOID() { return entity.getUOID(); }
public String getEquandaType() { String type=entity.getEquandaType(); if (type.length()>4) type=type.substring(0,4); return type; }
public java.sql.Timestamp getEquandaModificationDate() { return entity.getEquandaModificationDate(); }
+ public java.sql.Timestamp getEquandaCreationDate() { return entity.getEquandaCreationDate(); }
public long getEquandaVersion() { return entity.getEquandaVersion(); }
public String getEquandaStatus()
{
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaProxyState.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaProxyState.java 2007-11-27 16:44:22 UTC (rev 177)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaProxyState.java 2007-11-27 16:45:06 UTC (rev 178)
@@ -37,6 +37,7 @@
{
public UOID uoid;
public ObjectType equandaType;
+ public Timestamp equandaCreationDate;
public Timestamp equandaModificationDate;
public long equandaVersion;
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ObjectBean.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ObjectBean.java.vm 2007-11-27 16:44:22 UTC (rev 177)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ObjectBean.java.vm 2007-11-27 16:45:06 UTC (rev 178)
@@ -381,7 +381,7 @@
{
mediator.init( entityManager );
- return ObjectUpdater.get${table.Name}( getUOID() , mediator.getEquandaTypeObject(), mediator.getEquandaModificationDate(), mediator.getEquandaStatus(), mediator.getEquandaVersion()
+ return ObjectUpdater.get${table.Name}( getUOID() , mediator.getEquandaTypeObject(), mediator.getEquandaCreationDate(), mediator.getEquandaModificationDate(), mediator.getEquandaStatus(), mediator.getEquandaVersion()
#foreach ($field in $table.Fields)
#if( !$field.isLink() && !$field.isMultiple() ) , mediator.get${field.Name}() #end
#end
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2007-11-27 16:44:22 UTC (rev 177)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2007-11-27 16:45:06 UTC (rev 178)
@@ -69,7 +69,7 @@
public ${table.Name} clone( boolean cloneUoid )
{
${table.Name} clone = new ${table.Name}();
- clone.proxy = new ${table.Name}State( cloneUoid ? uoid : null, equandaType.getType(), equandaModificationDate, equandaVersion );
+ clone.proxy = new ${table.Name}State( cloneUoid ? uoid : null, equandaType.getType(), proxy.equandaCreationDate, equandaModificationDate, equandaVersion );
clone.updateInternalState();
// clone fields
#foreach ($field in $table.Fields)
@@ -210,11 +210,11 @@
}
#end
- protected ${table.Name}(UOID uoid, ObjectType equandaType, java.sql.Timestamp equandaModificationDate, String equandaStatus, long equandaVersion
+ protected ${table.Name}(UOID uoid, ObjectType equandaType, java.sql.Timestamp equandaCreationDate, java.sql.Timestamp equandaModificationDate, String equandaStatus, long equandaVersion
#foreach ($field in $table.Fields) #if( !$field.isLink() && !$field.isMultiple() ) , $field.JavaFieldType $field.VarName #end
#end )
{
- proxy = new ${table.Name}State( uoid, equandaType.getType(), equandaModificationDate, equandaVersion);
+ proxy = new ${table.Name}State( uoid, equandaType.getType(), equandaCreationDate, equandaModificationDate, equandaVersion);
proxy.equandaStatus = equandaStatus;
#foreach ($field in $table.Fields)
#if( !$field.isLink() && !$field.isMultiple() )
@@ -311,6 +311,8 @@
}
}
+ public java.sql.Timestamp getEquandaCreationDate() { return proxy.equandaCreationDate; }
+
#foreach ($field in $table.Fields)
#if( !$field.isInternal() )
#set( $fieldtype=$field.JavaFieldType )
@@ -545,7 +547,7 @@
if ( proxy.uoid == null || isModified() )
{
- proxy = sel.equandaCreate( type ).proxy;
+ proxy = sel.equandaCreate( equandaType.getType() ).proxy;
}
else if ( !isModified() )
{
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm 2007-11-27 16:44:22 UTC (rev 177)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm 2007-11-27 16:45:06 UTC (rev 178)
@@ -62,12 +62,13 @@
this.uoid = null;
}
- public ${table.Name}State( UOID uoid, String equandaType, java.sql.Timestamp equandaModificationDate, long equandaVersion )
+ public ${table.Name}State( UOID uoid, String equandaType, java.sql.Timestamp equandaCreationDate, java.sql.Timestamp equandaModificationDate, long equandaVersion )
{
setEquandaType( equandaType );
- this.uoid=uoid;
- this.equandaModificationDate=equandaModificationDate;
- this.equandaVersion=equandaVersion;
+ this.uoid = uoid;
+ this.equandaCreationDate = equandaCreationDate;
+ this.equandaModificationDate = equandaModificationDate;
+ this.equandaVersion = equandaVersion;
}
public void setEquandaType( String type )
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2007-11-27 16:44:22 UTC (rev 177)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2007-11-27 16:45:06 UTC (rev 178)
@@ -235,14 +235,14 @@
}
}
- public static ${table.Name} get${table.Name}(UOID uoid, ObjectType equandaType, java.sql.Timestamp equandaModificationDate, String equandaStatus, long equandaVersion
+ public static ${table.Name} get${table.Name}(UOID uoid, ObjectType equandaType, java.sql.Timestamp equandaCreationDate, java.sql.Timestamp equandaModificationDate, String equandaStatus, long equandaVersion
#foreach ($field in $table.Fields)
#if( !$field.isLink() && !$field.isMultiple() )
, $field.JavaFieldType $field.VarName
#end
#end
) {
- return new ${table.Name}( uoid, equandaType, equandaModificationDate, equandaStatus, equandaVersion
+ return new ${table.Name}( uoid, equandaType, equandaCreationDate, equandaModificationDate, equandaStatus, equandaVersion
#foreach($field in $table.Fields)
#if( !$field.isLink() && !$field.isMultiple() ) , $field.VarName #end
#end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-27 16:44:25
|
Revision: 177
http://equanda.svn.sourceforge.net/equanda/?rev=177&view=rev
Author: triathlon98
Date: 2007-11-27 08:44:22 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
EQ-91 TimestampTranslator
Modified Paths:
--------------
trunk/equanda-tapestry5/src/site/wiki/index.wiki
Modified: trunk/equanda-tapestry5/src/site/wiki/index.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/index.wiki 2007-11-27 16:42:28 UTC (rev 176)
+++ trunk/equanda-tapestry5/src/site/wiki/index.wiki 2007-11-27 16:44:22 UTC (rev 177)
@@ -7,3 +7,7 @@
- [Accordion|accordion.html]
- [Tabs|tabs.html]
- ...
+
+Useful services, translators and other
+- DoubleTranslator : assures both dot or comma can be used as decimal seperator.
+- TimestampTranslator : translator for using java.sql.Timestamp values.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-27 16:42:37
|
Revision: 176
http://equanda.svn.sourceforge.net/equanda/?rev=176&view=rev
Author: triathlon98
Date: 2007-11-27 08:42:28 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
EQ-91 TimestampTranslator
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/DoubleTranslator.java
Added Paths:
-----------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/TimestampTranslator.java
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java 2007-11-27 14:05:21 UTC (rev 175)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java 2007-11-27 16:42:28 UTC (rev 176)
@@ -29,7 +29,10 @@
import org.apache.tapestry.ioc.MappedConfiguration;
import org.apache.tapestry.services.LibraryMapping;
import org.equanda.tapestry5.translators.DoubleTranslator;
+import org.equanda.tapestry5.translators.TimestampTranslator;
+import java.sql.Timestamp;
+
/**
* Module definition
*
@@ -46,6 +49,7 @@
* Contributes the following translators:
* <ul>
* <li>Double : which allows both both and comma as decimal seperator</li>
+ * <li>Timestamp : translator for timestamp values</li>
* </ul>
*
* @param configuration configuration to add to
@@ -53,6 +57,7 @@
public static void contributeTranslatorDefaultSource( MappedConfiguration<Class, Translator> configuration)
{
configuration.add(Double.class, new DoubleTranslator());
+ configuration.add( Timestamp.class, new TimestampTranslator());
}
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/DoubleTranslator.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/DoubleTranslator.java 2007-11-27 14:05:21 UTC (rev 175)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/DoubleTranslator.java 2007-11-27 16:42:28 UTC (rev 176)
@@ -1,16 +1,26 @@
-// Copyright 2007 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
package org.equanda.tapestry5.translators;
@@ -19,6 +29,11 @@
import org.apache.tapestry.ioc.Messages;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
+/**
+ * Tapestry translator for double values, assures both point or comma can be used as decimal separator.
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
public class DoubleTranslator
implements Translator<Double>
{
Added: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/TimestampTranslator.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/TimestampTranslator.java (rev 0)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/TimestampTranslator.java 2007-11-27 16:42:28 UTC (rev 176)
@@ -0,0 +1,72 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.tapestry5.translators;
+
+import org.apache.tapestry.Translator;
+import org.apache.tapestry.ValidationException;
+import org.apache.tapestry.ioc.Messages;
+import org.apache.tapestry.ioc.internal.util.InternalUtils;
+
+import java.sql.Timestamp;
+
+/**
+ * Tapestry translator for Timestamp values.
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class TimestampTranslator
+ implements Translator<Timestamp>
+{
+ /**
+ * Parses blank values to null, otherwise parses the client value to a Timestamp
+ *
+ * @throws ValidationException if the clientValue can not be parsed
+ */
+ public Timestamp parseClient( String clientValue, Messages messages )
+ throws ValidationException
+ {
+ if ( InternalUtils.isBlank( clientValue ) )
+ {
+ return null;
+ }
+
+ try
+ {
+ return new Timestamp( Timestamp.parse( clientValue.trim() ) );
+ }
+ catch ( NumberFormatException ex )
+ {
+ throw new ValidationException( messages.format( "number-format-exception", clientValue ) );
+ }
+ }
+
+ /**
+ * Converts null to the blank string, non-null to a string representation.
+ */
+ public String toClient( Timestamp value )
+ {
+ return value == null ? "" : value.toString();
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-27 14:05:25
|
Revision: 175
http://equanda.svn.sourceforge.net/equanda/?rev=175&view=rev
Author: triathlon98
Date: 2007-11-27 06:05:21 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
EQ-86 assure there is only one instance of the ContentAll stuff
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml 2007-11-27 12:26:47 UTC (rev 174)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml 2007-11-27 14:05:21 UTC (rev 175)
@@ -9,13 +9,15 @@
</a></li>
</t:loop>
</ul>
+ <div class="equandaTabsPanel">
+ <t:if test="${hasContentAll()}">
+ <div class="equandaTabsAll"><t:delegate to="contentAll"/></div>
+ </t:if>
<t:loop source="Panels" value="Panel" index="Index" volatile="true">
<div><a name="${id}t${index}" id="${id}t${index}">
- <t:if test="${hasContentAll()}">
- <div class="equandaTabsAll"><t:delegate to="contentAll"/></div>
- </t:if>
- <t:delegate to="panel.content"/>
+ <div class="equandaTabsPanelContent"><t:delegate to="panel.content"/></div>
</a></div>
</t:loop>
+ </div>
</div>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-27 12:26:49
|
Revision: 174
http://equanda.svn.sourceforge.net/equanda/?rev=174&view=rev
Author: triathlon98
Date: 2007-11-27 04:26:47 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
EQ-89 do not throw exception on parse for not-found classpath resource
Modified Paths:
--------------
trunk/equanda-client/src/main/java/org/equanda/translations/Parser.java
Modified: trunk/equanda-client/src/main/java/org/equanda/translations/Parser.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/translations/Parser.java 2007-11-27 08:51:15 UTC (rev 173)
+++ trunk/equanda-client/src/main/java/org/equanda/translations/Parser.java 2007-11-27 12:26:47 UTC (rev 174)
@@ -79,7 +79,7 @@
}
else
{
- throw new IOException( "File not found " + fileName );
+ log.error( "File not found " + fileName );
}
}
@@ -120,19 +120,19 @@
{
log.warn( ".languages is empty at line " + lineNo );
}
- for ( int i = 0; i < languages.length ; i++ )
+ for ( String language : languages )
{
- if ( languages[ i ].length() != 2 )
+ if ( language.length() != 2 )
{
- log.warn( "Invalid language " + languages[ i ] + " at " + lineNo );
+ log.warn( "Invalid language " + language + " at " + lineNo );
}
}
if ( maps == null ) maps = new TreeMap<String, TreeMap<Key, Translation>>();
- for ( int i = 0; i < languages.length ; i++ )
+ for ( String language : languages )
{
- if ( maps.get( languages[ i ] ) == null )
+ if ( maps.get( language ) == null )
{
- maps.put( languages[ i ], new TreeMap<Key, Translation>() );
+ maps.put( language, new TreeMap<Key, Translation>() );
}
}
continue;
@@ -146,7 +146,7 @@
}
else
{
- String keyStr = null;
+ String keyStr;
String contextStr = null;
String value = line.substring( KEY_SECTION.length() );
String splitted[] = value.split( "/" );
@@ -166,9 +166,9 @@
key = new Key();
key.setKey( keyStr );
key.setContext( contextStr );
- for ( int i = 0; i < languages.length ; i++ )
+ for ( String language : languages )
{
- TreeMap currentLanguageMap = maps.get( languages[ i ] );
+ TreeMap<Key,Translation> currentLanguageMap = maps.get( language );
currentLanguageMap.put( key, new Translation() );
}
}
@@ -215,9 +215,9 @@
value = value.trim();
boolean languageOk = false;
- for ( int i = 0; i < languages.length ; i++ )
+ for ( String language1 : languages )
{
- if ( language.equals( languages[ i ] ) )
+ if ( language.equals( language1 ) )
{
languageOk = true;
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-27 08:51:16
|
Revision: 173
http://equanda.svn.sourceforge.net/equanda/?rev=173&view=rev
Author: triathlon98
Date: 2007-11-27 00:51:15 -0800 (Tue, 27 Nov 2007)
Log Message:
-----------
EQ-88 add equandaReset() method in proxies to revert the state to the database values
Modified Paths:
--------------
trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaProxy.java
trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaProxy.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaProxy.java 2007-11-26 22:12:07 UTC (rev 172)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/om/EquandaProxy.java 2007-11-27 08:51:15 UTC (rev 173)
@@ -155,6 +155,15 @@
public abstract void equandaUpdate( boolean updateTypeFieldsOnly )
throws EquandaPersistenceException;
+ /**
+ * Reset the proxy state. If the proxy was not modified, nothing happens, otherwise the state is retrieved from the
+ * server again.
+ *
+ * @throws EquandaPersistenceException oops
+ */
+ public abstract void equandaReset()
+ throws EquandaPersistenceException;
+
public void removeEntityBean()
throws EquandaPersistenceException
{
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2007-11-26 22:12:07 UTC (rev 172)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2007-11-27 08:51:15 UTC (rev 173)
@@ -241,18 +241,18 @@
throws EquandaPersistenceException
{
${table.Name}SelectorEJB obj=null;
- try
- {
+ try
+ {
obj=EquandaGlobal.get${table.Name}Selector();
${table.Name} proxy = obj.equandaCreate( type );
obj.remove();
return proxy;
- }
- catch ( Exception e )
- {
+ }
+ catch ( Exception e )
+ {
log.error( e, e );
throw new EquandaPersistenceException( e );
- }
+ }
}
// getters and setters which are added in this class
@@ -525,11 +525,59 @@
#foreach ($field in $table.Fields)
#if( !$field.isInternal() && ( $field.isMultiple() || $field.isLink() ) )
- _obtained$field.Name=false;
+ _obtained$field.Name = false;
#end
#end
}
+ /**
+ * Reset the proxy state. If the proxy was not modified, nothing happens, otherwise the state is retrieved from the
+ * server again.
+ *
+ * @throws EquandaPersistenceException oops
+ */
+ public void equandaReset()
+ throws EquandaPersistenceException
+ {
+ try
+ {
+ ${table.Name}SelectorEJB sel = EquandaGlobal.get${table.Name}Selector();
+
+ if ( proxy.uoid == null || isModified() )
+ {
+ proxy = sel.equandaCreate( type ).proxy;
+ }
+ else if ( !isModified() )
+ {
+ ${table.Name} p = sel.equandaRefresh( proxy.uoid, proxy.equandaVersion );
+ if ( p!= null ) proxy = p.proxy;
+ }
+ else
+ {
+ ${table.Name} p = sel.equandaRefresh( proxy.uoid, proxy.equandaVersion-1 );
+ if ( p!= null ) proxy = p.proxy;
+ }
+ sel.remove();
+ }
+ catch ( EquandaPersistenceException pe )
+ {
+ throw pe;
+ }
+ catch ( Exception e )
+ {
+ log.error( e, e);
+ throw new EquandaPersistenceException( e );
+ }
+ updateInternalState();
+
+ #foreach ($field in $table.Fields)
+ #if( !$field.isInternal() && ( $field.isMultiple() || $field.isLink() ) )
+ _obtained$field.Name = false;
+ #end
+ #end
+ }
+
+
#if( $table.hasSecurityRoleRemove() )
public void removeEntityBean()
throws EquandaPersistenceException
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-26 22:12:11
|
Revision: 172
http://equanda.svn.sourceforge.net/equanda/?rev=172&view=rev
Author: triathlon98
Date: 2007-11-26 14:12:07 -0800 (Mon, 26 Nov 2007)
Log Message:
-----------
share code between Accordion and Tabs, assure both work when inside a form
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Accordion.tml
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml
Added Paths:
-----------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java
Added: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java (rev 0)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java 2007-11-26 22:12:07 UTC (rev 172)
@@ -0,0 +1,148 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.tapestry5.base;
+
+import org.apache.tapestry.*;
+import org.apache.tapestry.annotations.*;
+import org.apache.tapestry.ioc.annotations.Inject;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Accordion component
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+@SupportsInformalParameters
+public class TitleContent
+{
+ private static final int MAX_PANELS = 50; // max number of supported panels
+
+ @Environmental
+ private PageRenderSupport pageRenderSupport;
+
+ @Inject
+ private ComponentResources resources;
+
+ @Parameter
+ private Block titleIcon;
+
+ private TwoBlocks panel;
+ private int index;
+
+ public String getId()
+ {
+ return resources.getId();
+ }
+
+ public int getIndex()
+ {
+ return index;
+ }
+
+ public void setIndex( int index )
+ {
+ this.index = index;
+ }
+
+ public TwoBlocks getPanel()
+ {
+ return panel;
+ }
+
+ public void setPanel( TwoBlocks panel )
+ {
+ this.panel = panel;
+ }
+
+ public Block getTitleIcon()
+ {
+ return titleIcon;
+ }
+
+ public void setTitleIcon( Block titleIcon )
+ {
+ this.titleIcon = titleIcon;
+ }
+
+ public List<TwoBlocks> getPanels()
+ {
+ List<TwoBlocks> list = new ArrayList<TwoBlocks>();
+ for ( int i = 0; i < MAX_PANELS ; i++ )
+ {
+ String index = Integer.toString( i + 1 );
+ if ( resources.isBound( "title" + index ) && resources.isBound( "content" + index ) )
+ {
+ list.add( new TwoBlocks( i + 1 ) );
+ }
+ }
+ return list;
+ }
+
+ public class TwoBlocks implements Serializable
+ {
+ private Block title, content;
+ private boolean active;
+
+ public TwoBlocks( int index )
+ {
+ active = ( 1 == index );
+ title = resources.getBlockParameter( "title" + index );
+ content = resources.getBlockParameter( "content" + index );
+ }
+
+ public Block getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle( Block title )
+ {
+ this.title = title;
+ }
+
+ public Block getContent()
+ {
+ return content;
+ }
+
+ public void setContent( Block content )
+ {
+ this.content = content;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive( boolean active )
+ {
+ this.active = active;
+ }
+ }
+}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java 2007-11-26 21:18:44 UTC (rev 171)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java 2007-11-26 22:12:07 UTC (rev 172)
@@ -27,6 +27,7 @@
import org.apache.tapestry.*;
import org.apache.tapestry.annotations.*;
import org.apache.tapestry.ioc.annotations.Inject;
+import org.equanda.tapestry5.base.TitleContent;
import java.util.ArrayList;
import java.util.List;
@@ -38,9 +39,8 @@
*/
@SupportsInformalParameters
public class Accordion
+ extends TitleContent
{
- private static final int MAX_PANELS = 50; // max number of supported panels
-
@Inject
@Path( "${tapestry.scriptaculous}/prototype.js" )
private Asset prototype;
@@ -54,15 +54,7 @@
@Inject
private ComponentResources resources;
-
- @Parameter
- private Block titleIcon;
-
- @Parameter
- Block emptyBlock;
-
- private TwoBlocks panel;
-
+
@BeginRender
void doBeginRender( MarkupWriter writer )
{
@@ -74,88 +66,4 @@
{
pageRenderSupport.addScript( "equandaAccordionInit('%s'); ", resources.getId() );
}
-
- public String getId()
- {
- return resources.getId();
- }
-
- public Block getTitleIcon()
- {
- return titleIcon;
- }
-
- public void setTitleIcon( Block titleIcon )
- {
- this.titleIcon = titleIcon;
- }
-
- public TwoBlocks getPanel()
- {
- return panel;
- }
-
- public void setPanel( TwoBlocks panel )
- {
- this.panel = panel;
- }
-
- public List<TwoBlocks> getPanels()
- {
- List<TwoBlocks> list = new ArrayList<TwoBlocks>();
- for ( int i = 0; i < MAX_PANELS ; i++ )
- {
- String index = Integer.toString( i + 1 );
- if ( resources.isBound( "title" + index ) && resources.isBound( "content" + index ) )
- {
- list.add( new TwoBlocks( i + 1 ) );
- }
- }
- return list;
- }
-
- public class TwoBlocks
- {
- private Block title, content;
- private boolean active;
-
- public TwoBlocks( int index )
- {
- active = ( 1 == index );
- title = resources.getBlockParameter( "title" + index );
- if ( null == title ) title = emptyBlock; // should not happen as parameter is bound
- content = resources.getBlockParameter( "content" + index );
- if ( null == content ) content = emptyBlock; // should not happen as parameter is bound
- }
-
- public Block getTitle()
- {
- return title;
- }
-
- public void setTitle( Block title )
- {
- this.title = title;
- }
-
- public Block getContent()
- {
- return content;
- }
-
- public void setContent( Block content )
- {
- this.content = content;
- }
-
- public boolean isActive()
- {
- return active;
- }
-
- public void setActive( boolean active )
- {
- this.active = active;
- }
- }
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java 2007-11-26 21:18:44 UTC (rev 171)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java 2007-11-26 22:12:07 UTC (rev 172)
@@ -27,6 +27,7 @@
import org.apache.tapestry.*;
import org.apache.tapestry.annotations.*;
import org.apache.tapestry.ioc.annotations.Inject;
+import org.equanda.tapestry5.base.TitleContent;
import java.util.ArrayList;
import java.util.List;
@@ -38,58 +39,27 @@
*/
@SupportsInformalParameters
public class Tabs
+ extends TitleContent
{
- private static final int MAX_PANELS = 50; // max number of supported tabs
-
@Inject
@Path( "classpath:/org/equanda/tapestry5/resources/domtab.js" )
private Asset script;
+ @Parameter
+ private Block contentAll;
+
@Environmental
private PageRenderSupport pageRenderSupport;
@Inject
private ComponentResources resources;
-
- @Parameter
- private Block titleIcon;
-
- @Parameter
- private Block contentAll;
-
- @Parameter
- Block emptyBlock;
-
- private TwoBlocks panel;
- private int index;
-
+
@BeginRender
void doBeginRender( MarkupWriter writer )
{
pageRenderSupport.addScriptLink( script );
}
- @AfterRender
- void doAfterRender( MarkupWriter writer )
- {
- pageRenderSupport.addScript( "equandaAccordionInit('%s'); ", resources.getId() );
- }
-
- public String getId()
- {
- return resources.getId();
- }
-
- public Block getTitleIcon()
- {
- return titleIcon;
- }
-
- public void setTitleIcon( Block titleIcon )
- {
- this.titleIcon = titleIcon;
- }
-
public Block getContentAll()
{
return contentAll;
@@ -104,83 +74,4 @@
{
this.contentAll = contentAll;
}
-
- public TwoBlocks getPanel()
- {
- return panel;
- }
-
- public void setPanel( TwoBlocks panel )
- {
- this.panel = panel;
- }
-
- public List<TwoBlocks> getPanels()
- {
- List<TwoBlocks> list = new ArrayList<TwoBlocks>();
- for ( int i = 0; i < MAX_PANELS ; i++ )
- {
- String index = Integer.toString( i + 1 );
- if ( resources.isBound( "title" + index ) && resources.isBound( "content" + index ) )
- {
- list.add( new TwoBlocks( i + 1 ) );
- }
- }
- return list;
- }
-
- public int getIndex()
- {
- return index;
- }
-
- public void setIndex( int index )
- {
- this.index = index;
- }
-
- public class TwoBlocks
- {
- private Block title, content;
- private boolean active;
-
- public TwoBlocks( int index )
- {
- active = ( 1 == index );
- title = resources.getBlockParameter( "title" + index );
- if ( null == title ) title = emptyBlock; // should not happen as parameter is bound
- content = resources.getBlockParameter( "content" + index );
- if ( null == content ) content = emptyBlock; // should not happen as parameter is bound
- }
-
- public Block getTitle()
- {
- return title;
- }
-
- public void setTitle( Block title )
- {
- this.title = title;
- }
-
- public Block getContent()
- {
- return content;
- }
-
- public void setContent( Block content )
- {
- this.content = content;
- }
-
- public boolean isActive()
- {
- return active;
- }
-
- public void setActive( boolean active )
- {
- this.active = active;
- }
- }
}
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Accordion.tml
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Accordion.tml 2007-11-26 21:18:44 UTC (rev 171)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Accordion.tml 2007-11-26 22:12:07 UTC (rev 172)
@@ -1,7 +1,7 @@
<div class="equandaAccordion" id="${id}"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <t:loop source="Panels" value="Panel">
+ <t:loop source="Panels" value="Panel" volatile="true">
<t:if test="${panel.active}">
<div class="${id}_title ${id}_title_active" onClick="equandaAccordion(this)">
<t:delegate to="titleIcon"/>
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml 2007-11-26 21:18:44 UTC (rev 171)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/Tabs.tml 2007-11-26 22:12:07 UTC (rev 172)
@@ -2,14 +2,14 @@
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<ul class="domtabs">
- <t:loop source="Panels" value="Panel" index="Index">
+ <t:loop source="Panels" value="Panel" index="Index" volatile="true">
<li><a href="#${id}t${index}">
<t:delegate to="titleIcon"/>
<t:delegate to="panel.title"/>
</a></li>
</t:loop>
</ul>
- <t:loop source="Panels" value="Panel" index="Index">
+ <t:loop source="Panels" value="Panel" index="Index" volatile="true">
<div><a name="${id}t${index}" id="${id}t${index}">
<t:if test="${hasContentAll()}">
<div class="equandaTabsAll"><t:delegate to="contentAll"/></div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-26 21:18:50
|
Revision: 171
http://equanda.svn.sourceforge.net/equanda/?rev=171&view=rev
Author: triathlon98
Date: 2007-11-26 13:18:44 -0800 (Mon, 26 Nov 2007)
Log Message:
-----------
fix formatting
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/DoubleTranslator.java
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/DoubleTranslator.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/DoubleTranslator.java 2007-11-26 16:00:17 UTC (rev 170)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/DoubleTranslator.java 2007-11-26 21:18:44 UTC (rev 171)
@@ -19,32 +19,36 @@
import org.apache.tapestry.ioc.Messages;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
-public class DoubleTranslator implements Translator<Double>
+public class DoubleTranslator
+ implements Translator<Double>
{
/**
* Parses blank values to null, otherwise parses the client value to a double
*
* @throws ValidationException if the clientValue can not be parsed
*/
- public Double parseClient(String clientValue, Messages messages) throws ValidationException
+ public Double parseClient( String clientValue, Messages messages )
+ throws ValidationException
{
- if (InternalUtils.isBlank(clientValue))
+ if ( InternalUtils.isBlank( clientValue ) )
+ {
return null;
+ }
try
{
- return new Double(clientValue.replace(',','.').trim());
+ return new Double( clientValue.replace( ',', '.' ).trim() );
}
- catch (NumberFormatException ex)
+ catch ( NumberFormatException ex )
{
- throw new ValidationException(messages.format("number-format-exception", clientValue));
+ throw new ValidationException( messages.format( "number-format-exception", clientValue ) );
}
}
/**
* Converts null to the blank string, non-null to a string representation.
*/
- public String toClient(Double value)
+ public String toClient( Double value )
{
return value == null ? "" : value.toString();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-26 16:00:19
|
Revision: 170
http://equanda.svn.sourceforge.net/equanda/?rev=170&view=rev
Author: triathlon98
Date: 2007-11-26 08:00:17 -0800 (Mon, 26 Nov 2007)
Log Message:
-----------
demo nested tab components
Modified Paths:
--------------
t5-equanda-example/src/main/java/org/equanda/example/t5/pages/Start.java
t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml
t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml
t5-equanda-example/src/main/webapp/css/style.css
Added Paths:
-----------
t5-equanda-example/src/main/webapp/images/smiley.gif
Removed Paths:
-------------
t5-equanda-example/src/main/webapp/images/synergetics.png
Modified: t5-equanda-example/src/main/java/org/equanda/example/t5/pages/Start.java
===================================================================
--- t5-equanda-example/src/main/java/org/equanda/example/t5/pages/Start.java 2007-11-26 15:59:27 UTC (rev 169)
+++ t5-equanda-example/src/main/java/org/equanda/example/t5/pages/Start.java 2007-11-26 16:00:17 UTC (rev 170)
@@ -1,5 +1,9 @@
package org.equanda.example.t5.pages;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.annotations.Path;
+import org.apache.tapestry.Asset;
+
import java.util.Date;
/**
@@ -7,8 +11,17 @@
*/
public class Start
{
- public Date getCurrentTime()
- {
- return new Date();
- }
+ @Inject
+ @Path("context:images/smiley.gif")
+ private Asset smiley;
+
+ public Asset getSmiley()
+ {
+ return smiley;
+ }
+
+ public void setSmiley( Asset smiley )
+ {
+ this.smiley = smiley;
+ }
}
\ No newline at end of file
Modified: t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml
===================================================================
--- t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml 2007-11-26 15:59:27 UTC (rev 169)
+++ t5-equanda-example/src/main/resources/org/equanda/example/t5/components/Layout.tml 2007-11-26 16:00:17 UTC (rev 170)
@@ -9,7 +9,7 @@
<body>
<div id="layout-left">
- <span t:type="equanda/Accordion" id="accordion">
+ <span t:type="equanda/Accordion" t:id="accordion">
<t:parameter name="title1">Menu First Part</t:parameter>
<t:parameter name="content1">
<p>Sample menu, the links don't do anything though...</p>
Modified: t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml
===================================================================
--- t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml 2007-11-26 15:59:27 UTC (rev 169)
+++ t5-equanda-example/src/main/resources/org/equanda/example/t5/pages/Start.tml 2007-11-26 16:00:17 UTC (rev 170)
@@ -11,7 +11,7 @@
of <a href="http://equanda.org">equanda</a>.</p>
<p>This project can be found in SVN at <a href="https://equanda.svn.sourceforge.net/svnroot/equanda/t5-equanda-example">https://equanda.svn.sourceforge.net/svnroot/equanda/t5-equanda-example</a></p>
- <span t:type="equanda/Tabs" id="maintabs">
+ <span t:type="equanda/Tabs" t:id="maintabs">
<t:parameter name="title1">Accordion</t:parameter>
<t:parameter name="content1">
<p>An accordion component, allowing objects to be grouped in sliding panes.</p>
@@ -23,12 +23,35 @@
</t:parameter>
<t:parameter name="title2">Tabs</t:parameter>
<t:parameter name="content2">
- <p>An tabs component, allowing objects to be grouped and displayed as tab pages.</p>
- <ul>
- <li><a href="#nowhere">Do something</a></li>
- <li><a href="#nowhere">Something else</a></li>
- <li><a href="#nowhere">And even more</a></li>
- </ul>
+ <p>Here is a second tab component which shows that tabs can be nested.</p>
+ <span t:type="equanda/Tabs" t:id="bistabs">
+ <t:parameter name="contentAll"><p>This content is repeated on all tabs.</p></t:parameter>
+ <t:parameter name="titleIcon"><img src="${smiley}"/></t:parameter>
+ <t:parameter name="title1">Page 1</t:parameter>
+ <t:parameter name="content1">
+ <p>This is the first tab page of the second tab component.</p>
+ </t:parameter>
+ <t:parameter name="title2">Page 2</t:parameter>
+ <t:parameter name="content2">
+ <p>And when there is one, there should also be a second, otherwise there would be little use having a tab page.</p>
+ </t:parameter>
+ </span>
</t:parameter>
</span>
+
+ <!--
+ <p>another tab</p>
+ <span t:type="equanda/Tabs" t:id="tristabs">
+ <t:parameter name="contentAll"><p>This content is repeated on all tabs.</p></t:parameter>
+ <t:parameter name="titleIcon"><img src="${smiley}"/></t:parameter>
+ <t:parameter name="title1">Page 1</t:parameter>
+ <t:parameter name="content1">
+ <p>This is the first tab page of the second tab component.</p>
+ </t:parameter>
+ <t:parameter name="title2">Page 2</t:parameter>
+ <t:parameter name="content2">
+ <p>And when there is one, there should also be a second, otherwise there would be little use having a tab page.</p>
+ </t:parameter>
+ </span>
+ -->
</t:layout>
Modified: t5-equanda-example/src/main/webapp/css/style.css
===================================================================
--- t5-equanda-example/src/main/webapp/css/style.css 2007-11-26 15:59:27 UTC (rev 169)
+++ t5-equanda-example/src/main/webapp/css/style.css 2007-11-26 16:00:17 UTC (rev 170)
@@ -74,7 +74,7 @@
background:gray;
color:white;
}
-div.domtab div {
+div.domtab>div {
clear:both;
width:auto;
background:white;
@@ -89,3 +89,9 @@
background:black;
color:white;
}
+
+.equandaTabsAll{
+ background: #FFFF99;
+ padding: 0;
+ color: black;
+}
Added: t5-equanda-example/src/main/webapp/images/smiley.gif
===================================================================
(Binary files differ)
Property changes on: t5-equanda-example/src/main/webapp/images/smiley.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: t5-equanda-example/src/main/webapp/images/synergetics.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-11-26 15:59:30
|
Revision: 169
http://equanda.svn.sourceforge.net/equanda/?rev=169&view=rev
Author: triathlon98
Date: 2007-11-26 07:59:27 -0800 (Mon, 26 Nov 2007)
Log Message:
-----------
EQ-89 fix nested tabs components
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/domtab.js
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/domtab.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/domtab.js 2007-11-26 15:28:27 UTC (rev 168)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/domtab.js 2007-11-26 15:59:27 UTC (rev 169)
@@ -27,7 +27,7 @@
var tempelm=document.getElementsByTagName('div');
for(var i=0;i<tempelm.length;i++){
if(!domtab.cssjs('check',tempelm[i],domtab.tabClass)){continue;}
- domtab.initTabMenu(tempelm[i]);
+ domtab.initTabMenu(tempelm[i]);
domtab.removeBackLinks(tempelm[i]);
if(domtab.cssjs('check',tempelm[i],domtab.prevNextIndicator)){
domtab.addPrevNext(tempelm[i]);
@@ -125,18 +125,20 @@
thismenu.currentSection='';
thismenu.currentLink='';
var links=thismenu.getElementsByTagName('a');
- for(i=0;i<links.length;i++){
+ var first=true;
+ for(i=0;i<links.length;i++){
if(!links[i].getAttribute('href')){continue;}
id=links[i].href.match(/#(\w.+)/)[1];
if(document.getElementById(id)){
domtab.addEvent(links[i],'click',domtab.showTab,false);
links[i].onclick=function(){return false;} // safari hack
- if (i==0)
+ if (first)
{
domtab.changeTab(document.getElementById(id),1);
thismenu.currentSection=id;
- thismenu.currentLink=links[0];
- domtab.cssjs('add',links[0].parentNode,domtab.activeClass);
+ thismenu.currentLink=links[i];
+ domtab.cssjs('add',links[i].parentNode,domtab.activeClass);
+ first=false;
}
else
{
@@ -186,7 +188,7 @@
do{
elm=elm.parentNode;
} while(elm.nodeName.toLowerCase()!=domtab.contentElements)
- elm.style.display=state==0?'none':'block';
+ elm.style.display=state==0?'none':'block';
},
showTab:function(e){
var o=domtab.getTarget(e);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|