JBoss Rich Faces SVN: r17806 - in root: ui/misc/trunk/jquery/src/main/java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-10 08:10:46 -0400 (Sat, 10 Jul 2010)
New Revision: 17806
Added:
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryTiming.java
Removed:
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachTiming.java
Modified:
root/examples/misc-demo/trunk/src/main/webapp/pages/jquery.xhtml
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js
Log:
https://jira.jboss.org/browse/RF-8882
Modified: root/examples/misc-demo/trunk/src/main/webapp/pages/jquery.xhtml
===================================================================
--- root/examples/misc-demo/trunk/src/main/webapp/pages/jquery.xhtml 2010-07-10 11:50:57 UTC (rev 17805)
+++ root/examples/misc-demo/trunk/src/main/webapp/pages/jquery.xhtml 2010-07-10 12:10:46 UTC (rev 17806)
@@ -15,8 +15,8 @@
Click here
</h:panelGroup>
- <misc:jQuery selector="#clickTest" event="click" query="alert('immediate attachment')" attachTiming="immediate" />
- <misc:jQuery selector="#clickTestForReady" event="click" query="alert('onready attachment')" attachTiming="onready" />
+ <misc:jQuery selector="#clickTest" event="click" query="alert('immediate attachment')" timing="immediate" />
+ <misc:jQuery selector="#clickTestForReady" event="click" query="alert('onready attachment')" timing="domready" />
<misc:jQuery selector="document.body" query="css({'background-color': '#AAA'})" />
Modified: root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java
===================================================================
--- root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java 2010-07-10 11:50:57 UTC (rev 17805)
+++ root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java 2010-07-10 12:10:46 UTC (rev 17806)
@@ -54,8 +54,8 @@
@Attribute(defaultValue = "JQueryAttachType.DEFAULT")
public abstract JQueryAttachType getAttachType();
- @Attribute(defaultValue = "JQueryAttachTiming.DEFAULT")
- public abstract JQueryAttachTiming getAttachTiming();
+ @Attribute(defaultValue = "JQueryTiming.DEFAULT")
+ public abstract JQueryTiming getTiming();
}
Deleted: root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachTiming.java
===================================================================
--- root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachTiming.java 2010-07-10 11:50:57 UTC (rev 17805)
+++ root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachTiming.java 2010-07-10 12:10:46 UTC (rev 17806)
@@ -1,35 +0,0 @@
-/*
- * 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.component;
-
-/**
- * @author nick
- *
- */
-public enum JQueryAttachTiming {
-
- immediate, onready;
-
- public static final JQueryAttachTiming DEFAULT = immediate;
-
-}
Copied: root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryTiming.java (from rev 17805, root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachTiming.java)
===================================================================
--- root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryTiming.java (rev 0)
+++ root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryTiming.java 2010-07-10 12:10:46 UTC (rev 17806)
@@ -0,0 +1,35 @@
+/*
+ * 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.component;
+
+/**
+ * @author nick
+ *
+ */
+public enum JQueryTiming {
+
+ immediate, domready;
+
+ public static final JQueryTiming DEFAULT = domready;
+
+}
Modified: root/ui/misc/trunk/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
===================================================================
--- root/ui/misc/trunk/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2010-07-10 11:50:57 UTC (rev 17805)
+++ root/ui/misc/trunk/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2010-07-10 12:10:46 UTC (rev 17806)
@@ -34,7 +34,7 @@
import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.AbstractJQuery;
-import org.richfaces.component.JQueryAttachTiming;
+import org.richfaces.component.JQueryTiming;
import org.richfaces.component.JQueryAttachType;
import org.richfaces.component.util.HtmlUtil;
@@ -69,7 +69,7 @@
rendererUtils.addToScriptHash(map, "event", jQuery.getEvent());
rendererUtils.addToScriptHash(map, "query", jQuery.getQuery());
rendererUtils.addToScriptHash(map, "attachType", jQuery.getAttachType(), JQueryAttachType.DEFAULT.toString());
- rendererUtils.addToScriptHash(map, "attachTiming", jQuery.getAttachTiming(), JQueryAttachTiming.DEFAULT.toString());
+ rendererUtils.addToScriptHash(map, "timing", jQuery.getTiming(), JQueryTiming.DEFAULT.toString());
return ScriptUtils.toScript(map);
}
Modified: root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js
===================================================================
--- root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js 2010-07-10 11:50:57 UTC (rev 17805)
+++ root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js 2010-07-10 12:10:46 UTC (rev 17806)
@@ -45,7 +45,7 @@
};
var bind = function(options) {
- if (options.attachTimimg == 'immediate') {
+ if (options.timing == 'immediate') {
bindFunction(options);
} else {
jQuery(document).ready(function() {
14 years, 6 months
JBoss Rich Faces SVN: r17805 - in root: examples/misc-demo/trunk/src/main/java/org/richfaces/demo and 17 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-10 07:50:57 -0400 (Sat, 10 Jul 2010)
New Revision: 17805
Added:
root/examples/misc-demo/trunk/src/main/java/org/richfaces/demo/JQueryBean.java
root/examples/misc-demo/trunk/src/main/webapp/pages/jquery.xhtml
root/ui/misc/trunk/jquery/
root/ui/misc/trunk/jquery/pom.xml
root/ui/misc/trunk/jquery/src/
root/ui/misc/trunk/jquery/src/main/
root/ui/misc/trunk/jquery/src/main/java/
root/ui/misc/trunk/jquery/src/main/java/org/
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachTiming.java
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachType.java
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/package-info.java
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/renderkit/
root/ui/misc/trunk/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
root/ui/misc/trunk/jquery/src/main/resources/
root/ui/misc/trunk/jquery/src/main/resources/META-INF/
root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/
root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/org.richfaces/
root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js
root/ui/misc/trunk/jquery/src/main/templates/
root/ui/misc/trunk/jquery/src/main/templates/jquery.template.xml
Modified:
root/examples/misc-demo/trunk/pom.xml
root/ui/misc/trunk/bom/pom.xml
root/ui/misc/trunk/dist/richfaces-ui-misc-ui/pom.xml
root/ui/misc/trunk/pom.xml
Log:
https://jira.jboss.org/browse/RF-8882
Modified: root/examples/misc-demo/trunk/pom.xml
===================================================================
--- root/examples/misc-demo/trunk/pom.xml 2010-07-10 11:46:53 UTC (rev 17804)
+++ root/examples/misc-demo/trunk/pom.xml 2010-07-10 11:50:57 UTC (rev 17805)
@@ -74,6 +74,15 @@
<groupId>org.richfaces.ui.misc</groupId>
<artifactId>richfaces-ui-misc-ui</artifactId>
</dependency>
+ <!-- todo remove this dependency -->
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
<dependency>
<groupId>${jsf2.api.groupid}</groupId>
@@ -194,5 +203,5 @@
<enabled>true</enabled>
</snapshots>
</repository>
- </repositories>
+ </repositories>
</project>
Added: root/examples/misc-demo/trunk/src/main/java/org/richfaces/demo/JQueryBean.java
===================================================================
--- root/examples/misc-demo/trunk/src/main/java/org/richfaces/demo/JQueryBean.java (rev 0)
+++ root/examples/misc-demo/trunk/src/main/java/org/richfaces/demo/JQueryBean.java 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,55 @@
+/*
+ * 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.demo;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+/**
+ * @author nick
+ *
+ */
+@ManagedBean
+@SessionScoped
+public class JQueryBean {
+
+ private List<String> componentsDataList;
+
+ public JQueryBean() {
+ componentsDataList = new ArrayList<String>();
+ addComponent();
+ }
+
+ public List<String> getComponentsDataList() {
+ return componentsDataList;
+ }
+
+ public void addComponent() {
+ componentsDataList.add(UUID.randomUUID().toString());
+ }
+
+}
Added: root/examples/misc-demo/trunk/src/main/webapp/pages/jquery.xhtml
===================================================================
--- root/examples/misc-demo/trunk/src/main/webapp/pages/jquery.xhtml (rev 0)
+++ root/examples/misc-demo/trunk/src/main/webapp/pages/jquery.xhtml 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,50 @@
+<!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:misc="http://richfaces.org/misc">
+<f:view>
+ <h:head></h:head>
+ <h:body>
+ <h:panelGroup id="clickTest">
+ Click here
+ </h:panelGroup>
+ <h:outputText value=" | " />
+ <h:panelGroup id="clickTestForReady">
+ Click here
+ </h:panelGroup>
+
+ <misc:jQuery selector="#clickTest" event="click" query="alert('immediate attachment')" attachTiming="immediate" />
+ <misc:jQuery selector="#clickTestForReady" event="click" query="alert('onready attachment')" attachTiming="onready" />
+
+ <misc:jQuery selector="document.body" query="css({'background-color': '#AAA'})" />
+
+ <br />
+
+ <h:panelGroup id="clickTestOne">
+ Click here - event is attached for one click only
+ </h:panelGroup>
+ <a href="#" onclick="rebindOneClickEvent(); return false;">Re-enable one-typed click handler</a>
+
+ <misc:jQuery event="click" selector="#clickTestOne" query="alert('one attachType')" attachType="one" />
+ <misc:jQuery event="click" name="rebindOneClickEvent" selector="#clickTestOne" query="alert('one attachType rebound event')" attachType="one" />
+
+ <h:panelGroup id="liveTestGroup">
+ <ui:repeat value="#{jQueryBean.componentsDataList}" var="data">
+ <h:panelGroup styleClass="liveTestComponent" layout="block" id="liveTestComponent">
+ Click me #{data}
+ </h:panelGroup>
+ </ui:repeat>
+ </h:panelGroup>
+
+ <h:form>
+ <misc:jQuery selector="#liveTestGroup .liveTestComponent" attachType="live" event="click" query="alert(jQuery(this).text())" />
+ <h:commandButton value="Add component for live test" action="#{jQueryBean.addComponent}">
+ <f:ajax render=":liveTestGroup" />
+ </h:commandButton>
+ </h:form>
+
+ </h:body>
+</f:view>
+</html>
Modified: root/ui/misc/trunk/bom/pom.xml
===================================================================
--- root/ui/misc/trunk/bom/pom.xml 2010-07-10 11:46:53 UTC (rev 17804)
+++ root/ui/misc/trunk/bom/pom.xml 2010-07-10 11:50:57 UTC (rev 17805)
@@ -36,6 +36,7 @@
<properties>
<org.richfaces.core.version>4.0.0-SNAPSHOT</org.richfaces.core.version>
+ <org.richfaces.ui.core.version>4.0.0-SNAPSHOT</org.richfaces.ui.core.version>
</properties>
<dependencyManagement>
@@ -49,6 +50,14 @@
</dependency>
<dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-bom</artifactId>
+ <version>${org.richfaces.ui.core.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
<groupId>org.richfaces.ui.misc</groupId>
<artifactId>richfaces-ui-misc-ui</artifactId>
<version>${project.version}</version>
@@ -63,6 +72,11 @@
<artifactId>functions-ui</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>jquery-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: root/ui/misc/trunk/dist/richfaces-ui-misc-ui/pom.xml
===================================================================
--- root/ui/misc/trunk/dist/richfaces-ui-misc-ui/pom.xml 2010-07-10 11:46:53 UTC (rev 17804)
+++ root/ui/misc/trunk/dist/richfaces-ui-misc-ui/pom.xml 2010-07-10 11:50:57 UTC (rev 17805)
@@ -50,6 +50,10 @@
<groupId>org.richfaces.ui.misc</groupId>
<artifactId>functions-ui</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>jquery-ui</artifactId>
+ </dependency>
<!-- artifacts for javadoc generation -->
<dependency>
Added: root/ui/misc/trunk/jquery/pom.xml
===================================================================
--- root/ui/misc/trunk/jquery/pom.xml (rev 0)
+++ root/ui/misc/trunk/jquery/pom.xml 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,127 @@
+<!--
+ 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>jquery-ui</artifactId>
+ <name>Richfaces UI Components: jQuery Component UI</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- runtime -->
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <!-- todo remove this dependency or move to test scope -->
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JSF with dependencies -->
+ <dependency>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
+ <scope>provided</scope>
+ </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>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- tests -->
+ <dependency>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <!-- todo api? -->
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>htmlunit-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-mock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/ui/misc/trunk/jquery</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui/misc/trunk/jquery</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
+ </scm>
+</project>
\ No newline at end of file
Added: root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java
===================================================================
--- root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java (rev 0)
+++ root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,61 @@
+/*
+ * 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.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+
+/**
+ * @author nick
+ *
+ */
+@JsfComponent(type = AbstractJQuery.COMPONENT_TYPE, family = AbstractJQuery.COMPONENT_FAMILY)
+public abstract class AbstractJQuery extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.JQuery";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.JQuery";
+
+ //TODO nick - CDK should be doing this
+ public AbstractJQuery() {
+ setRendererType("org.richfaces.JQueryRenderer");
+ }
+
+ public abstract String getName();
+
+ public abstract String getSelector();
+
+ public abstract String getEvent();
+
+ public abstract String getQuery();
+
+ @Attribute(defaultValue = "JQueryAttachType.DEFAULT")
+ public abstract JQueryAttachType getAttachType();
+
+ @Attribute(defaultValue = "JQueryAttachTiming.DEFAULT")
+ public abstract JQueryAttachTiming getAttachTiming();
+
+}
+
Added: root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachTiming.java
===================================================================
--- root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachTiming.java (rev 0)
+++ root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachTiming.java 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,35 @@
+/*
+ * 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.component;
+
+/**
+ * @author nick
+ *
+ */
+public enum JQueryAttachTiming {
+
+ immediate, onready;
+
+ public static final JQueryAttachTiming DEFAULT = immediate;
+
+}
Added: root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachType.java
===================================================================
--- root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachType.java (rev 0)
+++ root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/JQueryAttachType.java 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,35 @@
+/*
+ * 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.component;
+
+/**
+ * @author nick
+ *
+ */
+public enum JQueryAttachType {
+
+ bind, live, one;
+
+ public static final JQueryAttachType DEFAULT = bind;
+
+}
Added: root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/package-info.java (rev 0)
+++ root/ui/misc/trunk/jquery/src/main/java/org/richfaces/component/package-info.java 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+/**
+ * Implementation of RichFaces jQuery component
+ */
+(a)org.richfaces.cdk.annotations.TagLibrary(uri="http://richfaces.org/jquery", shortName="jquery")
+package org.richfaces.component;
Added: root/ui/misc/trunk/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
===================================================================
--- root/ui/misc/trunk/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java (rev 0)
+++ root/ui/misc/trunk/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,76 @@
+/*
+ * 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.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.context.FacesContext;
+import javax.faces.render.Renderer;
+
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.renderkit.RendererUtils;
+import org.richfaces.component.AbstractJQuery;
+import org.richfaces.component.JQueryAttachTiming;
+import org.richfaces.component.JQueryAttachType;
+import org.richfaces.component.util.HtmlUtil;
+
+/**
+ * @author nick
+ *
+ */
+@ResourceDependencies({
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(library = "org.richfaces", name = "jquery.component.js")
+})
+public abstract class JQueryRendererBase extends Renderer {
+
+ private RendererUtils rendererUtils = RendererUtils.getInstance();
+
+ protected String getEscapedSelector(FacesContext context, UIComponent component) {
+ String selector = (String) component.getAttributes().get("selector");
+
+ if (selector != null) {
+ selector = HtmlUtil.expandIdSelector(selector, component, context);
+ }
+
+ return selector;
+ }
+
+ protected String getOptionsAsJavascriptString(FacesContext context, UIComponent component) {
+ AbstractJQuery jQuery = (AbstractJQuery) component;
+
+ Map<String,Object> map = new HashMap<String, Object>();
+
+ rendererUtils.addToScriptHash(map, "selector", getEscapedSelector(context, jQuery));
+ rendererUtils.addToScriptHash(map, "event", jQuery.getEvent());
+ rendererUtils.addToScriptHash(map, "query", jQuery.getQuery());
+ rendererUtils.addToScriptHash(map, "attachType", jQuery.getAttachType(), JQueryAttachType.DEFAULT.toString());
+ rendererUtils.addToScriptHash(map, "attachTiming", jQuery.getAttachTiming(), JQueryAttachTiming.DEFAULT.toString());
+
+ return ScriptUtils.toScript(map);
+ }
+}
Added: root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js
===================================================================
--- root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js (rev 0)
+++ root/ui/misc/trunk/jquery/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,68 @@
+if (!window.RichFaces) {
+ window.RichFaces = {};
+}
+
+(function(jquery, richfaces) {
+
+ var evaluateSelector = function(selector) {
+ var result = selector;
+ try {
+ result = eval(selector);
+ } catch (e) {
+ //do nothing
+ }
+ return result || "";
+ };
+
+ var createHandler = function(handler) {
+ if (typeof handler == 'function') {
+ return handler;
+ } else {
+ return new Function("event", handler);
+ }
+ };
+
+ var bindFunction = function(options) {
+
+ var selector = evaluateSelector(options.selector);
+ var query = options.query;
+
+ if (options.event) {
+ var handler = createHandler(query);
+
+ if (options.attachType == 'live') {
+ jQuery(selector).live(options.event, handler);
+ } else if (options.attachType == 'one') {
+ jQuery(selector).one(options.event, handler);
+ } else {
+ jQuery(selector).bind(options.event, handler);
+ }
+ } else {
+ var f = new Function("__locatedObject", "__locatedObject." + query);
+ f.call(this, jQuery(selector));
+ //TODO return value?
+ }
+ };
+
+ var bind = function(options) {
+ if (options.attachTimimg == 'immediate') {
+ bindFunction(options);
+ } else {
+ jQuery(document).ready(function() {
+ bindFunction(options);
+ });
+ }
+ };
+
+ richfaces.jQuery = {
+
+ bind: bind,
+
+ createBinder: function(options) {
+ return function() {
+ bind(options);
+ };
+ }
+ };
+
+}(jQuery, RichFaces));
Added: root/ui/misc/trunk/jquery/src/main/templates/jquery.template.xml
===================================================================
--- root/ui/misc/trunk/jquery/src/main/templates/jquery.template.xml (rev 0)
+++ root/ui/misc/trunk/jquery/src/main/templates/jquery.template.xml 2010-07-10 11:50:57 UTC (rev 17805)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://richfaces.org/cdk/xhtml-el" xmlns:cdk="http://richfaces.org/cdk/core"
+ xmlns:c="http://richfaces.org/cdk/jstl/core" xmlns:cc="http://richfaces.org/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.JQueryRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.JQueryRendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.JQuery</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.JQueryRenderer</cdk:renderer-type>
+ <cdk:renders-children>true</cdk:renders-children>
+ </cc:interface>
+
+ <cc:implementation>
+ <span id="#{clientId}" style="display: none;">
+ <script type="text/javascript">
+ <cdk:object name="functionName" value="#{component.attributes['name']}" />
+ <cdk:object name="options" value="#{getOptionsAsJavascriptString(facesContext, component)}" />
+
+ <c:choose>
+ <c:when test="#{not empty functionName}">
+ #{functionName} = RichFaces.jQuery.createBinder(#{options});
+ </c:when>
+ <c:otherwise>
+ RichFaces.jQuery.bind(#{options});
+ </c:otherwise>
+ </c:choose>
+ </script>
+ </span>
+ </cc:implementation>
+
+</cdk:root>
Modified: root/ui/misc/trunk/pom.xml
===================================================================
--- root/ui/misc/trunk/pom.xml 2010-07-10 11:46:53 UTC (rev 17804)
+++ root/ui/misc/trunk/pom.xml 2010-07-10 11:50:57 UTC (rev 17805)
@@ -39,6 +39,7 @@
<module>parent</module>
<module>functions</module>
<module>componentcontrol</module>
+ <module>jquery</module>
<!-- assembler -->
<module>dist</module>
14 years, 6 months
JBoss Rich Faces SVN: r17804 - in root/core/trunk/impl/src: main/resources/META-INF/resources and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-10 07:46:53 -0400 (Sat, 10 Jul 2010)
New Revision: 17804
Modified:
root/core/trunk/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
root/core/trunk/impl/src/test/java/org/richfaces/component/util/HtmlUtilTest.java
Log:
https://jira.jboss.org/browse/RF-8882
Modified: root/core/trunk/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java 2010-07-10 10:55:46 UTC (rev 17803)
+++ root/core/trunk/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java 2010-07-10 11:46:53 UTC (rev 17804)
@@ -21,6 +21,7 @@
package org.richfaces.component.util;
+import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.util.HtmlDimensions;
@@ -64,6 +65,10 @@
return HtmlDimensions.formatPx(new Double(decoded.doubleValue() + doubleDelta.doubleValue()));
}
+ private static String escapeReplacement(String s) {
+ return s.replaceAll("(\\\\|\\$)", "\\\\$1");
+ }
+
public static String expandIdSelector(String selector, UIComponent component, FacesContext context) {
Matcher matcher = ID_SELECTOR_PATTERN.matcher(selector);
StringBuffer sb = new StringBuffer();
@@ -75,7 +80,7 @@
UIComponent target = RendererUtils.getInstance().findComponentFor(context, component, unescaped);
if (target != null) {
- matcher.appendReplacement(sb, "#" + target.getClientId(context).replaceAll(":", "\\\\\\\\:"));
+ matcher.appendReplacement(sb, escapeReplacement("#" + ScriptUtils.escapeCSSMetachars(target.getClientId(context))));
}
}
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-07-10 10:55:46 UTC (rev 17803)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-07-10 11:46:53 UTC (rev 17804)
@@ -1,16 +1,18 @@
-/**
- * Global object container for RichFaces API.
- * All classes should be defined here.
- * @class
- * @name RichFaces
- * @static
- *
- * */
-window.RichFaces = {};
+if (!window.RichFaces) {
+ /**
+ * Global object container for RichFaces API.
+ * All classes should be defined here.
+ * @class
+ * @name RichFaces
+ * @static
+ *
+ * */
+ window.RichFaces = {};
+}
(function(jQuery, richfaces) {
-
+
// get DOM element by id or DOM element or jQuery object
richfaces.getDomElement = function (source) {
var type = typeof source;
@@ -22,7 +24,7 @@
if (source.nodeType) {
// DOM element
element = source;
- } else
+ } else
if (source instanceof jQuery) {
// jQuery object
element = source.get(0);
@@ -30,7 +32,7 @@
}
return element;
}
-
+
// get RichFaces component object by component id or DOM element or jQuery object
richfaces.$ = function (source) {
var element = richfaces.getDomElement(source);
@@ -39,7 +41,7 @@
return (element["richfaces"] || {})["component"];
}
}
-
+
// find component and call his method
richfaces.invokeMethod = function(source, method) {
var c = richfaces.$(source);
@@ -66,7 +68,7 @@
}
}
}
-
+
//form.js
richfaces.submitForm = function(form, parameters, target) {
if (typeof form === "string") { form = jQuery(form) };
@@ -124,23 +126,23 @@
return out;
};
- //there is the same pattern in server-side code:
+ //there is the same pattern in server-side code:
//org.ajax4jsf.javascript.ScriptUtils.escapeCSSMetachars(String)
var CSS_METACHARS_PATTERN = /([#;&,.+*~':"!^$[\]()=>|\/])/g;
/**
- * Escapes CSS meta-characters in string according to
+ * Escapes CSS meta-characters in string according to
* <a href="http://api.jquery.com/category/selectors/">jQuery selectors</a> document.
- *
+ *
* @param s - string to escape meta-characters in
* @return string with meta-characters escaped
*/
richfaces.escapeCSSMetachars = function(s) {
//TODO nick - cache results
-
+
return s.replace(CSS_METACHARS_PATTERN, "\\$1");
};
-
+
richfaces.log = (function(jQuery) {
var LOG_LEVELS = {'debug': 1, 'info': 2, 'warn': 3, 'error': 4};
var LOG_LEVEL_COLORS = {'debug': 'darkblue', 'info': 'blue', 'warn': 'gold', 'error': 'red'};
@@ -345,9 +347,9 @@
var interval = options.pollinterval;
var ontimer = options.ontimer;
richfaces.stopPoll(pollId);
-
+
richfaces.setZeroRequestDelay(options);
-
+
pollTracker[pollId] = window.setTimeout(function(){
var pollElement = document.getElementById(pollId);
try {
@@ -365,7 +367,7 @@
delete pollTracker[id];
}
};
-
+
var pushTracker = {};
richfaces.startPush = function(options) {
@@ -375,7 +377,7 @@
var interval = options.interval;
var ondataavailable = options.ondataavailable;
richfaces.setZeroRequestDelay(options);
-
+
richfaces.stopPush(pushId);
pushTracker[pushId] = setTimeout(function() { // TODO: define this function in richfaces object to avoid definition every time when call startPush
@@ -482,7 +484,7 @@
options.requestDelay = 0;
}
};
-
+
var getGlobalStatusNameVariable = function() {
return richfaces.statusName;
}
@@ -560,7 +562,7 @@
richfaces.ajax = function(source, event, options) {
var sourceId = (typeof source == 'object' && source.id) ? source.id : source;
-
+
options = options || {};
parameters = options.parameters || {}; // TODO: change "parameters" to "richfaces.ajax.params"
@@ -608,7 +610,7 @@
parameters['onevent'] = eventsAdapter;
parameters['onerror'] = eventsAdapter;
}
-
+
if (richfaces.queue) {
parameters.queueId = options.queueId;
}
@@ -768,7 +770,7 @@
}
};
}()));
-
+
var ajaxOnComplete = function (data) {
var type = data.type;
var responseXML = data.responseXML;
Modified: root/core/trunk/impl/src/test/java/org/richfaces/component/util/HtmlUtilTest.java
===================================================================
--- root/core/trunk/impl/src/test/java/org/richfaces/component/util/HtmlUtilTest.java 2010-07-10 10:55:46 UTC (rev 17803)
+++ root/core/trunk/impl/src/test/java/org/richfaces/component/util/HtmlUtilTest.java 2010-07-10 11:46:53 UTC (rev 17804)
@@ -66,7 +66,7 @@
}
public void testExpandIdSelector() {
- String selector = ".class_form+#-Test .class2 #_aaaa";
+ String selector = ".class_form+#-Test #form\\:element .class2 #_aaaa";
UIComponent component = new UIComponentBase() {
public String getFamily() {
@@ -77,7 +77,7 @@
if ("-Test".equals(expr)) {
return new UIComponentBase() {
public String getClientId(FacesContext context) {
- return "component1";
+ return "component$1";
}
public String getFamily() {
@@ -103,7 +103,7 @@
};
String string = HtmlUtil.expandIdSelector(selector, component, null);
- assertEquals(".class_form+#component1 .class2 #component2", string);
+ assertEquals(".class_form+#component\\$1 #form\\:element .class2 #component2", string);
String s = ".class_form+.component1 .class2 #1component2";
14 years, 6 months
JBoss Rich Faces SVN: r17803 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-10 06:55:46 -0400 (Sat, 10 Jul 2010)
New Revision: 17803
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
Log:
Fixed NPE in CDK
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-07-10 00:23:48 UTC (rev 17802)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-07-10 10:55:46 UTC (rev 17803)
@@ -90,7 +90,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
*/
public class RendererClassVisitor implements TemplateVisitor {
@@ -177,23 +177,25 @@
List<ResourceDependency> resourceDependencies = compositeInterface.getResourceDependencies();
ELType dependencyType = typesFactory.getType(javax.faces.application.ResourceDependency.class);
- if (1 == resourceDependencies.size()) {
- ResourceDependency resource = resourceDependencies.get(0);
- this.generatedClass.addAnnotation(createResourceAnnotation(dependencyType, resource));
- } else if (resourceDependencies.size() > 1) {
- StringBuilder resources = new StringBuilder("{");
- for (ResourceDependency resource : resourceDependencies) {
- if (resources.length() > 1) {
- resources.append(',');
+ if (resourceDependencies != null) {
+ if (1 == resourceDependencies.size()) {
+ ResourceDependency resource = resourceDependencies.get(0);
+ this.generatedClass.addAnnotation(createResourceAnnotation(dependencyType, resource));
+ } else if (resourceDependencies.size() > 1) {
+ StringBuilder resources = new StringBuilder("{");
+ for (ResourceDependency resource : resourceDependencies) {
+ if (resources.length() > 1) {
+ resources.append(',');
+ }
+ resources.append("@ResourceDependency(");
+ resources.append("name=\"").append(resource.getName()).append("\",library=\"").append(
+ resource.getLibrary()).append("\",target=\"").append(resource.getTarget()).append("\"").append(")");
}
- resources.append("@ResourceDependency(");
- resources.append("name=\"").append(resource.getName()).append("\",library=\"").append(
- resource.getLibrary()).append("\",target=\"").append(resource.getTarget()).append("\"").append(")");
+ resources.append("}");
+ this.generatedClass.addAnnotation(new JavaAnnotation(typesFactory.getType(ResourceDependencies.class),
+ resources.toString()));
+ this.generatedClass.addImport(javax.faces.application.ResourceDependency.class);
}
- resources.append("}");
- this.generatedClass.addAnnotation(new JavaAnnotation(typesFactory.getType(ResourceDependencies.class),
- resources.toString()));
- this.generatedClass.addImport(javax.faces.application.ResourceDependency.class);
}
this.createMethodContext();
}
@@ -313,7 +315,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the rendererClass
*/
public JavaClass getGeneratedClass() {
@@ -322,7 +324,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
*/
@@ -334,7 +336,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
*/
@@ -346,7 +348,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
*/
@@ -366,7 +368,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
*/
@@ -380,7 +382,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(java.lang.String)
*/
@@ -397,7 +399,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #visitElement(org.richfaces.cdk.templatecompiler.model.CdkCallElement)
*/
@@ -413,7 +415,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
*/
@@ -427,7 +429,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
*/
@@ -440,7 +442,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
*/
@@ -452,7 +454,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
*/
@@ -464,7 +466,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
*/
@@ -477,7 +479,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
*/
@@ -489,7 +491,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
*/
@@ -501,7 +503,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
*/
@@ -513,7 +515,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #visitElement(org.richfaces.cdk.templatecompiler.model.CdkObjectElement)
*/
@@ -532,7 +534,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
*/
@@ -554,7 +556,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
*/
14 years, 6 months
JBoss Rich Faces SVN: r17802 - in root/commons/trunk: api/src/main/java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-07-09 20:23:48 -0400 (Fri, 09 Jul 2010)
New Revision: 17802
Modified:
root/commons/trunk/
root/commons/trunk/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java
root/commons/trunk/api/src/main/java/org/richfaces/renderkit/RenderKitUtils.java
root/commons/trunk/api/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java
Log:
Merged revisions 17750,17776,17796,17798 via svnmerge from
https://svn.jboss.org/repos/richfaces/root/commons/branches/RF8755
.......
r17750 | alexsmirnov | 2010-07-06 16:35:46 -0700 (Tue, 06 Jul 2010) | 1 line
https://jira.jboss.org/browse/RF-8306
.......
r17776 | alexsmirnov | 2010-07-08 17:18:37 -0700 (Thu, 08 Jul 2010) | 1 line
https://jira.jboss.org/browse/RF-8306
.......
r17796 | alexsmirnov | 2010-07-09 16:21:06 -0700 (Fri, 09 Jul 2010) | 1 line
https://jira.jboss.org/browse/RF-8306
.......
r17798 | alexsmirnov | 2010-07-09 16:34:15 -0700 (Fri, 09 Jul 2010) | 1 line
fix checkstyle violations
.......
Property changes on: root/commons/trunk
___________________________________________________________________
Name: svnmerge-integrated
- /root/commons/branches/RF8755:1-17687
+ /root/commons/branches/RF8755:1-17801
Modified: root/commons/trunk/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java
===================================================================
--- root/commons/trunk/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java 2010-07-10 00:20:59 UTC (rev 17801)
+++ root/commons/trunk/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java 2010-07-10 00:23:48 UTC (rev 17802)
@@ -29,13 +29,23 @@
* @author Nick Belaevski
*/
public class ComponentAttribute implements Comparable<ComponentAttribute> {
+
+ public enum Kind {
+ BOOL,
+ GENERIC,
+ URI
+ }
private final String htmlAttributeName;
private String componentAttributeName;
- private String[] eventNames;
+ private Object defaultValue;
+ private String[] eventNames = {};
+
+ private Kind kind = Kind.GENERIC;
+
//TODO handling for aliases: "styleClass" -> "class"
public ComponentAttribute(String htmlAttributeName) {
@@ -43,6 +53,38 @@
this.htmlAttributeName = htmlAttributeName;
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the defaultValue
+ */
+ public Object getDefaultValue() {
+ return this.defaultValue;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param defaultValue the defaultValue to set
+ */
+ public void setDefaultValue(Object dafaultValue) {
+ this.defaultValue = dafaultValue;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the kind
+ */
+ public Kind getKind() {
+ return this.kind;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param kind the kind to set
+ */
+ public void setKind(Kind kind) {
+ this.kind = kind;
+ }
+
public static final Map<String, ComponentAttribute> createMap(ComponentAttribute... attributes) {
Map<String,ComponentAttribute> result = new TreeMap<String, ComponentAttribute>();
Modified: root/commons/trunk/api/src/main/java/org/richfaces/renderkit/RenderKitUtils.java
===================================================================
--- root/commons/trunk/api/src/main/java/org/richfaces/renderkit/RenderKitUtils.java 2010-07-10 00:20:59 UTC (rev 17801)
+++ root/commons/trunk/api/src/main/java/org/richfaces/renderkit/RenderKitUtils.java 2010-07-10 00:23:48 UTC (rev 17802)
@@ -24,10 +24,12 @@
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.TreeSet;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
@@ -39,6 +41,8 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.richfaces.renderkit.ComponentAttribute.Kind;
+
/**
* @author Nick Belaevski
*
@@ -83,13 +87,14 @@
}
private static Map<String, List<ClientBehavior>> getClientBehaviorsMap(UIComponent component) {
- Map<String, List<ClientBehavior>> result = null;
+ Map<String, List<ClientBehavior>> result;
if (component instanceof ClientBehaviorHolder) {
ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
result = clientBehaviorHolder.getClientBehaviors();
+ } else {
+ result = Collections.emptyMap();
}
-
return result;
}
@@ -98,14 +103,14 @@
if (disabledAttributeValue == null) {
return false;
}
-
+
if (disabledAttributeValue instanceof Boolean) {
return Boolean.TRUE.equals(disabledAttributeValue);
}
-
+
return Boolean.valueOf(disabledAttributeValue.toString());
}
-
+
static String escape(String s) {
StringBuilder sb = new StringBuilder(s.length());
int start = 0;
@@ -114,43 +119,43 @@
while ((end = s.indexOf('\'', start)) >= 0) {
sb.append(s, start, end);
sb.append("\\'");
-
+
start = end + 1;
}
-
+
sb.append(s, start, s.length());
-
+
return sb.toString();
}
-
+
static boolean chain(StringBuilder sb, Object object, boolean isChained) {
if (object != null) {
String objectString = object.toString().trim();
if (objectString.length() != 0) {
final boolean localIsChained;
-
+
if (!isChained && sb.length() != 0) {
- //extract previously stored handler
+ // extract previously stored handler
String previousHandlerString = sb.toString();
- //clear builder object
+ // clear builder object
sb.setLength(0);
-
- //append escaped handler
+
+ // append escaped handler
sb.append("'");
sb.append(escape(previousHandlerString));
sb.append("'");
-
+
localIsChained = true;
} else {
- //use passed in value of chained indicator
+ // use passed in value of chained indicator
localIsChained = isChained;
}
-
+
if (localIsChained) {
sb.append(",'");
sb.append(escape(objectString));
sb.append("'");
-
+
return true;
} else {
sb.append(objectString);
@@ -158,11 +163,11 @@
}
}
}
-
- //no changes, pass chained indicator we initially used
+
+ // no changes, pass chained indicator we initially used
return isChained;
}
-
+
private static Object createBehaviorsChain(Object inlineHandlerValue, ClientBehaviorContext behaviorContext,
List<ClientBehavior> behaviors) {
@@ -172,7 +177,7 @@
isChained = chain(result, inlineHandlerValue, isChained);
for (ClientBehavior behavior : behaviors) {
isChained = chain(result, behavior.getScript(behaviorContext), isChained);
-
+
if (behavior.getHints().contains(ClientBehaviorHint.SUBMITTING)) {
break;
}
@@ -181,21 +186,20 @@
if (result.length() == 0) {
return null;
}
-
+
if (isChained) {
result.insert(0, "jsf.util.chain(");
result.append(")");
}
-
+
return result.toString();
}
- //TODO filter out empty strings
- static boolean shouldRenderAttribute(Object attributeValue) {
+ public static boolean shouldRenderAttribute(Object attributeValue) {
if (attributeValue == null) {
return false;
} else if (attributeValue instanceof String) {
- return true;
+ return ((String) attributeValue).length() > 0;
} else if (attributeValue instanceof Boolean && Boolean.FALSE.equals(attributeValue)) {
return false;
} else if (attributeValue instanceof Integer && (Integer) attributeValue == Integer.MIN_VALUE) {
@@ -214,7 +218,7 @@
return false;
}
- return true;
+ return attributeValue.toString().length() > 0;
}
public static String prefixAttributeName(String attributeName, boolean isXhtmlMode) {
@@ -241,7 +245,7 @@
ResponseWriter writer = facesContext.getResponseWriter();
String prefixedAttributeName = prefixAttributeName(attributeName, writer);
-
+
if (Arrays.binarySearch(URI_ATTRIBUTE_NAMES, attributeName) >= 0) {
writer.writeURIAttribute(prefixedAttributeName, attributeValue, null);
} else if (Arrays.binarySearch(BOOLEAN_ATTRIBUTE_NAMES, attributeName) >= 0) {
@@ -272,20 +276,20 @@
String componentAttributeName = componentAttribute.getComponentAttributeName();
Object attributeValue = component.getAttributes().get(componentAttributeName);
- Map<String, List<ClientBehavior>> behaviorsMap = getClientBehaviorsMap(component);
- if (behaviorsMap != null) {
- String[] eventNames = componentAttribute.getEventNames();
- if (eventNames != null) {
+ String[] eventNames = componentAttribute.getEventNames();
+ if (eventNames.length > 0) {
+ Map<String, List<ClientBehavior>> behaviorsMap = getClientBehaviorsMap(component);
+ if (behaviorsMap.size() > 0) {
for (String eventName : eventNames) {
- List<ClientBehavior> behaviorsList = behaviorsMap.get(eventName);
- if (behaviorsList != null) {
+ if (behaviorsMap.containsKey(eventName)) {
+ List<ClientBehavior> behaviorsList = behaviorsMap.get(eventName);
if (!behaviorsList.isEmpty()) {
// TODO - parameters handling
- ClientBehaviorContext behaviorContext = ClientBehaviorContext.createClientBehaviorContext(
- facesContext, component, eventName, null, null);
+ ClientBehaviorContext behaviorContext =
+ ClientBehaviorContext.createClientBehaviorContext(facesContext, component, eventName,
+ null, null);
attributeValue = createBehaviorsChain(attributeValue, behaviorContext, behaviorsList);
}
-
break;
}
}
@@ -322,7 +326,7 @@
if (disabled && knownAttribute.getEventNames() != null) {
continue;
}
-
+
renderAttributeAndBehaviors(context, component, knownAttribute);
}
}
@@ -344,18 +348,21 @@
public static void renderPassThroughAttributes(FacesContext context, UIComponent component,
Map<String, ComponentAttribute> knownAttributesMap) throws IOException {
+ Collection<ComponentAttribute> attributes = knownAttributesMap.values();
+ renderPassThroughAttributes(context, component, attributes);
+ }
+
+ public static void renderPassThroughAttributes(FacesContext context, UIComponent component, Collection<ComponentAttribute> attributes)
+ throws IOException {
boolean disabled = isDisabled(component);
-
- for (ComponentAttribute knownAttribute : knownAttributesMap.values()) {
- if (disabled && knownAttribute.getEventNames() != null) {
- continue;
+ for (ComponentAttribute knownAttribute : attributes) {
+ if (!disabled || knownAttribute.getEventNames().length == 0) {
+ renderAttributeAndBehaviors(context, component, knownAttribute);
}
-
- renderAttributeAndBehaviors(context, component, knownAttribute);
}
}
-
+
public static String decodeBehaviors(FacesContext context, UIComponent component) {
if (!(component instanceof ClientBehaviorHolder)) {
return null;
@@ -385,12 +392,59 @@
for (ClientBehavior behavior : behaviorsForEvent) {
behavior.decode(context, component);
}
-
+
return behaviorEvent;
}
}
-
+
return null;
}
+ public static Attributes attributes() {
+ return new Attributes();
+ }
+
+ @SuppressWarnings("serial")
+ public static final class Attributes extends TreeSet<ComponentAttribute> {
+
+ private ComponentAttribute last;
+
+ public void render(FacesContext context, UIComponent component) throws IOException {
+ renderPassThroughAttributes(context, component, this);
+ }
+
+ public Attributes generic(String name, String componentAttribute, String... events) {
+ ComponentAttribute attribute = createAttribute(name, componentAttribute);
+ attribute.setEventNames(events);
+ attribute.setKind(Kind.GENERIC);
+ return this;
+ }
+
+ private ComponentAttribute createAttribute(String name, String componentAttribute) {
+ ComponentAttribute attribute = new ComponentAttribute(name);
+ attribute.setComponentAttributeName(componentAttribute);
+ add(attribute);
+ last = attribute;
+ return attribute;
+ }
+
+ public Attributes uri(String name, String componentAttribute) {
+ ComponentAttribute attribute = createAttribute(name, componentAttribute);
+ attribute.setKind(Kind.URI);
+ return this;
+ }
+
+ public Attributes bool(String name, String componentAttribute) {
+ ComponentAttribute attribute = createAttribute(name, componentAttribute);
+ attribute.setKind(Kind.BOOL);
+ return this;
+ }
+
+ public Attributes defaultValue(Object value){
+ last.setDefaultValue(value);
+ return this;
+ }
+
+ }
+
}
Modified: root/commons/trunk/api/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java
===================================================================
--- root/commons/trunk/api/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java 2010-07-10 00:20:59 UTC (rev 17801)
+++ root/commons/trunk/api/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java 2010-07-10 00:23:48 UTC (rev 17802)
@@ -70,7 +70,7 @@
public void testShouldRenderAttribute() throws Exception {
assertFalse(RenderKitUtils.shouldRenderAttribute(null));
- assertTrue(RenderKitUtils.shouldRenderAttribute(""));
+ assertFalse(RenderKitUtils.shouldRenderAttribute(""));
assertTrue(RenderKitUtils.shouldRenderAttribute("test"));
assertTrue(RenderKitUtils.shouldRenderAttribute(new Object()));
14 years, 6 months
JBoss Rich Faces SVN: r17798 - in root/commons/branches/RF8755/api/src: test/java/org/richfaces/renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-07-09 19:34:15 -0400 (Fri, 09 Jul 2010)
New Revision: 17798
Modified:
root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java
root/commons/branches/RF8755/api/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java
Log:
fix checkstyle violations
Modified: root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java
===================================================================
--- root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java 2010-07-09 23:30:29 UTC (rev 17797)
+++ root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java 2010-07-09 23:34:15 UTC (rev 17798)
@@ -42,6 +42,17 @@
private Object defaultValue;
+ private String[] eventNames = {};
+
+ private Kind kind = Kind.GENERIC;
+
+ //TODO handling for aliases: "styleClass" -> "class"
+
+ public ComponentAttribute(String htmlAttributeName) {
+ super();
+ this.htmlAttributeName = htmlAttributeName;
+ }
+
/**
* <p class="changed_added_4_0"></p>
* @return the defaultValue
@@ -58,12 +69,6 @@
this.defaultValue = dafaultValue;
}
- private String[] eventNames = {};
-
- private Kind kind = Kind.GENERIC;
-
- //TODO handling for aliases: "styleClass" -> "class"
-
/**
* <p class="changed_added_4_0"></p>
* @return the kind
@@ -80,11 +85,6 @@
this.kind = kind;
}
- public ComponentAttribute(String htmlAttributeName) {
- super();
- this.htmlAttributeName = htmlAttributeName;
- }
-
public static final Map<String, ComponentAttribute> createMap(ComponentAttribute... attributes) {
Map<String,ComponentAttribute> result = new TreeMap<String, ComponentAttribute>();
Modified: root/commons/branches/RF8755/api/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java
===================================================================
--- root/commons/branches/RF8755/api/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java 2010-07-09 23:30:29 UTC (rev 17797)
+++ root/commons/branches/RF8755/api/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java 2010-07-09 23:34:15 UTC (rev 17798)
@@ -70,7 +70,7 @@
public void testShouldRenderAttribute() throws Exception {
assertFalse(RenderKitUtils.shouldRenderAttribute(null));
- assertTrue(RenderKitUtils.shouldRenderAttribute(""));
+ assertFalse(RenderKitUtils.shouldRenderAttribute(""));
assertTrue(RenderKitUtils.shouldRenderAttribute("test"));
assertTrue(RenderKitUtils.shouldRenderAttribute(new Object()));
14 years, 6 months
JBoss Rich Faces SVN: r17797 - in root/commons/branches/RF8755: api/src/main/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-07-09 19:30:29 -0400 (Fri, 09 Jul 2010)
New Revision: 17797
Modified:
root/commons/branches/RF8755/
root/commons/branches/RF8755/api/src/main/java/org/richfaces/MethodMetadata.java
Log:
Merged revisions 17736 via svnmerge from
https://svn.jboss.org/repos/richfaces/root/commons/trunk
.......
r17736 | nbelaevski | 2010-07-06 05:54:22 -0700 (Tue, 06 Jul 2010) | 1 line
Added TODOs to MethodMetadata class
.......
Property changes on: root/commons/branches/RF8755
___________________________________________________________________
Name: svnmerge-integrated
- /root/commons/trunk:1-17712
+ /root/commons/trunk:1-17796
Modified: root/commons/branches/RF8755/api/src/main/java/org/richfaces/MethodMetadata.java
===================================================================
--- root/commons/branches/RF8755/api/src/main/java/org/richfaces/MethodMetadata.java 2010-07-09 23:21:06 UTC (rev 17796)
+++ root/commons/branches/RF8755/api/src/main/java/org/richfaces/MethodMetadata.java 2010-07-09 23:30:29 UTC (rev 17797)
@@ -33,12 +33,14 @@
* @author akolonitsky
* @since Feb 24, 2010
*/
+//TODO nick - handle return type
public abstract class MethodMetadata extends Metadata {
- protected final Class[] signature;
+
+ protected final Class<?>[] signature;
protected final TagAttribute attribute;
- public MethodMetadata(TagAttribute attribute, Class ... signature) {
+ public MethodMetadata(TagAttribute attribute, Class<?> ... signature) {
this.attribute = attribute;
this.signature = signature;
}
14 years, 6 months
JBoss Rich Faces SVN: r17796 - root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-07-09 19:21:06 -0400 (Fri, 09 Jul 2010)
New Revision: 17796
Modified:
root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java
root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/RenderKitUtils.java
Log:
https://jira.jboss.org/browse/RF-8306
Modified: root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java
===================================================================
--- root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java 2010-07-09 23:17:17 UTC (rev 17795)
+++ root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/ComponentAttribute.java 2010-07-09 23:21:06 UTC (rev 17796)
@@ -40,22 +40,22 @@
private String componentAttributeName;
- private Object dafaultValue;
+ private Object defaultValue;
/**
* <p class="changed_added_4_0"></p>
- * @return the dafaultValue
+ * @return the defaultValue
*/
- public Object getDafaultValue() {
- return this.dafaultValue;
+ public Object getDefaultValue() {
+ return this.defaultValue;
}
/**
* <p class="changed_added_4_0"></p>
- * @param dafaultValue the dafaultValue to set
+ * @param defaultValue the defaultValue to set
*/
- public void setDafaultValue(Object dafaultValue) {
- this.dafaultValue = dafaultValue;
+ public void setDefaultValue(Object dafaultValue) {
+ this.defaultValue = dafaultValue;
}
private String[] eventNames = {};
Modified: root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/RenderKitUtils.java
===================================================================
--- root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/RenderKitUtils.java 2010-07-09 23:17:17 UTC (rev 17795)
+++ root/commons/branches/RF8755/api/src/main/java/org/richfaces/renderkit/RenderKitUtils.java 2010-07-09 23:21:06 UTC (rev 17796)
@@ -413,7 +413,7 @@
renderPassThroughAttributes(context, component, this);
}
- public Attributes literal(String name, String componentAttribute, String... events) {
+ public Attributes generic(String name, String componentAttribute, String... events) {
ComponentAttribute attribute = createAttribute(name, componentAttribute);
attribute.setEventNames(events);
attribute.setKind(Kind.GENERIC);
@@ -441,7 +441,7 @@
}
public Attributes defaultValue(Object value){
- last.setDafaultValue(value);
+ last.setDefaultValue(value);
return this;
}
14 years, 6 months