JBoss Rich Faces SVN: r4329 - trunk/sandbox/samples.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-11-28 13:52:05 -0500 (Wed, 28 Nov 2007)
New Revision: 4329
Modified:
trunk/sandbox/samples/pom.xml
Log:
RF-1214
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2007-11-28 18:51:29 UTC (rev 4328)
+++ trunk/sandbox/samples/pom.xml 2007-11-28 18:52:05 UTC (rev 4329)
@@ -18,5 +18,6 @@
<module>columnsDemo</module>
<!--module>contextMenuDemo</module-->
<module>fileUploadPOC</module>
+ <module>fileUploadDemo</module>
</modules>
</project>
\ No newline at end of file
17 years, 1 month
JBoss Rich Faces SVN: r4328 - in trunk/sandbox/samples: fileUploadDemo and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-11-28 13:51:29 -0500 (Wed, 28 Nov 2007)
New Revision: 4328
Added:
trunk/sandbox/samples/fileUploadDemo/
trunk/sandbox/samples/fileUploadDemo/pom.xml
trunk/sandbox/samples/fileUploadDemo/src/
trunk/sandbox/samples/fileUploadDemo/src/main/
trunk/sandbox/samples/fileUploadDemo/src/main/java/
trunk/sandbox/samples/fileUploadDemo/src/main/java/org/
trunk/sandbox/samples/fileUploadDemo/src/main/java/org/richfaces/
trunk/sandbox/samples/fileUploadDemo/src/main/java/org/richfaces/Bean.java
trunk/sandbox/samples/fileUploadDemo/src/main/resources/
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/index.jsp
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.xhtml
trunk/sandbox/samples/fileUploadDemo/src/test/
trunk/sandbox/samples/fileUploadDemo/src/test/java/
trunk/sandbox/samples/fileUploadDemo/src/test/java/org/
trunk/sandbox/samples/fileUploadDemo/src/test/java/org/richfaces/
trunk/sandbox/samples/fileUploadDemo/src/test/java/org/richfaces/BeanTest.java
Log:
RF-1214
Property changes on: trunk/sandbox/samples/fileUploadDemo
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.project
.classpath
Added: trunk/sandbox/samples/fileUploadDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/pom.xml (rev 0)
+++ trunk/sandbox/samples/fileUploadDemo/pom.xml 2007-11-28 18:51:29 UTC (rev 4328)
@@ -0,0 +1,38 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>fileUploadDemo</artifactId>
+ <packaging>war</packaging>
+ <name>fileUploadDemo Maven Webapp</name>
+ <version>3.2.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>fileUpload</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>core</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>fileUploadDemo</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/sandbox/samples/fileUploadDemo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/java/org/richfaces/Bean.java (rev 0)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/java/org/richfaces/Bean.java 2007-11-28 18:51:29 UTC (rev 4328)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+}
\ No newline at end of file
Added: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-11-28 18:51:29 UTC (rev 4328)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.richfaces.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Added: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml 2007-11-28 18:51:29 UTC (rev 4328)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Archetype Created Web Application</display-name>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <!--
+ -->
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/index.jsp (rev 0)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/index.jsp 2007-11-28 18:51:29 UTC (rev 4328)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp (rev 0)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp 2007-11-28 18:51:29 UTC (rev 4328)
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
Added: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.xhtml (rev 0)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.xhtml 2007-11-28 18:51:29 UTC (rev 4328)
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ >
+ <f:view>
+
+ </f:view>
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/fileUploadDemo/src/test/java/org/richfaces/BeanTest.java
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/test/java/org/richfaces/BeanTest.java (rev 0)
+++ trunk/sandbox/samples/fileUploadDemo/src/test/java/org/richfaces/BeanTest.java 2007-11-28 18:51:29 UTC (rev 4328)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+*/
+public class BeanTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public BeanTest( String testName )
+ {
+ super( testName );
+ }
+
+ public void testStub() throws Exception {
+
+ }
+}
17 years, 1 month
JBoss Rich Faces SVN: r4327 - trunk/sandbox/ui.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-11-28 13:50:12 -0500 (Wed, 28 Nov 2007)
New Revision: 4327
Modified:
trunk/sandbox/ui/pom.xml
Log:
RF-1209
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2007-11-28 18:49:46 UTC (rev 4326)
+++ trunk/sandbox/ui/pom.xml 2007-11-28 18:50:12 UTC (rev 4327)
@@ -20,5 +20,6 @@
<module>rex-messageBox</module>
<!--module>rex-button</module-->
<!--module>contextMenu</module-->
+ <module>fileUpload</module>
</modules>
</project>
\ No newline at end of file
17 years, 1 month
JBoss Rich Faces SVN: r4326 - in trunk/sandbox/ui: fileUpload and 14 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-11-28 13:49:46 -0500 (Wed, 28 Nov 2007)
New Revision: 4326
Added:
trunk/sandbox/ui/fileUpload/
trunk/sandbox/ui/fileUpload/pom.xml
trunk/sandbox/ui/fileUpload/src/
trunk/sandbox/ui/fileUpload/src/main/
trunk/sandbox/ui/fileUpload/src/main/config/
trunk/sandbox/ui/fileUpload/src/main/config/component/
trunk/sandbox/ui/fileUpload/src/main/config/component/README
trunk/sandbox/ui/fileUpload/src/main/java/
trunk/sandbox/ui/fileUpload/src/main/java/org/
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/component/
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/component/README
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
trunk/sandbox/ui/fileUpload/src/main/resources/
trunk/sandbox/ui/fileUpload/src/main/templates/
trunk/sandbox/ui/fileUpload/src/main/templates/README
trunk/sandbox/ui/fileUpload/src/test/
trunk/sandbox/ui/fileUpload/src/test/java/
trunk/sandbox/ui/fileUpload/src/test/java/org/
trunk/sandbox/ui/fileUpload/src/test/java/org/richfaces/
trunk/sandbox/ui/fileUpload/src/test/java/org/richfaces/component/
trunk/sandbox/ui/fileUpload/src/test/java/org/richfaces/component/JSFComponentTest.java
Log:
RF-1209
Property changes on: trunk/sandbox/ui/fileUpload
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.project
.classpath
Added: trunk/sandbox/ui/fileUpload/pom.xml
===================================================================
--- trunk/sandbox/ui/fileUpload/pom.xml (rev 0)
+++ trunk/sandbox/ui/fileUpload/pom.xml 2007-11-28 18:49:46 UTC (rev 4326)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>fileUpload</artifactId>
+ <name>fileUpload</name>
+ <version>3.2.0-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>fileUpload</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/ui/fileUpload/src/main/config/component/README
===================================================================
Added: trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/component/README
===================================================================
Added: trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java (rev 0)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java 2007-11-28 18:49:46 UTC (rev 4326)
@@ -0,0 +1,5 @@
+package org.richfaces.component;
+
+public class UIFileUpload {
+
+}
Added: trunk/sandbox/ui/fileUpload/src/main/templates/README
===================================================================
Added: trunk/sandbox/ui/fileUpload/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/ui/fileUpload/src/test/java/org/richfaces/component/JSFComponentTest.java (rev 0)
+++ trunk/sandbox/ui/fileUpload/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-11-28 18:49:46 UTC (rev 4326)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import javax.faces.component.UIComponent;
+
+/**
+ * Unit test for simple Component.
+ */
+public class JSFComponentTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public JSFComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent()
+ {
+ assertTrue( true );
+ }
+}
17 years, 1 month
JBoss Rich Faces SVN: r4325 - in trunk/sandbox/samples/fileUploadPOC: src/main/java/org/richfaces and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-11-28 13:47:58 -0500 (Wed, 28 Nov 2007)
New Revision: 4325
Added:
trunk/sandbox/samples/fileUploadPOC/src/main/java/org/richfaces/SleepFilter.java
Modified:
trunk/sandbox/samples/fileUploadPOC/pom.xml
trunk/sandbox/samples/fileUploadPOC/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/fileUploadPOC/src/main/webapp/pages/frame.xhtml
trunk/sandbox/samples/fileUploadPOC/src/main/webapp/pages/index.xhtml
Log:
RF-1209
Modified: trunk/sandbox/samples/fileUploadPOC/pom.xml
===================================================================
--- trunk/sandbox/samples/fileUploadPOC/pom.xml 2007-11-28 18:07:29 UTC (rev 4324)
+++ trunk/sandbox/samples/fileUploadPOC/pom.xml 2007-11-28 18:47:58 UTC (rev 4325)
@@ -9,8 +9,30 @@
<artifactId>fileUploadPOC</artifactId>
<packaging>war</packaging>
<name>fileUploadPOC Maven Webapp</name>
- <version>1.0-SNAPSHOT</version>
+ <version>3.2.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3</version>
+ </dependency>
+ </dependencies>
<build>
<finalName>fileUploadPOC</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
</project>
\ No newline at end of file
Added: trunk/sandbox/samples/fileUploadPOC/src/main/java/org/richfaces/SleepFilter.java
===================================================================
--- trunk/sandbox/samples/fileUploadPOC/src/main/java/org/richfaces/SleepFilter.java (rev 0)
+++ trunk/sandbox/samples/fileUploadPOC/src/main/java/org/richfaces/SleepFilter.java 2007-11-28 18:47:58 UTC (rev 4325)
@@ -0,0 +1,89 @@
+package org.richfaces;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletInputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.FileUploadException;
+import org.apache.commons.fileupload.ProgressListener;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+
+public class SleepFilter implements Filter {
+
+ public void destroy() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void doFilter(ServletRequest servletRequest, ServletResponse response,
+ FilterChain chain) throws IOException, ServletException {
+ HttpServletRequest request = (HttpServletRequest)servletRequest;
+ if (ServletFileUpload.isMultipartContent(request)) {
+ FileItemFactory factory = new DiskFileItemFactory();
+
+ // Create a new file upload handler
+ ServletFileUpload upload = new ServletFileUpload(factory);
+
+ //Create a progress listener
+ ProgressListener progressListener = new ProgressListener(){
+ public void update(long pBytesRead, long pContentLength, int pItems) {
+ System.out.println("We are currently reading item " + pItems);
+ if (pContentLength == -1) {
+ System.out.println("So far, " + pBytesRead + " bytes have been read.");
+ } else {
+ System.out.println("So far, " + pBytesRead + " of " + pContentLength
+ + " bytes have been read.");
+ }
+ try {
+ Thread.sleep((long)3E3);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ };
+ upload.setProgressListener(progressListener); // Parse the request
+ try {
+ List list= upload.parseRequest(request);
+ // Process the uploaded items
+ Iterator iter = list.iterator();
+ while (iter.hasNext()) {
+ FileItem item = (FileItem) iter.next();
+
+ if (item.isFormField()) {
+ // processFormField(item);
+ } else {
+ String fieldName = item.getFieldName();
+ String fileName = item.getName();
+ String contentType = item.getContentType();
+ boolean isInMemory = item.isInMemory();
+ long sizeInBytes = item.getSize();
+ System.out.println(fieldName+" "+fileName+" "+contentType+" "+isInMemory+" "+sizeInBytes);
+ }
+ }
+ } catch (FileUploadException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ chain.doFilter(servletRequest, response);
+ }
+
+ public void init(FilterConfig filterConfig) throws ServletException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Modified: trunk/sandbox/samples/fileUploadPOC/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/fileUploadPOC/src/main/webapp/WEB-INF/web.xml 2007-11-28 18:07:29 UTC (rev 4324)
+++ trunk/sandbox/samples/fileUploadPOC/src/main/webapp/WEB-INF/web.xml 2007-11-28 18:47:58 UTC (rev 4325)
@@ -14,6 +14,10 @@
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
<!--
-->
<filter>
@@ -21,7 +25,20 @@
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
+ <filter>
+ <display-name>Sleep Filter</display-name>
+ <filter-name>sleepFilter</filter-name>
+ <filter-class>org.richfaces.SleepFilter</filter-class>
+ </filter>
<filter-mapping>
+ <filter-name>sleepFilter</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+ <filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
Modified: trunk/sandbox/samples/fileUploadPOC/src/main/webapp/pages/frame.xhtml
===================================================================
--- trunk/sandbox/samples/fileUploadPOC/src/main/webapp/pages/frame.xhtml 2007-11-28 18:07:29 UTC (rev 4324)
+++ trunk/sandbox/samples/fileUploadPOC/src/main/webapp/pages/frame.xhtml 2007-11-28 18:47:58 UTC (rev 4325)
@@ -7,10 +7,6 @@
xmlns:c="http://java.sun.com/jsp/jstl/core"
>
<body>
- <form action="frame.jsf">
- <input type="file"/>
- <input type="file"/>
- <input type="submit"/>
- </form>
+ xXx
</body>
</html>
\ No newline at end of file
Modified: trunk/sandbox/samples/fileUploadPOC/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/fileUploadPOC/src/main/webapp/pages/index.xhtml 2007-11-28 18:07:29 UTC (rev 4324)
+++ trunk/sandbox/samples/fileUploadPOC/src/main/webapp/pages/index.xhtml 2007-11-28 18:47:58 UTC (rev 4325)
@@ -7,6 +7,12 @@
xmlns:c="http://java.sun.com/jsp/jstl/core"
>
<body>
- <iframe src="pages/frame.jsf"/>
- </body>
+ <iframe id="frame" name="frame"/>
+ <form target="frame" action="pages/frame.jsf" enctype="multipart/form-data" method="post">
+ <input type="file" name="input1"/>
+ <input type="file" name="input2"/>
+ <input type="submit"/>
+ </form>
+ <input type="button" onclick="debugger;document.getElementById('frame').contentWindow.location.href='';"/>
+ </body>
</html>
\ No newline at end of file
17 years, 1 month
JBoss Rich Faces SVN: r4324 - branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-11-28 13:07:29 -0500 (Wed, 28 Nov 2007)
New Revision: 4324
Modified:
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
Log:
RF-953
Modified: branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
===================================================================
--- branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2007-11-28 18:06:26 UTC (rev 4323)
+++ branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2007-11-28 18:07:29 UTC (rev 4324)
@@ -72,6 +72,11 @@
int currentRow = holder.getRowCounter();
Integer columns = (Integer) table.getAttributes().get("columns");
int cols = (null!=columns && columns.intValue()!=Integer.MIN_VALUE)?columns.intValue():1;
+
+ if (columns.intValue() == 0) {
+ cols = 1;
+ }
+
int gridRowCounter = holder.getGridRowCounter();
if ( cols >0 && currentRow%cols==0) {
if (currentRow != 0 ) {
17 years, 1 month
JBoss Rich Faces SVN: r4323 - trunk/ui/dataTable/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-11-28 13:06:26 -0500 (Wed, 28 Nov 2007)
New Revision: 4323
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
Log:
RF-953
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2007-11-28 17:59:50 UTC (rev 4322)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2007-11-28 18:06:26 UTC (rev 4323)
@@ -72,6 +72,11 @@
int currentRow = holder.getRowCounter();
Integer columns = (Integer) table.getAttributes().get("columns");
int cols = (null!=columns && columns.intValue()!=Integer.MIN_VALUE)?columns.intValue():1;
+
+ if (columns.intValue() == 0) {
+ cols = 1;
+ }
+
int gridRowCounter = holder.getGridRowCounter();
if ( cols >0 && currentRow%cols==0) {
if (currentRow != 0 ) {
17 years, 1 month
JBoss Rich Faces SVN: r4322 - in branches/3.1.x/ui/orderingList/src/main: java/org/richfaces/model and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-28 12:59:50 -0500 (Wed, 28 Nov 2007)
New Revision: 4322
Added:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/model/OrderingListDataModel.java
Removed:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/model/TranslatedSequenceDataModel.java
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
Log:
latest changes for listShuttle & orderingList
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-11-28 17:59:37 UTC (rev 4321)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-11-28 17:59:50 UTC (rev 4322)
@@ -5,6 +5,7 @@
import java.io.IOException;
import java.io.Serializable;
+import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -13,11 +14,11 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.component.UIInput;
@@ -61,7 +62,7 @@
public static final Predicate isColumn = new Predicate() {
public boolean evaluate(Object input) {
- return (input instanceof UIColumn || input instanceof Column) &&
+ return (input instanceof javax.faces.component.UIColumn || input instanceof Column) &&
((UIComponent) input).isRendered();
}
};
@@ -488,6 +489,11 @@
public void execute(FacesContext context);
}
+ protected interface DataAdder {
+ Object getContainer();
+ void add(Object object);
+ }
+
protected final UpdateModelCommand updateValueCommand = new UpdateModelCommand() {
public void execute(FacesContext context) {
@@ -698,4 +704,89 @@
setRowKey(rowKey);
}
+ protected Set[] convertKeySets(FacesContext context, Set[] sets) {
+ Set[] result = new Set[sets.length];
+
+ for (int i = 0; i < sets.length; i++) {
+ Set set = result[i] = new HashSet();
+
+ Iterator iterator = sets[i].iterator();
+ while (iterator.hasNext()) {
+ setRowKey(context, iterator.next());
+ set.add(getRowData());
+ }
+ }
+
+ return result;
+ }
+
+ protected DataAdder createDataAdder(Object object, int size) {
+ if (object instanceof List) {
+ return new ListDataAdder(size);
+ } else {
+ return new ArrayDataAdder(object.getClass(), size);
+ }
+ }
+
+ private class ListDataAdder implements DataAdder {
+ private ArrayList container;
+
+ public ListDataAdder(int size) {
+ container = new ArrayList(size);
+ }
+
+ public Object getContainer() {
+ container.trimToSize();
+ return container;
+ }
+
+ public void add(Object object) {
+ container.add(object);
+ }
+ }
+
+ private class ArrayDataAdder implements DataAdder {
+ private int idx = 0;
+ private Object[] objects;
+
+ public ArrayDataAdder(Class objectClass, int size) {
+ this.objects = (Object[]) Array.newInstance(objectClass.getComponentType(),
+ size);
+ }
+
+ public void add(Object object) {
+ this.objects[idx++] = object;
+ }
+
+ public Object getContainer() {
+ return objects;
+ }
+ }
+
+ public abstract ItemState getItemState();
+
+ public interface ItemState {
+ public boolean isSelected();
+ public boolean isActive();
+ }
+
+ protected final class SubmittedItemState implements ItemState {
+
+ private Set activeItemKeys;
+ private Set selectionKeys;
+
+ public boolean isActive() {
+ return activeItemKeys != null && activeItemKeys.contains(getTranslatedRowKey());
+ }
+
+ public boolean isSelected() {
+ return selectionKeys != null && selectionKeys.contains(getTranslatedRowKey());
+ }
+
+ public SubmittedItemState(Set selectionKeys, Set activeItemKeys) {
+ super();
+ this.selectionKeys = selectionKeys;
+ this.activeItemKeys = activeItemKeys;
+ }
+ }
}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2007-11-28 17:59:37 UTC (rev 4321)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2007-11-28 17:59:50 UTC (rev 4322)
@@ -1,13 +1,8 @@
package org.richfaces.component;
import java.io.IOException;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
@@ -33,7 +28,7 @@
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.ExtendedDataModel;
-import org.richfaces.model.TranslatedSequenceDataModel;
+import org.richfaces.model.OrderingListDataModel;
public abstract class UIOrderingList extends UIOrderingBaseComponent {
@@ -80,24 +75,6 @@
}
- public interface ItemState {
- public boolean isSelected();
- public boolean isActive();
- }
-
- private final class SubmittedItemState implements ItemState {
-
- public boolean isActive() {
- Set activeItems = submittedValueHolder.getActiveItems();
- return activeItems != null && activeItems.contains(getTranslatedRowKey());
- }
-
- public boolean isSelected() {
- Set selection = submittedValueHolder.getSelection();
- return selection != null && selection.contains(getTranslatedRowKey());
- }
- }
-
private final class ModelItemState implements ItemState {
private Collection selectedItems;
private Object activeItem;
@@ -121,9 +98,9 @@
DataModel dataModel = createDataModel(getValue());
if (isTranslatedRenderingState() || isTranslatedState()) {
- return new TranslatedSequenceDataModel(dataModel, isTranslatedState(), submittedValueHolder != null ? submittedValueHolder.permutationOrder : this.permutationOrder);
+ return new OrderingListDataModel(dataModel, isTranslatedState(), submittedValueHolder != null ? submittedValueHolder.permutationOrder : this.permutationOrder);
} else {
- return new TranslatedSequenceDataModel(dataModel, false, null);
+ return new OrderingListDataModel(dataModel, false, null);
}
}
@@ -393,10 +370,34 @@
return;
}
+ Object previousValue = getValue();
Object newValue = null;
try {
- newValue = getConvertedValue(context);
+ if (previousValue == null) {
+ previousValue = Collections.EMPTY_LIST;
+ }
+
+ OrderingListDataModel dataModel = (OrderingListDataModel) getExtendedDataModel();
+ dataModel.setTranslationTable(submittedValueHolder.permutationOrder);
+
+ try {
+ final DataAdder dataAdder = createDataAdder(previousValue, dataModel.getRowCount());
+
+ walk(context, new DataVisitor() {
+ public void process(FacesContext context, Object rowKey,
+ Object argument) throws IOException {
+
+ setRowKey(rowKey);
+ dataAdder.add(getRowData());
+ }
+
+ }, null);
+
+ newValue = dataAdder.getContainer();
+ } catch (IOException e) {
+ throw new ConverterException(e.getLocalizedMessage(), e);
+ }
}
catch (ConverterException ce) {
Object submittedValue = submittedValueHolder;
@@ -409,34 +410,25 @@
// If our value is valid, store the new value, erase the
// "submitted" value, and emit a ValueChangeEvent if appropriate
if (isValid()) {
- Set selectionSet = new HashSet();
- Set selectedItems = submittedValueHolder.getSelection();
- for (Iterator iterator = selectedItems.iterator(); iterator
- .hasNext();) {
- setRowKey(context, iterator.next());
- Object selectionItem = getRowData();
+ Set[] sets = convertKeySets(context,
+ new Set[] {
+ submittedValueHolder.getSelection(),
+ submittedValueHolder.getActiveItems() });
- selectionSet.add(selectionItem);
- }
+ setSelection(sets[0]);
- setSelection(selectionSet);
-
- Set activeItems = submittedValueHolder.getActiveItems();
- if (!activeItems.isEmpty()) {
- setRowKey(context, activeItems.iterator().next());
- Object activeItem = getRowData();
-
- setActiveItem(activeItem);
- } else {
+ Set activeItems = sets[1];
+ if (activeItems.isEmpty()) {
setActiveItem(null);
+ } else {
+ setActiveItem(activeItems.iterator().next());
}
-
- Object previous = getValue();
+
setValue(newValue);
setTranslatedState();
- //setSubmittedValue(null);
- if (compareValues(previous, newValue)) {
- queueEvent(new ValueChangeEvent(this, previous, newValue));
+
+ if (compareValues(previousValue, newValue)) {
+ queueEvent(new ValueChangeEvent(this, previousValue, newValue));
}
this.permutationOrder = this.submittedValueHolder.permutationOrder;
@@ -444,64 +436,6 @@
}
}
- protected Object getConvertedValue(FacesContext context) throws ConverterException {
- Object convertedValue = getValue();
- if (convertedValue == null) {
- convertedValue = Collections.EMPTY_LIST;
- }
-
- if (submittedValueHolder != null) {
- Object savedValue = convertedValue;
-
- //int[] indexes = submittedValueHolder.permutationOrder;
-
- TranslatedSequenceDataModel dataModel = (TranslatedSequenceDataModel) getExtendedDataModel();
- dataModel.setTranslationTable(submittedValueHolder.permutationOrder);
-
- try {
- if (savedValue instanceof List) {
- List list = (List) savedValue;
- final ArrayList arrayList = new ArrayList(list.size());
-
- walk(context, new DataVisitor() {
-
- public void process(FacesContext context, Object rowKey,
- Object argument) throws IOException {
-
- setRowKey(rowKey);
- arrayList.add(getRowData());
- }
-
- }, null);
-
- convertedValue = arrayList;
- } else {
- final Object[] convertedValueArray = (Object[]) Array.newInstance(savedValue.getClass().getComponentType(),
- Array.getLength(savedValue));
-
- walk(context, new DataVisitor() {
- private int counter = 0;
-
- public void process(FacesContext context, Object rowKey,
- Object argument) throws IOException {
-
- setRowKey(rowKey);
- convertedValueArray[counter++] = getRowData();
- }
-
- }, null);
-
- convertedValue = convertedValueArray;
- }
-
- } catch (IOException e) {
- throw new ConverterException(e.getLocalizedMessage(), e);
- }
- }
-
- return convertedValue;
- }
-
protected void resetDataModel() {
super.resetDataModel();
@@ -603,12 +537,13 @@
}
public Object getTranslatedRowKey() {
- return ((TranslatedSequenceDataModel) getExtendedDataModel()).getTranslatedRowKey();
+ return ((OrderingListDataModel) getExtendedDataModel()).getTranslatedRowKey();
}
public ItemState getItemState() {
if (submittedValueHolder != null) {
- return new SubmittedItemState();
+ return new SubmittedItemState(submittedValueHolder.getSelection(),
+ submittedValueHolder.getActiveItems());
} else {
return new ModelItemState(getSelection(), getActiveItem());
}
Copied: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/model/OrderingListDataModel.java (from rev 4315, branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/model/TranslatedSequenceDataModel.java)
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/model/OrderingListDataModel.java (rev 0)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/model/OrderingListDataModel.java 2007-11-28 17:59:50 UTC (rev 4322)
@@ -0,0 +1,135 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.DataModel;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.Range;
+import org.ajax4jsf.model.SequenceDataModel;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 07.11.2007
+ *
+ */
+public class OrderingListDataModel extends SequenceDataModel {
+
+ protected static final class TranslatedRowKey implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2035943770925539333L;
+ private Object key;
+ private String asString;
+
+ public TranslatedRowKey(Object key, String asString) {
+ super();
+ this.key = key;
+ this.asString = asString;
+ }
+
+ public Object getKey() {
+ return key;
+ }
+
+ public String getAsString() {
+ return asString;
+ }
+
+ public String toString() {
+ return getAsString();
+ }
+ };
+
+ private Map translationTable;
+ private boolean translatedModel;
+
+ private Object rowKey;
+
+ public OrderingListDataModel(DataModel wrapped,
+ boolean translatedModel, Map translationTable) {
+ super(wrapped);
+ this.translatedModel = translatedModel;
+ this.translationTable = translationTable;
+ }
+
+ public OrderingListDataModel(DataModel wrapped) {
+ super(wrapped);
+ }
+
+ private Object translate(Object key) {
+ if (translationTable != null) {
+ return translationTable.get(key);
+ } else {
+ return key;
+ }
+ }
+
+ public Object getTranslatedRowKey() {
+ return super.getRowKey();
+ }
+
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ public void setRowKey(Object key) {
+ this.rowKey = key;
+
+ if (key instanceof TranslatedRowKey) {
+ super.setRowKey(((TranslatedRowKey) key).getKey());
+ } else {
+ if (this.translatedModel) {
+ if (rowKey != null) {
+ super.setRowKey(translate(key));
+ } else {
+ super.setRowKey(null);
+ }
+ } else {
+ super.setRowKey(key);
+ }
+ }
+ }
+
+ public void walk(FacesContext context, DataVisitor visitor, Range range,
+ Object argument) throws IOException {
+
+ if (this.translationTable != null) {
+ Iterator iterator = this.translationTable.entrySet().iterator();
+ while (iterator.hasNext()) {
+ Entry entry = (Entry) iterator.next();
+
+ if (this.translatedModel) {
+ visitor.process(context, new TranslatedRowKey(
+ entry.getValue(), String.valueOf(entry.getKey())), argument);
+ } else {
+ visitor.process(context, entry.getKey(), argument);
+ }
+ }
+ } else {
+ for (int i = 0; i < getRowCount(); i++) {
+ if (this.translatedModel) {
+ Integer key = new Integer(i);
+ visitor.process(context, new TranslatedRowKey(
+ translate(key), String.valueOf(key)), argument);
+ } else {
+ visitor.process(context, new Integer(i), argument);
+ }
+ }
+ }
+ }
+
+ public void setTranslationTable(Map translationTable) {
+ this.translationTable = translationTable;
+ }
+}
Deleted: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/model/TranslatedSequenceDataModel.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/model/TranslatedSequenceDataModel.java 2007-11-28 17:59:37 UTC (rev 4321)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/model/TranslatedSequenceDataModel.java 2007-11-28 17:59:50 UTC (rev 4322)
@@ -1,130 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.DataModel;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.Range;
-import org.ajax4jsf.model.SequenceDataModel;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 07.11.2007
- *
- */
-public class TranslatedSequenceDataModel extends SequenceDataModel {
-
- protected static final class TranslatedRowKey {
- private Object key;
- private String asString;
-
- public TranslatedRowKey(Object key, String asString) {
- super();
- this.key = key;
- this.asString = asString;
- }
-
- public Object getKey() {
- return key;
- }
-
- public String getAsString() {
- return asString;
- }
-
- public String toString() {
- return getAsString();
- }
- };
-
- private Map translationTable;
- private boolean translatedModel;
-
- private Object rowKey;
-
- public TranslatedSequenceDataModel(DataModel wrapped,
- boolean translatedModel, Map translationTable) {
- super(wrapped);
- this.translatedModel = translatedModel;
- this.translationTable = translationTable;
- }
-
- public TranslatedSequenceDataModel(DataModel wrapped) {
- super(wrapped);
- }
-
- private Object translate(Object key) {
- if (translationTable != null) {
- return translationTable.get(key);
- } else {
- return key;
- }
- }
-
- public Object getTranslatedRowKey() {
- return super.getRowKey();
- }
-
- public Object getRowKey() {
- return rowKey;
- }
-
- public void setRowKey(Object key) {
- this.rowKey = key;
-
- if (key instanceof TranslatedRowKey) {
- super.setRowKey(((TranslatedRowKey) key).getKey());
- } else {
- if (this.translatedModel) {
- if (rowKey != null) {
- super.setRowKey(translate(key));
- } else {
- super.setRowKey(null);
- }
- } else {
- super.setRowKey(key);
- }
- }
- }
-
- public void walk(FacesContext context, DataVisitor visitor, Range range,
- Object argument) throws IOException {
-
- if (this.translationTable != null) {
- Iterator iterator = this.translationTable.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
-
- if (this.translatedModel) {
- visitor.process(context, new TranslatedRowKey(
- entry.getValue(), String.valueOf(entry.getKey())), argument);
- } else {
- visitor.process(context, entry.getKey(), argument);
- }
- }
- } else {
- for (int i = 0; i < getRowCount(); i++) {
- if (this.translatedModel) {
- Integer key = new Integer(i);
- visitor.process(context, new TranslatedRowKey(
- translate(key), String.valueOf(key)), argument);
- } else {
- visitor.process(context, new Integer(i), argument);
- }
- }
- }
- }
-
- public void setTranslationTable(Map translationTable) {
- this.translationTable = translationTable;
- }
-}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-11-28 17:59:37 UTC (rev 4321)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-11-28 17:59:50 UTC (rev 4322)
@@ -15,8 +15,11 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.renderkit.ComponentVariables;
+import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIOrderingBaseComponent;
+import org.richfaces.component.UIOrderingBaseComponent.ItemState;
/**
* @author Nick Belaevski
@@ -24,6 +27,8 @@
*/
public abstract class OrderingComponentRendererBase extends AbstractRowsRenderer {
+ private static final String ITEM_STATE_VAR_NAME = "itemState";
+
protected final static String SHOW_LABELS_ATTRIBUTE_NAME = "showButtonLabels";
protected final static String ATTRIBUTE_CE_ONHEADERCLICK = "onheaderclick";
@@ -351,4 +356,18 @@
helper, clientId, bundle ,enabled);
}
}
+
+ public void encodeBegin(FacesContext context, UIComponent component)
+ throws IOException {
+ UIOrderingBaseComponent orderingComponent = (UIOrderingBaseComponent) component;
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
+ variables.setVariable(ITEM_STATE_VAR_NAME, orderingComponent.getItemState());
+
+ super.encodeBegin(context, component);
+ }
+
+ protected ItemState getItemState(FacesContext context, UIComponent component, ComponentVariables variables)
+ throws IOException {
+ return (ItemState) variables.getVariable(ITEM_STATE_VAR_NAME);
+ }
}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-28 17:59:37 UTC (rev 4321)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-28 17:59:50 UTC (rev 4322)
@@ -10,27 +10,16 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.component.UIDataAdaptor;
import org.ajax4jsf.renderkit.ComponentVariables;
import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIOrderingList;
-import org.richfaces.component.UIOrderingList.ItemState;
-import org.richfaces.renderkit.html.images.OrderingListIconBottom;
-import org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled;
-import org.richfaces.renderkit.html.images.OrderingListIconDown;
-import org.richfaces.renderkit.html.images.OrderingListIconDownDisabled;
-import org.richfaces.renderkit.html.images.OrderingListIconTop;
-import org.richfaces.renderkit.html.images.OrderingListIconTopDisabled;
-import org.richfaces.renderkit.html.images.OrderingListIconUp;
-import org.richfaces.renderkit.html.images.OrderingListIconUpDisabled;
+import org.richfaces.component.UIOrderingBaseComponent.ItemState;
public abstract class OrderingListRendererBase extends OrderingComponentRendererBase {
private static final String SELECTION_STATE_VAR_NAME = "selectionState";
- private static final String ITEM_STATE_VAR_NAME = "itemState";
-
public OrderingListRendererBase() {
super(MESSAGE_BUNDLE_NAME);
}
@@ -56,7 +45,6 @@
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
- variables.setVariable(ITEM_STATE_VAR_NAME, ((UIOrderingList) component).getItemState());
variables.setVariable(SELECTION_STATE_VAR_NAME, new OrderingListSelectionState());
super.encodeBegin(context, component);
@@ -135,10 +123,10 @@
StringBuffer cellClassName = new StringBuffer("rich-ordering-list-cell");
ComponentVariables variables = ComponentsVariableResolver.getVariables(this, table);
+ ItemState state = getItemState(context, table, variables);
- ItemState state = (ItemState) variables.getVariable(ITEM_STATE_VAR_NAME);
-
- if (state.isActive()) {
+ boolean active = state.isActive();
+ if (active) {
rowClassName.append(" rich-ordering-list-row-active");
cellClassName.append(" rich-ordering-list-cell-active");
}
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-28 17:59:37 UTC (rev 4321)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-28 17:59:50 UTC (rev 4322)
@@ -49,14 +49,14 @@
this.shuttleTbody = this.shuttleTable.tBodies[0];
+ this.activeItem = null;
this.items = null;
+
this.retrieveShuttleItems(containerId);
this.shuttle = null;
this.sortOrder = Richfaces.ListBase.ASC;
- this.activeItem = null;
-
$(contentTableId).observe("click", function(e) {this.onclickHandler(window.event || e)}.bindAsEventListener(this));
},
@@ -143,6 +143,8 @@
Richfaces.SelectItems.doActive(this.activeItem);
this.setFocus();
+
+ this.saveState();
//this.layoutManager.widthSynchronization();
}
},
@@ -166,6 +168,7 @@
Event.stop(event);
}
Richfaces.SelectItems.doActive(this.activeItem);
+ this.saveSate();
break;
case 32 : this.invertSelection(event); break; //blank
}
@@ -193,6 +196,8 @@
}
this.autoScrolling(action, event);
+
+ this.saveState();
//this.layoutManager.widthSynchronization();
},
@@ -252,6 +257,8 @@
if (this.activeItem && !this.getSelectItemByNode(this.activeItem)._selected) {
Richfaces.SelectItems.doNormal(this.activeItem);
}
+
+ this.saveState();
},
/**
@@ -283,6 +290,8 @@
this.selectedItems.push(rows[i]);
this.getSelectItemByNode(rows[i])._selected = true;
}
+
+ this.saveState();
},
resetMarked : function() {
17 years, 1 month
JBoss Rich Faces SVN: r4321 - in branches/3.1.x/sandbox/ui/listShuttle/src/main: java/org/richfaces/model and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-28 12:59:37 -0500 (Wed, 28 Nov 2007)
New Revision: 4321
Modified:
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/model/ListShuttleDataModel.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss
Log:
latest changes for listShuttle & orderingList
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-11-28 17:08:11 UTC (rev 4320)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-11-28 17:59:37 UTC (rev 4321)
@@ -6,11 +6,7 @@
import java.io.IOException;
import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
+import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
@@ -39,6 +35,25 @@
public static final String COMPONENT_FAMILY = "org.richfaces.ListShuttle";
+ private final class ModelItemState implements ItemState {
+ private Collection selectedItems;
+ private Object activeItem;
+
+ public ModelItemState(Collection selectedItems, Object activeItem) {
+ super();
+ this.selectedItems = selectedItems;
+ this.activeItem = activeItem;
+ }
+
+ public boolean isSelected() {
+ return selectedItems != null && selectedItems.contains(getRowData());
+ }
+
+ public boolean isActive() {
+ return activeItem != null && ((Set) activeItem).contains(getRowData());
+ }
+ }
+
protected static final class SubmittedValue extends OrderingBaseAbstractSubmittedValue {
private static final Pattern KEY_STRING_PATTERN = Pattern.compile("(s?\\d+)(s?a?)");
/**
@@ -48,22 +63,22 @@
//ListShuttleRowKey -> ListShuttleRowKey
private Map sourceTranslationTable = null;
private Map targetTranslationTable = null;
-
+
private transient boolean source;
-
+
public SubmittedValue(String[] submittedStrings) {
super();
-
+
source = true;
sourceTranslationTable = asMap(submittedStrings[0]);
source = false;
targetTranslationTable = asMap(submittedStrings[1]);
}
-
+
public String toTargetString() {
return asString(targetTranslationTable);
}
-
+
public String toSourceString() {
return asString(sourceTranslationTable);
}
@@ -84,7 +99,7 @@
char c = keyString.charAt(0);
boolean sourceKey = false;
Integer integer;
-
+
try {
if (c == 's') {
sourceKey = true;
@@ -95,7 +110,7 @@
} catch (NumberFormatException e) {
throw new FacesException(new IllegalArgumentException());
}
-
+
return new ListShuttleRowKey(integer, sourceKey, source);
}
@@ -111,7 +126,7 @@
public String getTargetSubmittedString() {
return submittedValueHolder != null ? submittedValueHolder.toTargetString() : "";
}
-
+
private transient Map sourceTranslationTable;
private transient Map targetTranslationTable;
@@ -122,7 +137,7 @@
*
*/
private static final long serialVersionUID = 2124352131407581704L;
-
+
private Object sourceValue;
private boolean sourceValueSet;
@@ -141,10 +156,10 @@
public Object saveState(FacesContext context) {
Object[] state = new Object[2];
-
+
state[0] = super.saveState(context);
state[1] = saveIterationState();
-
+
return state;
}
@@ -155,10 +170,6 @@
restoreIterationState(state[1]);
}
- public Object getLocalSourceValue() {
- return sourceValue;
- }
-
public Object getSourceValue() {
if (sourceValue != null) {
return sourceValue;
@@ -178,10 +189,6 @@
this.sourceValueSet = true;
}
- public Object getLocalTargetValue() {
- return targetValue;
- }
-
public Object getTargetValue() {
if (targetValue != null) {
return targetValue;
@@ -201,10 +208,6 @@
this.targetValueSet = true;
}
- public String[] getSubmittedStrings() {
- return null;
- }
-
public void setSubmittedStrings(String[] submittedStrings) {
//TODO check for parameters correlation
this.submittedValueHolder = new SubmittedValue(submittedStrings);
@@ -223,22 +226,22 @@
holder.sourceValue = sourceValue;
holder.sourceValueSet = sourceValueSet;
-
+
holder.targetValue = targetValue;
holder.targetValueSet = targetValueSet;
-
+
holder.sourceTranslationTable = sourceTranslationTable;
holder.targetTranslationTable = targetTranslationTable;
-
+
return holder;
}
-
+
protected void restoreIterationState(Object object) {
ValueHolder holder = (ValueHolder) object;
-
+
sourceValue = holder.sourceValue ;
sourceValueSet = holder.sourceValueSet;
-
+
targetValue = holder.targetValue;
targetValueSet = holder.targetValueSet;
@@ -249,11 +252,11 @@
public org.ajax4jsf.model.ExtendedDataModel createDataModel() {
DataModel sourceDataModel = createDataModel(getSourceValue());
DataModel targetDataModel = createDataModel(getTargetValue());
-
+
if (isTranslatedRenderingState() || isTranslatedState()) {
Map sourceTranslationTable = null;
Map targetTranslationTable = null;
-
+
if (submittedValueHolder != null) {
sourceTranslationTable = submittedValueHolder.sourceTranslationTable;
targetTranslationTable = submittedValueHolder.targetTranslationTable;
@@ -261,7 +264,7 @@
sourceTranslationTable = this.sourceTranslationTable;
targetTranslationTable = this.targetTranslationTable;
}
-
+
return new ListShuttleDataModel(sourceDataModel, targetDataModel,
isTranslatedState(),
sourceTranslationTable,
@@ -294,7 +297,7 @@
ListShuttleDataModel dataModel = (ListShuttleDataModel) getExtendedDataModel();
return dataModel.isTarget();
}
-
+
private final UpdateModelCommand updateSourceCommand = new UpdateModelCommand() {
public void execute(FacesContext context) {
@@ -307,9 +310,9 @@
}
}
}
-
+
};
-
+
private final UpdateModelCommand updateTargetCommand = new UpdateModelCommand() {
public void execute(FacesContext context) {
@@ -322,7 +325,7 @@
}
}
}
-
+
};
/**
@@ -423,131 +426,18 @@
return;
}
- Object[] newValue = null;
+ Object oldSourceValue = getSourceValue();
+ Object newSourceValue = oldSourceValue;
- try {
- newValue = getConvertedValue(context);
- }
- catch (ConverterException ce) {
- Object submittedValue = submittedValueHolder;
- //addConversionErrorMessage(context, ce, submittedValue);
- setValid(false);
- }
+ Object oldTargetValue = getTargetValue();
+ Object newTargetValue = oldTargetValue;
- //validateValue(context, newValue);
-
- // If our value is valid, store the new value, erase the
- // "submitted" value, and emit a ValueChangeEvent if appropriate
- if (isValid()) {
- Set selectionSet = new HashSet();
- Set selectedItems = submittedValueHolder.getSelection();
- for (Iterator iterator = selectedItems.iterator(); iterator
- .hasNext();) {
- setRowKey(context, iterator.next());
- Object selectionItem = getRowData();
-
- selectionSet.add(selectionItem);
- }
-
- setSelection(selectionSet);
-
-// if (submittedValueHolder.activeItem != null) {
-// setRowKey(context, submittedValueHolder.activeItem);
-// Object activeItem = getRowData();
-//
-// setActiveItem(activeItem);
-// } else {
-// setActiveItem(null);
-// }
-
- Object previousSource = getSourceValue();
- Object previousTarget = getTargetValue();
-
- setSourceValue(newValue[0]);
- setTargetValue(newValue[1]);
-
- setTranslatedState();
-
- if (compareValues(previousSource, newValue[0]) || compareValues(previousTarget, newValue[1])) {
- queueEvent(new ValueChangeEvent(this, new Object[]{previousSource,previousTarget}, newValue));
- }
-
- this.sourceTranslationTable = this.submittedValueHolder.sourceTranslationTable;
- this.targetTranslationTable = this.submittedValueHolder.targetTranslationTable;
-
- this.submittedValueHolder = null;
-
- }
- }
-
- private interface DataAdder {
- Object getContainer();
- void add(Object object);
- }
-
- private class ListDataAdder implements DataAdder {
- private ArrayList container;
-
- public ListDataAdder(int size) {
- container = new ArrayList(size);
- }
-
- public Object getContainer() {
- container.trimToSize();
- return container;
- }
-
- public void add(Object object) {
- container.add(object);
- }
- }
-
- private class ArrayDataAdder implements DataAdder {
- private int idx = 0;
- private Object[] objects;
-
- public ArrayDataAdder(Class objectClass, int size) {
- this.objects = (Object[]) Array.newInstance(objectClass.getComponentType(),
- size);
- }
-
- public void add(Object object) {
- this.objects[idx++] = object;
- }
-
- public Object getContainer() {
- return objects;
- }
- }
-
- private DataAdder createDataAdder(Object object, int size) {
- if (object instanceof List) {
- return new ListDataAdder(size);
- } else {
- return new ArrayDataAdder(object.getClass(), size);
- }
- }
-
- protected Object[] getConvertedValue(FacesContext context) throws ConverterException {
-// Object convertedValue = getSourceValue();
-// if (convertedValue == null) {
-// convertedValue = new Object[0];
-// }
-
- if (submittedValueHolder != null) {
- Object rowKey = getRowKey();
-
- Object oldSourceValue = getSourceValue();
- Object newSourceValue = oldSourceValue;
-
- Object oldTargetValue = getTargetValue();
- Object newTargetValue = oldTargetValue;
-
+ try {
final ListShuttleDataModel listShuttleDataModel = (ListShuttleDataModel) getExtendedDataModel();
-
+
listShuttleDataModel.setSourceTranslationTable(submittedValueHolder.getSourceTranslationTable());
listShuttleDataModel.setTargetTranslationTable(submittedValueHolder.getTargetTranslationTable());
-
+
try {
if (listShuttleDataModel.needSourceTranslation()) {
final DataAdder sourceValueAdder = createDataAdder(oldSourceValue, listShuttleDataModel.getSourceRowCount());
@@ -559,12 +449,12 @@
setRowKey(rowKey);
sourceValueAdder.add(getRowData());
}
-
+
}, null, null);
newSourceValue = sourceValueAdder.getContainer();
}
-
+
if (listShuttleDataModel.needTargetTranslation()) {
final DataAdder targetValueAdder = createDataAdder(oldTargetValue, listShuttleDataModel.getTargetRowCount());
listShuttleDataModel.walkTarget(context, new DataVisitor() {
@@ -575,21 +465,55 @@
setRowKey(rowKey);
targetValueAdder.add(getRowData());
}
-
+
}, null, null);
newTargetValue = targetValueAdder.getContainer();
}
-
- setRowKey(rowKey);
+
} catch (IOException e) {
throw new ConverterException(e.getLocalizedMessage(), e);
}
-
- return new Object[] {newSourceValue, newTargetValue};
}
+ catch (ConverterException ce) {
+ Object submittedValue = submittedValueHolder;
+ //addConversionErrorMessage(context, ce, submittedValue);
+ setValid(false);
+ }
- return null;
+ //validateValue(context, newValue);
+
+ // If our value is valid, store the new value, erase the
+ // "submitted" value, and emit a ValueChangeEvent if appropriate
+ if (isValid()) {
+ Set[] sets = convertKeySets(context,
+ new Set[] {
+ submittedValueHolder.getSelection(),
+ submittedValueHolder.getActiveItems() });
+
+ setSelection(sets[0]);
+ setActiveItem(sets[1]);
+
+ Object previousSource = getSourceValue();
+ Object previousTarget = getTargetValue();
+
+ setSourceValue(newSourceValue);
+ setTargetValue(newTargetValue);
+
+ setTranslatedState();
+
+ if (compareValues(previousSource, newSourceValue) || compareValues(previousTarget, newTargetValue)) {
+ queueEvent(new ValueChangeEvent(this,
+ new Object[]{previousSource,previousTarget},
+ new Object[]{newSourceValue, newTargetValue}));
+ }
+
+ this.sourceTranslationTable = this.submittedValueHolder.sourceTranslationTable;
+ this.targetTranslationTable = this.submittedValueHolder.targetTranslationTable;
+
+ this.submittedValueHolder = null;
+
+ }
}
protected void resetDataModel() {
@@ -597,13 +521,22 @@
this.sourceTranslationTable = null;
this.targetTranslationTable = null;
-
+
if (this.submittedValueHolder != null) {
setTranslatedRenderingState();
}
}
-
+
public Object getTranslatedRowKey() {
return ((ListShuttleDataModel) getExtendedDataModel()).getTranslatedRowKey();
}
+
+ public ItemState getItemState() {
+ if (submittedValueHolder != null) {
+ return new SubmittedItemState(submittedValueHolder.getSelection(),
+ submittedValueHolder.getActiveItems());
+ } else {
+ return new ModelItemState(getSelection(), getActiveItem());
+ }
+ }
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/model/ListShuttleDataModel.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2007-11-28 17:08:11 UTC (rev 4320)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2007-11-28 17:59:37 UTC (rev 4321)
@@ -4,6 +4,7 @@
package org.richfaces.model;
import java.io.IOException;
+import java.io.Serializable;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
@@ -36,7 +37,12 @@
private Map targetTranslationTable;
- protected static final class TranslatedRowKey {
+ protected static final class TranslatedRowKey implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7299475726153818934L;
+
private Object rowKey;
private String asString;
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2007-11-28 17:08:11 UTC (rev 4320)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2007-11-28 17:59:37 UTC (rev 4321)
@@ -21,6 +21,7 @@
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIListShuttle;
import org.richfaces.component.UIOrderingBaseComponent;
+import org.richfaces.component.UIOrderingBaseComponent.ItemState;
/**
* @author Nick Belaevski
@@ -65,18 +66,18 @@
encodeHeader(context, shuttle, "rich-table-header", "ol_col rich-table-header-cell", "sourceHeaderClass");
}
- public void encodeTLRows(FacesContext context, UIListShuttle shuttle) throws IOException {
+ public void encodeTLRows(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
encodeRows(context, shuttle, new ListShuttleRendererTableHolder(shuttle, false));
}
- public void encodeSLCaption(FacesContext context, UIListShuttle shuttle) throws IOException {
+ public void encodeSLCaption(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
encodeCaption(context, shuttle, FACET_SOURCE_CAPTION, "ol_label ol_out_label rich-ordering-list-caption");
}
public void encodeSLHeader(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
encodeHeader(context, shuttle, "rich-table-header", "ol_col rich-table-header-cell", "sourceHeaderClass");
}
- public void encodeSLRows(FacesContext context, UIListShuttle shuttle) throws IOException {
+ public void encodeSLRows(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
encodeRows(context, shuttle, new ListShuttleRendererTableHolder(shuttle, true));
}
@@ -96,6 +97,16 @@
StringBuffer rowClassName = new StringBuffer("ol_normal rich-ordering-list-row");
StringBuffer cellClassName = new StringBuffer("ol_cell rich-ordering-list-cell");
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this, table);
+ ItemState itemState = getItemState(context, table, variables);
+
+ boolean active = itemState.isActive();
+ if (active) {
+
+ }
+
+ boolean selected = itemState.isSelected();
+
writer.writeAttribute("class", rowClassName.toString(), null);
List children = table.getChildren();
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss 2007-11-28 17:08:11 UTC (rev 4320)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss 2007-11-28 17:59:37 UTC (rev 4321)
@@ -333,6 +333,15 @@
white-space: nowrap;
}
+.rich-ordering-list-cell-selected, rich-ordering-list-cell-selected * {
+ padding : 2px;
+ white-space: nowrap;
+}
+
+.rich-ordering-list-cell-active, .rich-ordering-list-cell-active * {
+
+}
+
.rich-ordering-list-ds {
-moz-user-select: -moz-none;
}
@@ -441,6 +450,17 @@
<u:style name="font-size" skin="generalSizeFont" />
</u:selector>
+ <u:selector name=".rich-ordering-list-cell-selected, .rich-ordering-list-cell-selected *">
+ <u:style name="color" skin="generalTextColor"/>
+ <u:style name="font-family" skin="generalFamilyFont" />
+ <u:style name="font-size" skin="generalSizeFont" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-list-cell-active, .rich-ordering-list-cell-active *">
+ <u:style name="font-size" skin="generalSizeFont" />
+ <u:style name="font-family" skin="generalFamilyFont" />
+ </u:selector>
+
<u:selector name=".rich-ordering-control-disabled">
<u:style name="border-color" skin="panelBorderColor" />
</u:selector>
@@ -485,6 +505,5 @@
<u:style name="background-color" skin="headerGradientColor" />
</u:selector>
}
-
</f:template>
\ No newline at end of file
17 years, 1 month