JBoss Rich Faces SVN: r20165 - in branches/RF-8742-1/ui: common/api/src and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-11-24 18:24:52 -0500 (Wed, 24 Nov 2010)
New Revision: 20165
Removed:
branches/RF-8742-1/ui/common/api/build/
branches/RF-8742-1/ui/common/api/src/META-INF/
branches/RF-8742-1/ui/common/ui/build/
branches/RF-8742-1/ui/common/ui/src/META-INF/
branches/RF-8742-1/ui/validator/api/build/
branches/RF-8742-1/ui/validator/api/src/META-INF/
branches/RF-8742-1/ui/validator/ui/build/
branches/RF-8742-1/ui/validator/ui/src/META-INF/
Log:
remeve accidently added folders
14 years, 1 month
JBoss Rich Faces SVN: r20164 - in branches/RF-8742-1/ui: common/api/build and 18 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-11-24 18:17:41 -0500 (Wed, 24 Nov 2010)
New Revision: 20164
Added:
branches/RF-8742-1/ui/common/api/build/
branches/RF-8742-1/ui/common/api/build/classes/
branches/RF-8742-1/ui/common/api/src/META-INF/
branches/RF-8742-1/ui/common/api/src/META-INF/MANIFEST.MF
branches/RF-8742-1/ui/common/ui/build/
branches/RF-8742-1/ui/common/ui/build/classes/
branches/RF-8742-1/ui/common/ui/src/META-INF/
branches/RF-8742-1/ui/common/ui/src/META-INF/MANIFEST.MF
branches/RF-8742-1/ui/validator/api/build/
branches/RF-8742-1/ui/validator/api/build/classes/
branches/RF-8742-1/ui/validator/api/src/META-INF/
branches/RF-8742-1/ui/validator/api/src/META-INF/MANIFEST.MF
branches/RF-8742-1/ui/validator/ui/build/
branches/RF-8742-1/ui/validator/ui/build/classes/
branches/RF-8742-1/ui/validator/ui/src/META-INF/
branches/RF-8742-1/ui/validator/ui/src/META-INF/MANIFEST.MF
Modified:
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientScriptServiceImpl.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientServiceConfigParser.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/LibraryFunctionImplementation.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/component/Bean.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/component/UIValidatorScriptCollectionTest.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/ClientScriptServiceTest.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/ServiceConfigParserTest.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
Log:
CODING IN PROGRESS - issue RF-9799: CSV code review
https://jira.jboss.org/browse/RF-9799
Added: branches/RF-8742-1/ui/common/api/src/META-INF/MANIFEST.MF
===================================================================
--- branches/RF-8742-1/ui/common/api/src/META-INF/MANIFEST.MF (rev 0)
+++ branches/RF-8742-1/ui/common/api/src/META-INF/MANIFEST.MF 2010-11-24 23:17:41 UTC (rev 20164)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: branches/RF-8742-1/ui/common/api/src/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742-1/ui/common/ui/src/META-INF/MANIFEST.MF
===================================================================
--- branches/RF-8742-1/ui/common/ui/src/META-INF/MANIFEST.MF (rev 0)
+++ branches/RF-8742-1/ui/common/ui/src/META-INF/MANIFEST.MF 2010-11-24 23:17:41 UTC (rev 20164)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: branches/RF-8742-1/ui/common/ui/src/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742-1/ui/validator/api/src/META-INF/MANIFEST.MF
===================================================================
--- branches/RF-8742-1/ui/validator/api/src/META-INF/MANIFEST.MF (rev 0)
+++ branches/RF-8742-1/ui/validator/api/src/META-INF/MANIFEST.MF 2010-11-24 23:17:41 UTC (rev 20164)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: branches/RF-8742-1/ui/validator/api/src/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742-1/ui/validator/ui/src/META-INF/MANIFEST.MF
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/META-INF/MANIFEST.MF (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/META-INF/MANIFEST.MF 2010-11-24 23:17:41 UTC (rev 20164)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: branches/RF-8742-1/ui/validator/ui/src/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientScriptServiceImpl.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientScriptServiceImpl.java 2010-11-24 19:07:35 UTC (rev 20163)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientScriptServiceImpl.java 2010-11-24 23:17:41 UTC (rev 20164)
@@ -52,7 +52,7 @@
private LibraryFunction getScriptFromAnnotation(Class<?> javaClass) throws ScriptNotFoundException {
if (javaClass.isAnnotationPresent(ClientSideScript.class)) {
ClientSideScript clientSideScript = javaClass.getAnnotation(ClientSideScript.class);
- return new LibraryFunctionImplementation(clientSideScript.library(), clientSideScript.resource(), clientSideScript.function());
+ return new LibraryFunctionImplementation(clientSideScript.function(), clientSideScript.resource(), clientSideScript.library());
} else {
throw new ScriptNotFoundException();
}
@@ -65,7 +65,7 @@
Resource facesResource = resourceHandler.createResource(resourceName, ORG_RICHFACES_CSV, TEXT_JAVASCRIPT);
if (null != facesResource) {
final String functionName = Strings.firstToLowerCase(javaClass.getSimpleName());
- return new LibraryFunctionImplementation(ORG_RICHFACES_CSV,resourceName, functionName);
+ return new LibraryFunctionImplementation(functionName,resourceName, ORG_RICHFACES_CSV);
} else {
throw new ScriptNotFoundException();
}
Modified: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientServiceConfigParser.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientServiceConfigParser.java 2010-11-24 19:07:35 UTC (rev 20163)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientServiceConfigParser.java 2010-11-24 23:17:41 UTC (rev 20164)
@@ -52,8 +52,8 @@
ClientSideScripts clientSideScripts = JAXB.unmarshal(url, ClientSideScripts.class);
for (Component component : clientSideScripts.getComponent()) {
Class<?> componentClass = loader.loadClass(component.getType());
- LibraryFunctionImplementation function = new LibraryFunctionImplementation(component.getLibrary(),
- component.getResource(), component.getFunction());
+ LibraryFunctionImplementation function = new LibraryFunctionImplementation(component.getFunction(),
+ component.getResource(), component.getLibrary());
result.put(componentClass, function);
}
} catch (ClassNotFoundException e) {
Modified: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/LibraryFunctionImplementation.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/LibraryFunctionImplementation.java 2010-11-24 19:07:35 UTC (rev 20163)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/javascript/LibraryFunctionImplementation.java 2010-11-24 23:17:41 UTC (rev 20164)
@@ -7,13 +7,13 @@
private final ResourceKey library;
private final String functionName;
- LibraryFunctionImplementation(ResourceKey library, String functionName) {
+ LibraryFunctionImplementation(String functionName, ResourceKey library) {
this.library = library;
this.functionName = functionName;
}
- LibraryFunctionImplementation(String library, String resource, String functionName) {
- this.library = new ResourceKey(library, resource);
+ LibraryFunctionImplementation(String functionName, String resource, String library) {
+ this.library = ResourceKey.create(resource,library);
this.functionName = functionName;
}
Modified: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/component/Bean.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/component/Bean.java 2010-11-24 19:07:35 UTC (rev 20163)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/component/Bean.java 2010-11-24 23:17:41 UTC (rev 20164)
@@ -10,8 +10,8 @@
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
-import org.richfaces.javascript.LibraryResource;
import org.richfaces.renderkit.html.ComponentValidatorScript;
+import org.richfaces.resource.ResourceKey;
/**
* @author asmirnov
@@ -29,7 +29,7 @@
public static final String TEST_SCRIPT = "function " + FOO + "(id){alert(id);}";
- private static final LibraryResource TEST_RESOURCE = new LibraryResource(FOO_BAR, TEST_SCRIPT_NAME + ".js");
+ private static final ResourceKey TEST_RESOURCE = ResourceKey.create(TEST_SCRIPT_NAME + ".js",FOO_BAR);
private static final ComponentValidatorScript SCRIPT = new ComponentValidatorScript() {
@@ -49,7 +49,7 @@
}
}
- public Collection<LibraryResource> getResources() {
+ public Collection<ResourceKey> getResources() {
return Collections.singleton(TEST_RESOURCE);
}
Modified: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/component/UIValidatorScriptCollectionTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/component/UIValidatorScriptCollectionTest.java 2010-11-24 19:07:35 UTC (rev 20163)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/component/UIValidatorScriptCollectionTest.java 2010-11-24 23:17:41 UTC (rev 20164)
@@ -6,10 +6,10 @@
import java.util.Collection;
import org.junit.Test;
-import org.richfaces.javascript.LibraryResource;
import org.richfaces.javascript.LibraryScriptString;
import org.richfaces.renderkit.html.ClientOnlyScript;
import org.richfaces.renderkit.html.ComponentValidatorScript;
+import org.richfaces.resource.ResourceKey;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@@ -21,7 +21,7 @@
*/
public class UIValidatorScriptCollectionTest {
- static final LibraryResource FOO_RESOURCE = new LibraryResource("org.rf", "foo");
+ static final ResourceKey FOO_RESOURCE = ResourceKey.create("foo","org.rf");
@Test
Modified: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/ClientScriptServiceTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/ClientScriptServiceTest.java 2010-11-24 19:07:35 UTC (rev 20163)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/ClientScriptServiceTest.java 2010-11-24 23:17:41 UTC (rev 20164)
@@ -89,7 +89,7 @@
public void testGetScriptAsJsfResource() throws Exception {
LibraryFunction script = getScript(resource, ValidatorWithFacesResource.class);
assertEquals(RESOURCE_NAME, script.getResource().getResourceName());
- assertEquals(ORG_RICHFACES_CSV, script.getResource().getLibrary());
+ assertEquals(ORG_RICHFACES_CSV, script.getResource().getLibraryName());
assertEquals("validatorWithFacesResource", script.getName());
}
@@ -97,7 +97,7 @@
public void testGetScriptFromAnnotation() throws Exception {
LibraryFunction script = getScript(null, ValidatorWithFacesResource.class);
assertEquals("baz.js", script.getResource().getResourceName());
- assertEquals("bar", script.getResource().getLibrary());
+ assertEquals("bar", script.getResource().getLibraryName());
assertEquals("foo", script.getName());
}
Modified: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/ServiceConfigParserTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/ServiceConfigParserTest.java 2010-11-24 19:07:35 UTC (rev 20163)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/ServiceConfigParserTest.java 2010-11-24 23:17:41 UTC (rev 20164)
@@ -30,7 +30,7 @@
LibraryFunction libraryFunction = parseConfig.get(String.class);
assertEquals("stringConverter", libraryFunction.getName());
assertEquals("csv.js", libraryFunction.getResource().getResourceName());
- assertEquals("org.richfaces", libraryFunction.getResource().getLibrary());
+ assertEquals("org.richfaces", libraryFunction.getResource().getLibraryName());
}
@Test(expected=FacesException.class)
Modified: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java 2010-11-24 19:07:35 UTC (rev 20163)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java 2010-11-24 23:17:41 UTC (rev 20164)
@@ -1,12 +1,9 @@
package org.richfaces.renderkit.html;
-import static org.easymock.EasyMock.expect;
-import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.matchers.JUnitMatchers.containsString;
-import static org.junit.matchers.JUnitMatchers.hasItem;
+import static org.easymock.EasyMock.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
+import static org.junit.matchers.JUnitMatchers.*;
import java.util.ArrayList;
import java.util.Collection;
@@ -28,7 +25,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.javascript.LibraryFunction;
-import org.richfaces.javascript.LibraryResource;
import org.richfaces.javascript.LibraryScriptString;
import org.richfaces.javascript.ScriptNotFoundException;
import org.richfaces.resource.ResourceKey;
@@ -45,12 +41,12 @@
private static final String NUMBER_CONVERTER = "numConverter";
- private static final Matcher<LibraryResource> CORE_LIBRARY_MATCHER = new BaseMatcher<LibraryResource>() {
+ private static final Matcher<ResourceKey> CORE_LIBRARY_MATCHER = new BaseMatcher<ResourceKey>() {
public boolean matches(Object arg0) {
- if (arg0 instanceof LibraryResource) {
- LibraryResource resource = (LibraryResource) arg0;
- return ORG_RICHFACES.equals(resource.getLibrary())
+ if (arg0 instanceof ResourceKey) {
+ ResourceKey resource = (ResourceKey) arg0;
+ return ORG_RICHFACES.equals(resource.getLibraryName())
&& CLIENT_VALIDATORS_JS.equals(resource.getResourceName());
}
return false;
Modified: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-11-24 19:07:35 UTC (rev 20163)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-11-24 23:17:41 UTC (rev 20164)
@@ -7,7 +7,7 @@
import org.jboss.test.faces.mock.Mock;
import org.richfaces.component.behavior.BehaviorTestBase;
import org.richfaces.component.behavior.ClientValidatorBehavior;
-import org.richfaces.javascript.LibraryResource;
+import org.richfaces.resource.ResourceKey;
import com.google.common.collect.ImmutableMap;
@@ -18,7 +18,7 @@
protected static final String REGEX_VALIDATOR = "regexValidator";
protected static final FacesMessage VALIDATOR_MESSAGE = new FacesMessage("Validator Message");
protected static final Map<String, ? extends Object> VALIDATOR_PARAMS = ImmutableMap.of("foo", "value", "bar", 10);
- protected static final LibraryResource CLIENT_VALIDATOR_LIBRARY = new LibraryResource(ORG_RICHFACES, CLIENT_VALIDATORS_JS);
+ protected static final ResourceKey CLIENT_VALIDATOR_LIBRARY = ResourceKey.create(CLIENT_VALIDATORS_JS,ORG_RICHFACES);
protected ClientValidatorRenderer renderer = new ClientValidatorRenderer();
14 years, 1 month
JBoss Rich Faces SVN: r20163 - trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-11-24 14:07:35 -0500 (Wed, 24 Nov 2010)
New Revision: 20163
Modified:
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
Log:
remove logger
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-11-24 18:50:05 UTC (rev 20162)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-11-24 19:07:35 UTC (rev 20163)
@@ -29,8 +29,6 @@
import javax.faces.view.facelets.TagAttribute;
import org.ajax4jsf.component.behavior.ClientBehavior;
-import org.richfaces.log.RichfacesLogger;
-import org.richfaces.log.Logger;
/**
* @author Anton Belevich
@@ -40,8 +38,6 @@
public static final BehaviorRule INSTANCE = new BehaviorRule();
- private static Logger log = RichfacesLogger.CONNECTION.getLogger();
-
static final class LiteralAttributeMetadata extends Metadata {
private final String name;
14 years, 1 month
JBoss Rich Faces SVN: r20162 - in sandbox/trunk/examples: dnd-demo and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-11-24 13:50:05 -0500 (Wed, 24 Nov 2010)
New Revision: 20162
Added:
sandbox/trunk/examples/dnd-demo/
sandbox/trunk/examples/dnd-demo/.checkstyle
sandbox/trunk/examples/dnd-demo/pom.xml
sandbox/trunk/examples/dnd-demo/src/
sandbox/trunk/examples/dnd-demo/src/main/
sandbox/trunk/examples/dnd-demo/src/main/java/
sandbox/trunk/examples/dnd-demo/src/main/webapp/
sandbox/trunk/examples/dnd-demo/src/main/webapp/WEB-INF/
sandbox/trunk/examples/dnd-demo/src/main/webapp/WEB-INF/web.xml
sandbox/trunk/examples/dnd-demo/src/main/webapp/examples/
sandbox/trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml
sandbox/trunk/examples/dnd-demo/src/main/webapp/index.xhtml
Log:
dev sample - initial commit
Added: sandbox/trunk/examples/dnd-demo/.checkstyle
===================================================================
--- sandbox/trunk/examples/dnd-demo/.checkstyle (rev 0)
+++ sandbox/trunk/examples/dnd-demo/.checkstyle 2010-11-24 18:50:05 UTC (rev 20162)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="Richfaces" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
Added: sandbox/trunk/examples/dnd-demo/pom.xml
===================================================================
--- sandbox/trunk/examples/dnd-demo/pom.xml (rev 0)
+++ sandbox/trunk/examples/dnd-demo/pom.xml 2010-11-24 18:50:05 UTC (rev 20162)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>dnd-demo</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces Examples: DND</name>
+ <packaging>war</packaging>
+
+ <properties>
+ </properties>
+
+ <build>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1-beta-1</version>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>jee6</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1-alpha-1</version>
+ <configuration>
+ <webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jee6</id>
+ <phase>package</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
+ <classifier>jee6</classifier>
+ <packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</packagingExcludes>
+ <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</warSourceExcludes>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.dnd</groupId>
+ <artifactId>richfaces-ui-dnd-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.dnd</groupId>
+ <artifactId>richfaces-ui-dnd-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ </dependency>
+
+ <!-- Tests -->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.10</version>
+ <classifier>jdk15</classifier>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Added: sandbox/trunk/examples/dnd-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/examples/dnd-demo/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ sandbox/trunk/examples/dnd-demo/src/main/webapp/WEB-INF/web.xml 2010-11-24 18:50:05 UTC (rev 20162)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <display-name>Sample RichFaces 4 Application</display-name>
+
+ <!-- context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinning</param-name>
+ <param-value>#{skinBean.enableElementsSkinning}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinningClasses</param-name>
+ <param-value>#{skinBean.enableClassesSkinning}</param-value>
+ </context-param -->
+
+
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <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>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+ <welcome-file>faces/index.xhtml</welcome-file>
+ </welcome-file-list>
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+</web-app>
\ No newline at end of file
Added: sandbox/trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml
===================================================================
--- sandbox/trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml (rev 0)
+++ sandbox/trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml 2010-11-24 18:50:05 UTC (rev 20162)
@@ -0,0 +1,82 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:dnd="http://richfaces.org/dnd"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+<h:head>
+ <title>Drag-n-Drop sample</title>
+ <style type="text/css">
+.droppable {
+ border: 1px solid blue;
+ margin: 4px;
+ height: 200px;
+ width: 200px;
+ background-color: yellow;
+}
+
+.draggable {
+ border: 1px solid #000000;
+ background-color: grey;
+ opacity: 0.3;
+ margin: 2px;
+ height: 50px;
+ width: 100px;
+}
+
+.rf-ind {
+ height: 50px;
+ width: 50px;
+ border: 1px dotted red;
+ background-color: blue
+}
+
+.rf-ind-acp {
+ height: 50px;
+ width: 50px;
+ border: 1px dotted red;
+ background-color: green;
+}
+
+.rf-ind-rej {
+ height: 50px;
+ width: 50px;
+ border: 1px dotted green;
+ background-color: red;
+}
+</style>
+</h:head>
+<h:body>
+ <h:form>
+
+ <dnd:dragIndicator id="ind" styleClass="rf-ind" acceptClass="rf-ind-acp" rejectClass="rf-ind-rej"/>
+ <dnd:dragIndicator id="ind2" styleClass="rf-ind" acceptClass="rf-ind-acp" rejectClass="rf-ind-rej"/>
+
+ <table>
+ <tr>
+ <td>
+ <a4j:outputPanel id="drg1" layout="block" styleClass="draggable">
+ <dnd:dragBehavior event="mouseover" type="drg1" indicator="ind"/>
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="drg2" layout="block" styleClass="draggable">
+ <dnd:dragBehavior event="mouseover" type="drg2" indicator="ind2"/>
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="drg3" layout="block" styleClass="draggable">
+ <dnd:dragBehavior event="mouseover" type="drg3" indicator="ind"/>
+ </a4j:outputPanel>
+ </td>
+ </tr>
+ </table>
+
+ <a4j:outputPanel id="drp" layout="block" styleClass="droppable">
+ <dnd:dropBehavior event="mouseover" acceptType="drg1, drg2" />
+ </a4j:outputPanel>
+ </h:form>
+</h:body>
+</html>
\ No newline at end of file
Added: sandbox/trunk/examples/dnd-demo/src/main/webapp/index.xhtml
===================================================================
--- sandbox/trunk/examples/dnd-demo/src/main/webapp/index.xhtml (rev 0)
+++ sandbox/trunk/examples/dnd-demo/src/main/webapp/index.xhtml 2010-11-24 18:50:05 UTC (rev 20162)
@@ -0,0 +1,20 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:pa="http://richfaces.org/panels">
+
+<body>
+<ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="title">RichFaces Sample</ui:define>
+
+ <ui:define name="body">
+ look at left
+ </ui:define>
+
+ <div style="top: auto;"></div>
+</ui:composition>
+</body>
+</html>
14 years, 1 month
JBoss Rich Faces SVN: r20161 - in sandbox/trunk/ui/drag-drop/ui/src/main: java/org/richfaces/component/behavior and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-11-24 13:48:24 -0500 (Wed, 24 Nov 2010)
New Revision: 20161
Added:
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-indicator.js
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-manager.js
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/indicator.ecss
sandbox/trunk/ui/drag-drop/ui/src/main/templates/
sandbox/trunk/ui/drag-drop/ui/src/main/templates/dragIndicator.template.xml
Removed:
sandbox/trunk/ui/drag-drop/ui/src/main/config/
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-dnd.js
Modified:
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DragBehavior.java
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DropBehavior.java
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DragBehaviorRendererBase.java
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java
Log:
implement client behavior dnd, fix bug with indicator remove
Modified: sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DragBehavior.java
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DragBehavior.java 2010-11-24 18:45:07 UTC (rev 20160)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DragBehavior.java 2010-11-24 18:48:24 UTC (rev 20161)
@@ -23,11 +23,8 @@
package org.richfaces.component.behavior;
-import javax.faces.render.RenderKitFactory;
-
import org.ajax4jsf.component.behavior.ClientBehavior;
import org.richfaces.cdk.annotations.JsfBehavior;
-import org.richfaces.cdk.annotations.JsfBehaviorRenderer;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
@@ -37,15 +34,40 @@
*/
@JsfBehavior(
- id = DragBehavior.BEHAVIOR_ID, renderer = @JsfBehaviorRenderer(renderKitId=RenderKitFactory.HTML_BASIC_RENDER_KIT, type=DropBehavior.BEHAVIOR_ID), tag = @Tag(name = "dragBehavior", handler = "org.richfaces.view.facelets.html.CustomBehaviorHandler", type = TagType.Facelets)
+ id = DragBehavior.BEHAVIOR_ID, tag = @Tag(name = "dragBehavior", handler = "org.richfaces.view.facelets.html.CustomBehaviorHandler", type = TagType.Facelets)
)
public class DragBehavior extends ClientBehavior {
public static final String BEHAVIOR_ID = "org.richfaces.component.behavior.DragBehavior";
-
+
+ enum PropertyKeys {
+ type, indicator;
+ }
+
+
+ public void setIndicator(String indicator) {
+ getStateHelper().put(PropertyKeys.indicator, indicator);
+ }
+
+ public String getIndicator() {
+ return (String)getStateHelper().get(PropertyKeys.indicator);
+ }
+
+ public void setType(String type) {
+ getStateHelper().put(PropertyKeys.type, type);
+ }
+
+ public String getType() {
+ return (String)getStateHelper().eval(PropertyKeys.type);
+ }
+
@Override
public void setLiteralAttribute(String name, Object value) {
-
+ if(compare(PropertyKeys.type, name)) {
+ setType((String)value);
+ } else if(compare(PropertyKeys.indicator, name)){
+ setIndicator((String)value);
+ }
}
public String getEvent() {
Modified: sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DropBehavior.java
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DropBehavior.java 2010-11-24 18:45:07 UTC (rev 20160)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DropBehavior.java 2010-11-24 18:48:24 UTC (rev 20161)
@@ -23,12 +23,13 @@
package org.richfaces.component.behavior;
-import javax.faces.render.RenderKitFactory;
+import java.util.Set;
+
import org.ajax4jsf.component.behavior.ClientBehavior;
import org.richfaces.cdk.annotations.JsfBehavior;
-import org.richfaces.cdk.annotations.JsfBehaviorRenderer;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.renderkit.util.CoreAjaxRendererUtils;
/**
* @author abelevich
@@ -36,14 +37,29 @@
*/
@JsfBehavior(
- id = DropBehavior.BEHAVIOR_ID, renderer = @JsfBehaviorRenderer(renderKitId=RenderKitFactory.HTML_BASIC_RENDER_KIT, type=DropBehavior.BEHAVIOR_ID), tag = @Tag(name = "dropBehavior", handler = "org.richfaces.view.facelets.html.CustomBehaviorHandler", type = TagType.Facelets))
+ id = DropBehavior.BEHAVIOR_ID, tag = @Tag(name = "dropBehavior", handler = "org.richfaces.view.facelets.html.CustomBehaviorHandler", type = TagType.Facelets)
+)
public class DropBehavior extends ClientBehavior {
public static final String BEHAVIOR_ID = "org.richfaces.component.behavior.DropBehavior";
+ enum PropertyKeys {
+ acceptType
+ }
+ public void setAcceptType(Set<String> acceptType) {
+ getStateHelper().put(PropertyKeys.acceptType, acceptType);
+ }
+
+ public Set<String> getAcceptType() {
+ return (Set<String>)getStateHelper().eval(PropertyKeys.acceptType);
+ }
+
@Override
public void setLiteralAttribute(String name, Object value) {
+ if(compare(PropertyKeys.acceptType, name)) {
+ setAcceptType(CoreAjaxRendererUtils.asSimpleSet(value));
+ }
}
@Override
Modified: sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DragBehaviorRendererBase.java
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DragBehaviorRendererBase.java 2010-11-24 18:45:07 UTC (rev 20160)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DragBehaviorRendererBase.java 2010-11-24 18:48:24 UTC (rev 20161)
@@ -22,33 +22,83 @@
package org.richfaces.renderkit;
+import java.util.HashMap;
+import java.util.Map;
+
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
+import javax.faces.context.FacesContext;
import javax.faces.render.ClientBehaviorRenderer;
+import javax.faces.render.FacesBehaviorRenderer;
import javax.faces.render.RenderKitFactory;
-import org.richfaces.cdk.annotations.JsfBehaviorRenderer;
-import org.richfaces.component.behavior.DropBehavior;
+import org.ajax4jsf.javascript.JSFunction;
+import org.richfaces.component.behavior.DragBehavior;
+import org.richfaces.renderkit.util.RendererUtils;
/**
* @author abelevich
*
*/
-(a)JsfBehaviorRenderer(renderKitId=RenderKitFactory.HTML_BASIC_RENDER_KIT, type=DropBehavior.BEHAVIOR_ID)
+@FacesBehaviorRenderer(rendererType = DragBehavior.BEHAVIOR_ID, renderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT)
+
@ResourceDependencies({
@ResourceDependency(name = "jquery.js"),
- @ResourceDependency(name = "jquery-ui-core.js"),
- @ResourceDependency(name = "jquery-dnd.js"),
- @ResourceDependency(name = "richfaces.js"),
- @ResourceDependency(name = "richfaces-dnd.js")
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(library = "org.richfaces", name = "jquery-ui-core.js"),
+ @ResourceDependency(library = "org.richfaces", name = "jquery-dnd.js"),
+ @ResourceDependency(library = "org.richfaces", name = "dnd-draggable.js"),
+ @ResourceDependency(library = "org.richfaces", name = "dnd-manager.js")
})
public class DragBehaviorRendererBase extends ClientBehaviorRenderer {
+
+ private static final RendererUtils UTILS = RendererUtils.getInstance();
+
@Override
public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior behavior) {
- return "DragBehavior encoded";
+ UIComponent parent = behaviorContext.getComponent();
+ JSFunction function = new JSFunction("RichFaces.ui.DnDManager.draggable");
+ function.addParameter(parent.getClientId(behaviorContext.getFacesContext()));
+ function.addParameter(getOptions(behaviorContext, behavior));
+ return function.toString();
}
+
+ public Map<String, Object> getOptions(ClientBehaviorContext clientBehaviorContext, ClientBehavior behavior) {
+ Map<String, Object> options = new HashMap<String, Object>();
+
+ if(behavior instanceof DragBehavior) {
+ DragBehavior dragBehavior = (DragBehavior)behavior;
+ options.put("indicator", getDragIndicatorClientId(clientBehaviorContext, dragBehavior));
+ options.put("type", dragBehavior.getType());
+ }
+
+ return options;
+ }
+
+ public String getDragIndicatorClientId(ClientBehaviorContext clientBehaviorContext, DragBehavior dragBehavior) {
+ String indicatorId = dragBehavior.getIndicator();
+
+ if(indicatorId != null) {
+ FacesContext facesContext = clientBehaviorContext.getFacesContext();
+ UIComponent clientBehaviorHolder = clientBehaviorContext.getComponent();
+ UIComponent indicator = getUtils().findComponentFor(facesContext, clientBehaviorHolder, indicatorId);
+
+ if(indicator != null) {
+ indicatorId = indicator.getClientId(facesContext);
+ }
+
+ }
+
+ return indicatorId;
+ }
+
+ public RendererUtils getUtils() {
+ return UTILS;
+ }
+
}
Modified: sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java 2010-11-24 18:45:07 UTC (rev 20160)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java 2010-11-24 18:48:24 UTC (rev 20161)
@@ -22,30 +22,58 @@
package org.richfaces.renderkit;
+import java.util.HashMap;
+import java.util.Map;
+
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.render.ClientBehaviorRenderer;
+import javax.faces.render.FacesBehaviorRenderer;
+import javax.faces.render.RenderKitFactory;
+import org.ajax4jsf.javascript.JSFunction;
+import org.richfaces.component.behavior.DropBehavior;
+
/**
* @author abelevich
*
*/
+
+@FacesBehaviorRenderer(rendererType = DropBehavior.BEHAVIOR_ID, renderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT)
+
@ResourceDependencies({
@ResourceDependency(name = "jquery.js"),
- @ResourceDependency(name = "jquery-ui-core.js"),
- @ResourceDependency(name = "jquery-dnd.js"),
- @ResourceDependency(name = "richfaces.js"),
- @ResourceDependency(name = "richfaces-dnd.js")
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(library = "org.richfaces", name = "jquery-ui-core.js"),
+ @ResourceDependency(library = "org.richfaces", name = "jquery-dnd.js"),
+ @ResourceDependency(library = "org.richfaces", name = "dnd-droppable.js"),
+ @ResourceDependency(library = "org.richfaces", name = "dnd-manager.js")
})
public class DropBehaviorRendererBase extends ClientBehaviorRenderer {
@Override
public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior behavior) {
- return "DropBehavior encoded";
+ UIComponent parent = behaviorContext.getComponent();
+ JSFunction function = new JSFunction("RichFaces.ui.DnDManager.droppable");
+ function.addParameter(parent.getClientId(behaviorContext.getFacesContext()));
+ function.addParameter(getOptions(behaviorContext, behavior));
+ return function.toString();
}
+ public Map<String, Object> getOptions(ClientBehaviorContext behaviorContext, ClientBehavior behavior) {
+ Map<String, Object> options = new HashMap<String, Object>();
+
+ if(behavior instanceof DropBehavior) {
+ DropBehavior dropBehavior = (DropBehavior)behavior;
+ options.put("acceptType", dropBehavior.getAcceptType());
+ }
+
+ return options;
+ }
}
Added: sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js (rev 0)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js 2010-11-24 18:48:24 UTC (rev 20161)
@@ -0,0 +1,58 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Draggable = function(id, options) {
+ this.dragElement = $(document.getElementById(id));
+ this.dragElement.draggable({addClasses: false});
+
+ if(options.indicator) {
+ var element = document.getElementById(options.indicator);
+ this.indicator = rf.$(options.indicator);
+ this.dragElement.draggable("option", "helper", function(){return element});
+ } else {
+ this.dragElement.draggable("option", "helper", 'clone');
+ }
+
+ this.options = options;
+
+ this.dragElement.data('type', this.options.type);
+ this.dragElement.data('indicator', this.indicator);
+ this.dragElement.data("init", true);
+
+ this.dragElement.bind('dragstart', $.proxy(this.dragStart, this));
+ this.dragElement.bind('drag', $.proxy(this.drag, this));
+ this.dragElement.bind('dragstop', $.proxy(this.dragStop, this));
+ };
+
+ var defaultOptions = {
+ };
+
+ $.extend(rf.ui.Draggable.prototype, ( function () {
+ return {
+ dragStart: function(e, ui) {
+ if(ui.helper && this.indicator) {
+ ui.helper.show();
+ }
+ },
+
+ drag: function(e, ui) {
+ var helper = ui.helper;
+ if(this.indicator) {
+ helper.addClass(this.indicator.draggingClass());
+ }
+ },
+
+ dragStop: function(e, ui){
+ if(ui.helper && this.indicator) {
+ ui.helper.hide();
+ }
+
+ if(ui.helper[0] != this.dragElement[0]) {
+ //ugly fix to prevent remove custom indicator from DOM tree. see jQuery draggable._clear method for details
+ ui.helper[0] = this.dragElement[0];
+ }
+ }
+ }
+ })());
+})(jQuery, window.RichFaces);
Added: sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js (rev 0)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js 2010-11-24 18:48:24 UTC (rev 20161)
@@ -0,0 +1,69 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Droppable = function(id, options) {
+ this.options = options;
+ this.dropElement = $(document.getElementById(id));
+
+ this.dropElement.droppable({addClasses: false});
+ this.dropElement.droppable("option", "hoverClass", 'rf-drop-hover');
+ this.dropElement.droppable("option", "activeClass", 'rf-drop-highlight');
+ this.dropElement.data("init", true);
+ this.dropElement.bind('drop', $.proxy(this.drop, this));
+ this.dropElement.bind('dropover', $.proxy(this.dropover, this));
+ this.dropElement.bind('dropout', $.proxy(this.dropout, this));
+ };
+
+ $.extend(rf.ui.Droppable.prototype, ( function () {
+ return {
+ drop: function(e, ui) {
+ var dragElement = ui.draggable;
+ var helper = ui.helper;
+ var indicator = rf.$(helper.attr("id"));
+ if(indicator) {
+ helper.removeClass(indicator.acceptClass());
+ helper.removeClass(indicator.rejectClass());
+ }
+ },
+
+ dropover: function(event, ui) {
+ var draggable = ui.draggable;
+ var helper = ui.helper;
+ var indicator = rf.$(helper.attr("id"));
+ if(indicator) {
+ if(this.accept(draggable)) {
+ helper.removeClass(indicator.rejectClass());
+ helper.addClass(indicator.acceptClass());
+ } else {
+ helper.removeClass(indicator.acceptClass());
+ helper.addClass(indicator.rejectClass());
+ }
+ }
+ },
+
+ dropout: function(event, ui) {
+ var draggable = ui.draggable;
+ var helper = ui.helper;
+ var indicator = rf.$(helper.attr("id"));
+ if(indicator) {
+ helper.removeClass(indicator.acceptClass());
+ helper.removeClass(indicator.rejectClass());
+ }
+ },
+
+ accept: function(draggable) {
+ var accept;
+ var acceptType = draggable.data("type");
+ if(acceptType) {
+ $.each(this.options.acceptType, function() {
+ accept = (acceptType == this); return !(accept);
+ });
+ }
+
+ return accept;
+ }
+ }
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Added: sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-indicator.js
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-indicator.js (rev 0)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-indicator.js 2010-11-24 18:48:24 UTC (rev 20161)
@@ -0,0 +1,48 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.DragIndicator = function(id, options) {
+ $super.constructor.call(this, id);
+ this.attachToDom(id);
+
+ this.indicator = $(document.getElementById(id));
+ this.options = options;
+ };
+
+ var defaultOptions = {
+ };
+
+ rf.BaseComponent.extend(rf.ui.DragIndicator);
+ var $super = rf.ui.DragIndicator.$super;
+
+ $.extend(rf.ui.DragIndicator.prototype, ( function () {
+ return {
+ show : function() {
+ this.indicator.show();
+ },
+
+ hide: function() {
+ this.indicator.hide();
+ },
+
+ acceptClass: function() {
+ return this.options.acceptClass;
+ },
+
+ rejectClass: function() {
+ return this.options.rejectClass;
+ },
+
+ draggingClass: function() {
+ return this.options.draggingClass;
+ },
+
+ getElement: function() {
+ return this.indicator;
+ }
+ }
+ })());
+
+})(jQuery, window.RichFaces);
+
Added: sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-manager.js
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-manager.js (rev 0)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-manager.js 2010-11-24 18:48:24 UTC (rev 20161)
@@ -0,0 +1,27 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.DnDManager = rf.ui.DnDManager || {};
+
+ $.extend(rf.ui.DnDManager, ( function () {
+ var draggables = {};
+ var droppables = {};
+
+ return {
+ draggable: function(id, options) {
+ var draggable = draggables[id];
+ if(!draggable) {
+ draggables[id] = new rf.ui.Draggable(id, options);
+ }
+ },
+
+ droppable: function(id, options) {
+ var droppable = droppables[id];
+ if(!droppable) {
+ droppables[id] = new rf.ui.Droppable(id, options);
+ }
+ }
+ }
+ })());
+})(jQuery, window.RichFaces);
\ No newline at end of file
Added: sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/indicator.ecss
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/indicator.ecss (rev 0)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/indicator.ecss 2010-11-24 18:48:24 UTC (rev 20161)
@@ -0,0 +1,30 @@
+.rf-ind{
+ height:50px;
+ width:50px;
+ border:1px dotted red;
+ background-color:blue
+}
+
+.rf-ind-acpt{
+ height:50px;
+ width:50px;
+ border:1px dotted red;
+ background-color:green;
+}
+
+.rf-ind-rejt{
+ height:50px;
+ width:50px;
+ border:1px dotted green;
+ background-color:red;
+}
+
+.rf-drp-hvr{
+}
+
+.rf-drp-hvr{
+}
+
+.rf-drp-hlight{
+}
+
Deleted: sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-dnd.js
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-dnd.js 2010-11-24 18:45:07 UTC (rev 20160)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-dnd.js 2010-11-24 18:48:24 UTC (rev 20161)
@@ -1,140 +0,0 @@
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.indicator = function(id, options) {
- this.indicator = $(document.getElementById(id));
- };
-
- var defaultOptions = {
- };
-
- $.extend(rf.ui.indicator.prototype, ( function () {
- return {
- show : function() {
- this.indicator.show();
- },
-
- hide: function() {
- this.indicator.hide();
- },
-
- getDomElement: function() {
- return this.indicator[0];
- }
- }
- })());
-
-})(jQuery, window.RichFaces);
-
-
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.draggable = function(id, options) {
- this.dragElement = $(document.getElementById(id));
- this.indicator = new rf.ui.indicator(options.indicator, {});
-
- this.options = options;
-
- this.dragElement.draggable({addClasses: false});
- this.dragElement.draggable("option", "helper", $.proxy(this.indicator.getDomElement, this.indicator));
- this.dragElement.data('acceptType', this.options.acceptType);
- this.dragElement.data('indicator', $(document.getElementById(options.indicator)));
-
- this.dragElement.bind('dragstart', $.proxy(this.dragStart, this));
- this.dragElement.bind('drag', $.proxy(this.drag, this));
- this.dragElement.bind('dragstop', $.proxy(this.dragStop, this));
- };
-
-
- var defaultOptions = {
- };
-
- $.extend(rf.ui.draggable.prototype, ( function () {
- return {
-
- dragStart: function(e, ui) {
- ui.helper.show();
- },
-
- drag: function(e, ui) {
- ui.helper.removeClass("ui-draggable-dragging")
- ui.helper.addClass("rf-ind-dragging");
- },
-
- dragStop: function(e, ui){
- ui.helper.hide();
- }
- }
- })());
-
-})(jQuery, window.RichFaces);
-
-
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.droppable = function(id, options) {
- this.options = options;
- this.dropElement = $(document.getElementById(id));
- this.dropElement.droppable({addClasses: false});
- this.dropElement.droppable("option", "hoverClass", 'rf-drop-hover');
- this.dropElement.droppable("option", "activeClass", 'rf-drop-highlight' );
-
- this.dropElement.bind('drop', $.proxy(this.drop, this));
- this.dropElement.bind('dropover', $.proxy(this.dropover, this));
- this.dropElement.bind('dropout', $.proxy(this.dropout, this));
- };
-
- $.extend(rf.ui.droppable.prototype, ( function () {
- return {
- drop: function(e, ui) {
- var draggable = ui.draggable;
- var indicator = draggable.data("indicator");
- indicator.removeClass("rf-accept");
- indicator.removeClass("rf-reject");
- if(this.accept(draggable)) {
- draggable.detach();
- draggable.appendTo(this.dropElement);
- }
- },
-
- dropover: function(event, ui) {
- var draggable = ui.draggable;
- var indicator = draggable.data("indicator");
- if(this.accept(draggable)) {
- indicator.removeClass("rf-reject");
- indicator.addClass("rf-accept");
- } else {
- indicator.removeClass("rf-accept");
- indicator.addClass("rf-reject");
- }
- },
-
- dropout: function(event, ui) {
- var draggable = ui.draggable;
- var indicator = draggable.data("indicator");
- indicator.removeClass("rf-accept");
- indicator.removeClass("rf-reject");
- },
-
- accept: function(draggable) {
- var accept;
- var acceptType = draggable.data("acceptType");
-
- $.each(this.options.acceptTypes, function() {
- accept = (acceptType == this);
- return !(accept);
- });
-
- return accept;
- }
- }
- })());
-
-})(jQuery, window.RichFaces);
\ No newline at end of file
Added: sandbox/trunk/ui/drag-drop/ui/src/main/templates/dragIndicator.template.xml
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/templates/dragIndicator.template.xml (rev 0)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/templates/dragIndicator.template.xml 2010-11-24 18:48:24 UTC (rev 20161)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+ xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core" xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.DragIndicatorRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.DragIndicatorRendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.DragIndicator</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.DragIndicatorRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <div id="#{clientId}" class="rf-ind #{component.attributes['styleClass']}" style="display: none;">
+ <cdk:scriptObject name="options">
+ <cdk:scriptOption name="acceptClass" value="#{concatClasses('rf-ind-acpt', component.attributes['acceptClass'])}"/>
+ <cdk:scriptOption name="rejectClass" value="#{concatClasses('rf-ind-rejt', component.attributes['rejectClass'])}"/>
+ <cdk:scriptOption name="draggingClass" value="#{concatClasses('rf-ind-drag', component.attributes['draggingClass'])}"/>
+ </cdk:scriptObject>
+ <script type="text/javascript">
+ new RichFaces.ui.DragIndicator("#{clientId}", #{toScriptArgs(options)});
+ </script>
+ </div>
+ </cc:implementation>
+</cdk:root>
\ No newline at end of file
14 years, 1 month
JBoss Rich Faces SVN: r20160 - trunk/core/api/src/main/java/org/richfaces/renderkit/util.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-11-24 13:45:07 -0500 (Wed, 24 Nov 2010)
New Revision: 20160
Modified:
trunk/core/api/src/main/java/org/richfaces/renderkit/util/CoreAjaxRendererUtils.java
Log:
add asSimpleSet method
Modified: trunk/core/api/src/main/java/org/richfaces/renderkit/util/CoreAjaxRendererUtils.java
===================================================================
--- trunk/core/api/src/main/java/org/richfaces/renderkit/util/CoreAjaxRendererUtils.java 2010-11-24 18:44:08 UTC (rev 20159)
+++ trunk/core/api/src/main/java/org/richfaces/renderkit/util/CoreAjaxRendererUtils.java 2010-11-24 18:45:07 UTC (rev 20160)
@@ -210,6 +210,10 @@
return asIdsSet(areas);
}
+
+ public static Set<String> asSimpleSet(Object valueToSet) {
+ return asSet(valueToSet, false);
+ }
public static Set<String> asIdsSet(Object valueToSet) {
return asSet(valueToSet, true);
14 years, 1 month
JBoss Rich Faces SVN: r20159 - trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-11-24 13:44:08 -0500 (Wed, 24 Nov 2010)
New Revision: 20159
Modified:
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
Log:
fix bug what setLiteralValue didn't invokes for the our ClienBehaviors
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-11-24 13:31:12 UTC (rev 20158)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-11-24 18:44:08 UTC (rev 20159)
@@ -80,23 +80,14 @@
@Override
public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
if (meta.isTargetInstanceOf(ClientBehavior.class)) {
-
if (!attribute.isLiteral()) {
Class<?> type = meta.getPropertyType(name);
if (type == null) {
type = Object.class;
}
-
return new ValueExpressionMetadata(name, type, attribute);
- } else if (meta != null && meta.getWriteMethod(name) == null) {
-
- if (log.isDebugEnabled()) {
- log
- .debug(attribute + " Property '" + name + "' is not on type: "
- + meta.getTargetClass().getName());
- }
-
+ } else {
return new LiteralAttributeMetadata(name, attribute.getValue());
}
}
14 years, 1 month
JBoss Rich Faces SVN: r20158 - in branches/RF-8742-1/ui/validator/ui/src: test/java/org/richfaces/convert and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-11-24 08:31:12 -0500 (Wed, 24 Nov 2010)
New Revision: 20158
Added:
branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/double-range-validator.js
branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/long-range-validator.js
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/DoubleRangeValidatorTest.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/LongRangeValidatorTest.java
Modified:
branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/BaseTest.java
Log:
http://jira.jboss.com/jira/browse/RF-9329
DoubleRangeValidator, LongRangeValidator and tests was added
Added: branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/double-range-validator.js
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/double-range-validator.js (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/double-range-validator.js 2010-11-24 13:31:12 UTC (rev 20158)
@@ -0,0 +1,31 @@
+RichFaces.csv.addValidator({"double-range":
+ (function(rf) {
+ return function (componentId, value, params) {
+
+ if (typeof value == "string") {
+ value = $.trim(value);
+ }
+ if (!rf.csv.RE_FLOAT.test(value) || (value = parseFloat(value))==NaN) {
+ throw rf.csv.getMessage(params.customMessage, 'DOUBLE_RANGE_VALIDATOR_TYPE', [componentId, ""]);
+ }
+
+ var isMinSet = typeof params.minimum == "number";
+ var isMaxSet = typeof params.maximum == "number";
+
+ if (isMaxSet && value > params.maximum) {
+ if (isMinSet) {
+ throw rf.csv.getMessage(params.customMessage, 'DOUBLE_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
+ } else {
+ throw rf.csv.getMessage(params.customMessage, 'DOUBLE_RANGE_VALIDATOR_MAXIMUM', [params.maximum, componentId]);
+ }
+ }
+ if (isMinSet && value < params.minimum) {
+ if (isMaxSet) {
+ throw rf.csv.getMessage(params.customMessage, 'DOUBLE_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
+ } else {
+ throw rf.csv.getMessage(params.customMessage, 'DOUBLE_RANGE_VALIDATOR_MINIMUM', [params.minimum, componentId]);
+ }
+ }
+ }
+ })(window.RichFaces || (window.RichFaces={}))
+});
\ No newline at end of file
Added: branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/long-range-validator.js
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/long-range-validator.js (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/long-range-validator.js 2010-11-24 13:31:12 UTC (rev 20158)
@@ -0,0 +1,31 @@
+RichFaces.csv.addValidator({"long-range":
+ (function(rf) {
+ return function (componentId, value, params) {
+
+ if (typeof value == "string") {
+ value = $.trim(value);
+ }
+ if (!rf.csv.RE_DIGITS.test(value)) {
+ throw rf.csv.getMessage(params.customMessage, 'LONG_RANGE_VALIDATOR_TYPE', [componentId, ""]);
+ }
+
+ var isMinSet = typeof params.minimum == "number";
+ var isMaxSet = typeof params.maximum == "number";
+
+ if (isMaxSet && value > params.maximum) {
+ if (isMinSet) {
+ throw rf.csv.getMessage(params.customMessage, 'LONG_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
+ } else {
+ throw rf.csv.getMessage(params.customMessage, 'LONG_RANGE_VALIDATOR_MAXIMUM', [params.maximum, componentId]);
+ }
+ }
+ if (isMinSet && value < params.minimum) {
+ if (isMaxSet) {
+ throw rf.csv.getMessage(params.customMessage, 'LONG_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
+ } else {
+ throw rf.csv.getMessage(params.customMessage, 'LONG_RANGE_VALIDATOR_MINIMUM', [params.minimum, componentId]);
+ }
+ }
+ }
+ })(window.RichFaces || (window.RichFaces={}))
+});
\ No newline at end of file
Modified: branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2010-11-24 13:27:13 UTC (rev 20157)
+++ branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2010-11-24 13:31:12 UTC (rev 20158)
@@ -10,6 +10,7 @@
$.extend(rf.csv, {
RE_DIGITS: /^-?\d+$/,
+ RE_FLOAT: /^(-?\d+)?(\.(\d+)?(e[+-]?\d+)?)?$/,
MESSAGE_EVENT_NAME: "onmessage."+rf.Event.RICH_NAMESPACE,
// Messages API
addMessage: function (messagesObject) {
Modified: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/BaseTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/BaseTest.java 2010-11-24 13:27:13 UTC (rev 20157)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/BaseTest.java 2010-11-24 13:31:12 UTC (rev 20158)
@@ -30,6 +30,7 @@
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.Map.Entry;
@@ -55,7 +56,6 @@
import org.jboss.test.faces.jetty.JettyServer;
import org.junit.After;
import org.junit.Before;
-import org.junit.runner.RunWith;
import org.richfaces.application.MessageFactory;
import org.richfaces.application.ServiceTracker;
@@ -262,6 +262,7 @@
@Before
public void setUp() throws Exception {
+ Locale.setDefault(Locale.US);
testBean = new TestBean();
environment = new HtmlUnitEnvironment(new JettyServer());
Added: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/DoubleRangeValidatorTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/DoubleRangeValidatorTest.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/DoubleRangeValidatorTest.java 2010-11-24 13:31:12 UTC (rev 20158)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.convert;
+
+import javax.faces.validator.DoubleRangeValidator;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.appplication.FacesMessages;
+
+/**
+ * @author Pavel Yaschenko
+ *
+ */
+(a)RunWith(ValidatorTestRunner.class)
+public class DoubleRangeValidatorTest extends BaseTest {
+
+ private Enum<?>[] messages = { FacesMessages.DOUBLE_RANGE_VALIDATOR_MAXIMUM, FacesMessages.DOUBLE_RANGE_VALIDATOR_MINIMUM, FacesMessages.DOUBLE_RANGE_VALIDATOR_NOT_IN_RANGE, FacesMessages.DOUBLE_RANGE_VALIDATOR_TYPE };
+
+ private void setup() {
+ setClientFunction("RichFaces.csv.getValidator('double-range')");
+ setObjectId(DoubleRangeValidator.VALIDATOR_ID);
+ setErrorMessageEnums(messages);
+ }
+
+ public DoubleRangeValidatorTest() {
+ super("META-INF/resources/org.richfaces/double-range-validator.js");
+ }
+
+ @Test
+ @TestDataHolder(
+ successes = {
+ @TestData(submittedValue = "1.e10"),
+ @TestData(submittedValue = "1.e-10"),
+ @TestData(submittedValue = ".e10"),
+ @TestData(submittedValue = "0.1e10"),
+ @TestData(submittedValue = "0.1e-10"),
+ @TestData(submittedValue = "-0.1e-10")
+ },
+ failures = {
+ }
+ )
+
+ public void conversionTest() throws Exception {
+ setup();
+ }
+
+ @Test
+ @TestDataHolder(
+ successes = {
+ @TestData(submittedValue = "0.9"),
+ @TestData(submittedValue = "1.1"),
+ @TestData(submittedValue = "1.2"),
+ },
+ failures = {
+ @TestData(submittedValue = "1.3"),
+ @TestData(submittedValue = "0.8"),
+ @TestData(submittedValue = "aaa")
+ }
+ )
+
+ public void minMaxTest() throws Exception {
+ setup();
+ setAttribute("maximum", 1.2);
+ setAttribute("minimum", 0.9);
+ }
+
+ @Test
+ @TestDataHolder(
+ successes = {
+ @TestData(submittedValue = "1.2"),
+ @TestData(submittedValue = "1.3")
+ },
+ failures = {
+ @TestData(submittedValue = "1.1")
+ }
+ )
+
+ public void minTest() throws Exception {
+ setup();
+ setAttribute("minimum", 1.2);
+ }
+
+ @Test
+ @TestDataHolder(
+ successes = {
+ @TestData(submittedValue = "1.1"),
+ @TestData(submittedValue = "0.9")
+ },
+ failures = {
+ @TestData(submittedValue = "1.2")
+ }
+ )
+
+ public void maxTest() throws Exception {
+ setup();
+ setAttribute("maximum", 1.1);
+ }
+}
Added: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/LongRangeValidatorTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/LongRangeValidatorTest.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/LongRangeValidatorTest.java 2010-11-24 13:31:12 UTC (rev 20158)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.convert;
+
+import javax.faces.validator.LongRangeValidator;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.appplication.FacesMessages;
+
+/**
+ * @author Pavel Yaschenko
+ *
+ */
+(a)RunWith(ValidatorTestRunner.class)
+public class LongRangeValidatorTest extends BaseTest {
+
+ private Enum<?>[] messages = { FacesMessages.LONG_RANGE_VALIDATOR_MAXIMUM, FacesMessages.LONG_RANGE_VALIDATOR_MINIMUM, FacesMessages.LONG_RANGE_VALIDATOR_NOT_IN_RANGE, FacesMessages.LONG_RANGE_VALIDATOR_TYPE };
+
+ private void setup() {
+ setClientFunction("RichFaces.csv.getValidator('long-range')");
+ setObjectId(LongRangeValidator.VALIDATOR_ID);
+ setErrorMessageEnums(messages);
+ }
+
+ public LongRangeValidatorTest() {
+ super("META-INF/resources/org.richfaces/long-range-validator.js");
+ }
+
+ @Test
+ @TestDataHolder(
+ successes = {
+ @TestData(submittedValue = "5"),
+ @TestData(submittedValue = "7"),
+ @TestData(submittedValue = "10"),
+ },
+ failures = {
+ @TestData(submittedValue = "4"),
+ @TestData(submittedValue = "11"),
+ @TestData(submittedValue = "aaa")
+ }
+ )
+
+ public void minMaxTest() throws Exception {
+ setup();
+ setAttribute("maximum", 10);
+ setAttribute("minimum", 5);
+ }
+
+ @Test
+ @TestDataHolder(
+ successes = {
+ @TestData(submittedValue = "10"),
+ @TestData(submittedValue = "11")
+ },
+ failures = {
+ @TestData(submittedValue = "9")
+ }
+ )
+
+ public void minTest() throws Exception {
+ setup();
+ setAttribute("minimum", 10);
+ }
+
+ @Test
+ @TestDataHolder(
+ successes = {
+ @TestData(submittedValue = "10"),
+ @TestData(submittedValue = "9")
+ },
+ failures = {
+ @TestData(submittedValue = "11")
+ }
+ )
+
+ public void maxTest() throws Exception {
+ setup();
+ setAttribute("maximum", 10);
+ }
+}
14 years, 1 month
JBoss Rich Faces SVN: r20157 - trunk/examples/validator-demo/src/main/java/org/richfaces/example.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-11-24 08:27:13 -0500 (Wed, 24 Nov 2010)
New Revision: 20157
Modified:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java
Log:
commit test
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java 2010-11-24 10:53:46 UTC (rev 20156)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java 2010-11-24 13:27:13 UTC (rev 20157)
@@ -24,8 +24,6 @@
import javax.validation.constraints.Pattern;
-
-
/**
* JSF bean with text property validation.
*/
14 years, 1 month
JBoss Rich Faces SVN: r20156 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richInputNumberSlider and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-11-24 05:53:46 -0500 (Wed, 24 Nov 2010)
New Revision: 20156
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSlider/simple.xhtml
Log:
https://jira.jboss.org/browse/RFPL-759
* slider sample improved
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java 2010-11-24 01:34:46 UTC (rev 20155)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java 2010-11-24 10:53:46 UTC (rev 20156)
@@ -58,13 +58,13 @@
attributes.setAttribute("enableManualInput", true);
attributes.setAttribute("inputSize", 3);
- attributes.setAttribute("maxValue", 100);
- attributes.setAttribute("minValue", 0);
+ attributes.setAttribute("maxValue", 10);
+ attributes.setAttribute("minValue", -10);
attributes.setAttribute("rendered", true);
attributes.setAttribute("showBoundaryValues", true);
attributes.setAttribute("showInput", true);
attributes.setAttribute("step", 1);
- attributes.setAttribute("value", 0);
+ attributes.setAttribute("value", 2);
attributes.remove("converter");
attributes.remove("validator");
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSlider/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSlider/simple.xhtml 2010-11-24 01:34:46 UTC (rev 20155)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSlider/simple.xhtml 2010-11-24 10:53:46 UTC (rev 20156)
@@ -56,11 +56,10 @@
inputClass="#{richInputNumberSliderBean.attributes['inputClass'].value}"
inputPosition="#{richInputNumberSliderBean.attributes['inputPosition'].value}"
inputSize="#{richInputNumberSliderBean.attributes['inputSize'].value}"
- localValue="#{richInputNumberSliderBean.attributes['localValue'].value}"
- localValueSet="#{richInputNumberSliderBean.attributes['localValueSet'].value}"
maxValue="#{richInputNumberSliderBean.attributes['maxValue'].value}"
maxlength="#{richInputNumberSliderBean.attributes['maxlength'].value}"
minValue="#{richInputNumberSliderBean.attributes['minValue'].value}"
+ onchange="#{richInputNumberSliderBean.attributes['onchange'].value}"
rendered="#{richInputNumberSliderBean.attributes['rendered'].value}"
required="#{richInputNumberSliderBean.attributes['required'].value}"
requiredMessage="#{richInputNumberSliderBean.attributes['requiredMessage'].value}"
@@ -71,13 +70,10 @@
step="#{richInputNumberSliderBean.attributes['step'].value}"
style="#{richInputNumberSliderBean.attributes['style'].value}"
styleClass="#{richInputNumberSliderBean.attributes['styleClass'].value}"
- submittedValue="#{richInputNumberSliderBean.attributes['submittedValue'].value}"
tabindex="#{richInputNumberSliderBean.attributes['tabindex'].value}"
toolTipClass="#{richInputNumberSliderBean.attributes['toolTipClass'].value}"
trackClass="#{richInputNumberSliderBean.attributes['trackClass'].value}"
- valid="#{richInputNumberSliderBean.attributes['valid'].value}"
validatorMessage="#{richInputNumberSliderBean.attributes['validatorMessage'].value}"
- validators="#{richInputNumberSliderBean.attributes['validators'].value}"
value="#{richInputNumberSliderBean.attributes['value'].value}"
>
14 years, 1 month