Author: nbelaevski
Date: 2008-02-08 21:00:25 -0500 (Fri, 08 Feb 2008)
New Revision: 5971
Added:
trunk/samples/progressBarDemo/
trunk/samples/progressBarDemo/pom.xml
trunk/samples/progressBarDemo/src/main/java/org/richfaces/samples/
trunk/samples/progressBarDemo/src/main/java/org/richfaces/samples/Bean.java
trunk/samples/progressBarDemo/src/main/webapp/pages/index.jsp
trunk/ui/progressBAR/
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
Removed:
trunk/samples/progressBarDemo/pom.xml
trunk/samples/progressBarDemo/src/main/java/org/richfaces/samples/Bean.java
trunk/samples/progressBarDemo/src/main/java/org/richfaces/sandbox/
trunk/samples/progressBarDemo/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/progressBarDemo/
trunk/sandbox/ui/progressBAR/
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
Modified:
trunk/samples/pom.xml
trunk/samples/progressBarDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/progressBarDemo/src/main/webapp/pages/index.xhtml
trunk/sandbox/samples/pom.xml
trunk/sandbox/ui/pom.xml
trunk/ui/pom.xml
trunk/ui/progressBAR/pom.xml
Log:
ProgressBar component moved to main build
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2008-02-09 01:14:34 UTC (rev 5970)
+++ trunk/samples/pom.xml 2008-02-09 02:00:25 UTC (rev 5971)
@@ -462,6 +462,7 @@
<module>combobox-sample</module>
<module>pickList-sample</module>
+ <module>progressBarDemo</module>
</modules>
</project>
\ No newline at end of file
Copied: trunk/samples/progressBarDemo (from rev 5966,
trunk/sandbox/samples/progressBarDemo)
Deleted: trunk/samples/progressBarDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/progressBarDemo/pom.xml 2008-02-08 18:58:01 UTC (rev 5966)
+++ trunk/samples/progressBarDemo/pom.xml 2008-02-09 02:00:25 UTC (rev 5971)
@@ -1,41 +0,0 @@
-<?xml version="1.0"?><project>
- <parent>
- <artifactId>samples</artifactId>
- <groupId>org.richfaces.sandbox</groupId>
- <version>3.2.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.sandbox.samples</groupId>
- <artifactId>progressBarDemo</artifactId>
- <packaging>war</packaging>
- <name>progressBarDemo Maven Webapp</name>
- <version>3.2.0-SNAPSHOT</version>
- <build>
- <finalName>progressBarDemo</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.richfaces.sandbox.ui</groupId>
- <artifactId>progressBar</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.richfaces.samples</groupId>
- <artifactId>skins</artifactId>
- <version>${project.version}</version>
- </dependency>
-
-
- </dependencies>
-</project>
\ No newline at end of file
Copied: trunk/samples/progressBarDemo/pom.xml (from rev 5969,
trunk/sandbox/samples/progressBarDemo/pom.xml)
===================================================================
--- trunk/samples/progressBarDemo/pom.xml (rev 0)
+++ trunk/samples/progressBarDemo/pom.xml 2008-02-09 02:00:25 UTC (rev 5971)
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>progressBarDemo</artifactId>
+ <packaging>war</packaging>
+ <name>progressBarDemo Maven Webapp</name>
+ <build>
+ <finalName>progressBarDemo</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>progressBar</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>componentControl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>skins</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ </dependencies>
+</project>
Copied: trunk/samples/progressBarDemo/src/main/java/org/richfaces/samples (from rev 5966,
trunk/sandbox/samples/progressBarDemo/src/main/java/org/richfaces/sandbox/samples)
Deleted: trunk/samples/progressBarDemo/src/main/java/org/richfaces/samples/Bean.java
===================================================================
---
trunk/sandbox/samples/progressBarDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-02-08
18:58:01 UTC (rev 5966)
+++ trunk/samples/progressBarDemo/src/main/java/org/richfaces/samples/Bean.java 2008-02-09
02:00:25 UTC (rev 5971)
@@ -1,115 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.sandbox.samples;
-
-
-import java.util.Date;
-
-/**
- * @author $Autor$
- *
- */
-public class Bean {
-
- private boolean enabled = false;
- private boolean permanent = false;
- private boolean determined = true;
- private boolean ajaxMode;
-
- private Integer value = 0;
-
- public String action () {
- return null;
- }
-
- public String start() {
- this.enabled = true;
- return null;
- }
-
- public String getDate() {
- Date date = new Date();
- return date.toLocaleString();
- }
-
- /**
- * @return the value
- */
- public Integer getValue() {
- //value = value.add(new BigDecimal(0.6));
- return value;
- }
-
- /**
- * @param value the value to set
- */
- public void setValue(Integer value) {
- this.value = value;
- }
-
- public Integer getIncValue() {
- return value++;
- }
-
- /**
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * @param enabled the enabled to set
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- public boolean isPermanent() {
- return permanent;
- }
-
- public void setPermanent(boolean permanent) {
- this.permanent = permanent;
- }
-
- public boolean isDetermined() {
- return determined;
- }
-
- public void setDetermined(boolean determined) {
- this.determined = determined;
- }
-
- public boolean isAjaxMode() {
- return ajaxMode;
- }
-
- public void setAjaxMode(boolean ajaxMode) {
- this.ajaxMode = ajaxMode;
- }
-
- public String getModeString() {
- return ajaxMode ? "ajax" : "client";
- }
-
-}
\ No newline at end of file
Copied: trunk/samples/progressBarDemo/src/main/java/org/richfaces/samples/Bean.java (from
rev 5969,
trunk/sandbox/samples/progressBarDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java)
===================================================================
--- trunk/samples/progressBarDemo/src/main/java/org/richfaces/samples/Bean.java
(rev 0)
+++ trunk/samples/progressBarDemo/src/main/java/org/richfaces/samples/Bean.java 2008-02-09
02:00:25 UTC (rev 5971)
@@ -0,0 +1,116 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.samples;
+
+
+import java.util.Date;
+
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+ private boolean enabled = false;
+ private boolean permanent = false;
+ private boolean determined = true;
+ private boolean ajaxMode;
+
+ private Integer value = 0;
+
+ public String action () {
+ System.out.println("Bean.action()");
+ return null;
+ }
+
+ public String start() {
+ this.enabled = true;
+ return null;
+ }
+
+ public String getDate() {
+ Date date = new Date();
+ return date.toLocaleString();
+ }
+
+ /**
+ * @return the value
+ */
+ public Integer getValue() {
+ //value = value.add(new BigDecimal(0.6));
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(Integer value) {
+ this.value = value;
+ }
+
+ public Integer getIncValue() {
+ return value++;
+ }
+
+ /**
+ * @return the enabled
+ */
+ public boolean getEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public boolean isPermanent() {
+ return permanent;
+ }
+
+ public void setPermanent(boolean permanent) {
+ this.permanent = permanent;
+ }
+
+ public boolean isDetermined() {
+ return determined;
+ }
+
+ public void setDetermined(boolean determined) {
+ this.determined = determined;
+ }
+
+ public boolean isAjaxMode() {
+ return ajaxMode;
+ }
+
+ public void setAjaxMode(boolean ajaxMode) {
+ this.ajaxMode = ajaxMode;
+ }
+
+ public String getModeString() {
+ return ajaxMode ? "ajax" : "client";
+ }
+
+}
\ No newline at end of file
Modified: trunk/samples/progressBarDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/sandbox/samples/progressBarDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-02-08
18:58:01 UTC (rev 5966)
+++ trunk/samples/progressBarDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-02-09
02:00:25 UTC (rev 5971)
@@ -4,7 +4,7 @@
<faces-config>
<managed-bean>
<managed-bean-name>bean</managed-bean-name>
-
<managed-bean-class>org.richfaces.sandbox.samples.Bean</managed-bean-class>
+ <managed-bean-class>org.richfaces.samples.Bean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
Deleted: trunk/samples/progressBarDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-02-08
18:58:01 UTC (rev 5966)
+++ trunk/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-02-09 02:00:25 UTC
(rev 5971)
@@ -1,95 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
-<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/ui/progressBar"
prefix="progressBar" %>
-<html>
- <head>
- <title></title>
- <style>
- body{font-size : 11px}
- .complete {
- background-color: green;
- color: white;
- }
- .remain {
- background-color: #FCBBCD;
- }
- .main {
- font-size: 12px;
- font-weight: bold;
- }
- </style>
- </head>
- <body>
- <f:view>
-
- <h:form>
- <h:selectOneRadio binding="#{skinBean.component}" />
- <h:commandLink action="#{skinBean.change}" value="set
skin" />
- </h:form>
-
- <h:form>
- <h:panelGrid columns="3">
- <h:outputText value="Progress value: " />
- <h:inputText value="#{bean.value}" />
-
- <h:commandButton value="Set" />
- </h:panelGrid>
-
- </h:form>
-
- <h:form id="_form">
-
- <progressBar:progressBar value="#{bean.incValue}"
enabled="#{bean.enabled}" id="progrs"
- interval="700"
- reRender="per1"
- reRenderAfterComplete="per2"
- mode="#{bean.modeString}"
- progressVar="percent"
- parameters="text:'crack'"
- style="width: 300px; height: 15px;"
- action="#{bean.action}">
- <f:facet name="initial">
- <h:outputText value="Process not started"></h:outputText>
- </f:facet>
- <f:facet name="complete">
- <h:outputText value="Process completed"></h:outputText>
- </f:facet>
- <h:outputText value="{value}%"></h:outputText>
- </progressBar:progressBar>
- <br clear="all"/>
- <table><tr>
- <td>ReRender:</td><td><h:outputText value="#{bean.date}"
id="per1"></h:outputText></td></tr><tr>
- <td>ReRender after complete:</td><td><h:outputText
value="#{bean.date}" id="per2"></h:outputText></td>
- </tr></table></h:form>
-
- <h:form>
- Enabled: <h:selectBooleanCheckbox value="#{bean.enabled}"
id="flag">
- <a4j:support event="onclick"
reRender="progrs"></a4j:support>
- </h:selectBooleanCheckbox>
-
- <f:verbatim><br /></f:verbatim>
-
-
- Ajax mode: <h:selectBooleanCheckbox value="#{bean.ajaxMode}"
id="flag3">
- <a4j:support event="onclick"
reRender="progrs"></a4j:support>
- </h:selectBooleanCheckbox>
- <f:verbatim><br /></f:verbatim>
- </h:form>
- <script>
- var pr = $('_form:progrs').component;
- </script>
- <input type="button" value="Get value"
onclick="alert($('_form:progrs').component.getValue());"
/><br/>
- <input type="text" value="" id="percent"/>
- <input type="button" value="Set value"
onclick="$('_form:progrs').component.setValue(document.getElementById('percent').value);"
/>
- <br/>
- <input type="text" value="" id="label"/>
- <input type="button" value="Set label"
onclick="$('_form:progrs').component.setLabel(document.getElementById('label').value);"
/>
- <br/>
- <input type="button" value="Disable"
onclick="$('_form:progrs').component.disable();" />
- <br/>
- <input type="button" value="Enable"
onclick="$('_form:progrs').component.enable(event);" />
-
- </f:view>
- </body>
-</html>
Copied: trunk/samples/progressBarDemo/src/main/webapp/pages/index.jsp (from rev 5969,
trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp)
===================================================================
--- trunk/samples/progressBarDemo/src/main/webapp/pages/index.jsp
(rev 0)
+++ trunk/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-02-09 02:00:25 UTC
(rev 5971)
@@ -0,0 +1,105 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/progressBar"
prefix="progressBar" %>
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/componentControl"
prefix="cctrl" %>
+<html>
+ <head>
+ <title></title>
+ <style>
+ body{font-size : 11px}
+ .complete {
+ background-color: green;
+ color: white;
+ }
+ .remain {
+ background-color: #FCBBCD;
+ }
+ .main {
+ font-size: 12px;
+ font-weight: bold;
+ }
+ </style>
+ </head>
+ <body>
+ <f:view>
+
+ <h:form>
+ <h:selectOneRadio binding="#{skinBean.component}" />
+ <h:commandLink action="#{skinBean.change}" value="set
skin" />
+ </h:form>
+
+ <h:form>
+ <h:panelGrid columns="3">
+ <h:outputText value="Progress value: " />
+ <h:inputText value="#{bean.value}" />
+
+ <h:commandButton value="Set" />
+ </h:panelGrid>
+
+ </h:form>
+
+ <h:form id="_form">
+
+ <progressBar:progressBar value="#{bean.incValue}"
enabled="#{bean.enabled}" id="progrs"
+ interval="700"
+ reRender="per1"
+ reRenderAfterComplete="per2"
+ mode="#{bean.modeString}"
+ progressVar="percent"
+ parameters="text:'crack'"
+ style="width: 300px; height: 14px;"
+ action="#{bean.action}">
+ <f:facet name="initial">
+ <h:outputText value="Process not started"></h:outputText>
+ </f:facet>
+ <f:facet name="complete">
+ <h:outputText value="Process completed"></h:outputText>
+ </f:facet>
+ <h:outputText value="{value}%"></h:outputText>
+ </progressBar:progressBar>
+ <br clear="all"/>
+ <table><tr>
+ <td>ReRender:</td><td><h:outputText value="#{bean.date}"
id="per1"></h:outputText></td></tr><tr>
+ <td>ReRender after complete:</td><td><h:outputText
value="#{bean.date}" id="per2"></h:outputText></td>
+ </tr></table></h:form>
+
+ <h:form>
+ Enabled: <h:selectBooleanCheckbox value="#{bean.enabled}"
id="flag">
+ <a4j:support event="onclick"
reRender="progrs"></a4j:support>
+ </h:selectBooleanCheckbox>
+
+ <f:verbatim><br /></f:verbatim>
+
+
+ Ajax mode: <h:selectBooleanCheckbox value="#{bean.ajaxMode}"
id="flag3">
+ <a4j:support event="onclick"
reRender="progrs"></a4j:support>
+ </h:selectBooleanCheckbox>
+ <f:verbatim><br /></f:verbatim>
+ </h:form>
+ <script>
+ var pr = $('_form:progrs').component;
+ </script>
+ <input type="button" value="Get value"
onclick="alert($('_form:progrs').component.getValue());"
/><br/>
+ <input type="text" value="" id="percent"/>
+ <input type="button" value="Set value"
onclick="$('_form:progrs').component.setValue(document.getElementById('percent').value);"
/>
+ <input type="button" id="ctrlValueButton" value="Set value
by componentControl" />
+ <cctrl:componentControl attachTo="ctrlValueButton" for="progrs"
event="click" disableDefault="true"
operation="setValue">
+ <a4j:actionparam name="value" value="$F('percent')"
noEscape="true" />
+ </cctrl:componentControl>
+ <br/>
+
+ <input type="text" value="111" id="label"/>
+ <input type="button" value="Set label"
onclick="$('_form:progrs').component.setLabel(document.getElementById('label').value);"
/>
+ <input type="button" id="ctrlLabelButton" value="Set label
by componentControl" />
+ <cctrl:componentControl attachTo="ctrlLabelButton" for="progrs"
event="click" disableDefault="true"
operation="setLabel">
+ <a4j:actionparam name="label" value="$F('label')"
noEscape="true" />
+ </cctrl:componentControl>
+ <br/>
+ <input type="button" value="Disable"
onclick="$('_form:progrs').component.disable();" />
+ <br/>
+ <input type="button" value="Enable"
onclick="$('_form:progrs').component.enable(event);" />
+ <br />
+ </f:view>
+ </body>
+</html>
Modified: trunk/samples/progressBarDemo/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.xhtml 2008-02-08
18:58:01 UTC (rev 5966)
+++ trunk/samples/progressBarDemo/src/main/webapp/pages/index.xhtml 2008-02-09 02:00:25
UTC (rev 5971)
@@ -5,7 +5,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:c="http://java.sun.com/jsp/jstl/core"
-
xmlns:progressBar="http://labs.jboss.com/jbossrichfaces/ui/ui/progre...
+
xmlns:progressBar="http://labs.jboss.com/jbossrichfaces/ui/progressB...
<f:view>
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2008-02-09 01:14:34 UTC (rev 5970)
+++ trunk/sandbox/samples/pom.xml 2008-02-09 02:00:25 UTC (rev 5971)
@@ -18,7 +18,6 @@
<!--module>contextMenuDemo</module-->
<module>fileUploadPOC</module>
<module>fileUploadDemo</module>
- <module>progressBarDemo</module>
<module>sortingFilteringDemo</module>
</modules>
</project>
\ No newline at end of file
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2008-02-09 01:14:34 UTC (rev 5970)
+++ trunk/sandbox/ui/pom.xml 2008-02-09 02:00:25 UTC (rev 5971)
@@ -20,6 +20,5 @@
<!--module>rex-button</module-->
<module>sortableHeader</module>
<module>fileUpload</module>
- <module>progressBAR</module>
</modules>
</project>
\ No newline at end of file
Modified: trunk/ui/pom.xml
===================================================================
--- trunk/ui/pom.xml 2008-02-09 01:14:34 UTC (rev 5970)
+++ trunk/ui/pom.xml 2008-02-09 02:00:25 UTC (rev 5971)
@@ -106,6 +106,7 @@
<module>columns</module>
<module>combobox</module>
<module>pickList</module>
+ <module>progressBAR</module>
</modules>
<dependencies>
<dependency>
Copied: trunk/ui/progressBAR (from rev 5966, trunk/sandbox/ui/progressBAR)
Modified: trunk/ui/progressBAR/pom.xml
===================================================================
--- trunk/sandbox/ui/progressBAR/pom.xml 2008-02-08 18:58:01 UTC (rev 5966)
+++ trunk/ui/progressBAR/pom.xml 2008-02-09 02:00:25 UTC (rev 5971)
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><project>
<parent>
<artifactId>ui</artifactId>
- <groupId>org.richfaces.sandbox</groupId>
+ <groupId>org.richfaces</groupId>
<version>3.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.sandbox.ui</groupId>
+ <groupId>org.richfaces.ui</groupId>
<artifactId>progressBar</artifactId>
<name>progressBar</name>
<version>3.2.0-SNAPSHOT</version>
@@ -25,7 +25,7 @@
</executions>
<configuration>
<library>
- <prefix>org.richfaces.sandbox.ui</prefix>
+ <prefix>org.richfaces.ui</prefix>
<taglib>
<shortName>progressBar</shortName>
</taglib>
@@ -36,12 +36,6 @@
</build>
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
<version>3.2.0-SNAPSHOT</version>
@@ -52,4 +46,4 @@
<version>3.2.0-SNAPSHOT</version>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
Deleted:
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
---
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-08
18:58:01 UTC (rev 5966)
+++
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-09
02:00:25 UTC (rev 5971)
@@ -1,215 +0,0 @@
-ProgressBar = {};
-ProgressBar = Class.create();
-Object.extend(ProgressBar.prototype, {
- initialize: function(id, containerId, formId, mode, minValue, maxValue, context,
markup, options, progressVar, state, value) {
- this.id = id;
-
- this.containerId = containerId;
- this.formId = formId;
- this.mode = mode;
- this.state = state;
- this.minValue = minValue;
- this.maxValue = maxValue;
- this.value = value;
-
- this.context = context;
- this.markup = markup;
- this.options = options || {};
-
- this.options.onbeforedomupdate = function(request, event, data) {
- this.onComplete(data);
- }.bind(this);
-
- this.progressVar = progressVar;
- $(this.id).component = this;
- },
-
- getValue: function () {
- return this.value;
- },
- onComplete: function (data) {
- if (!$(this.id)) { return; }
- if (data) {
- this.value = data['percent'];
- if (this.state == "progressState") {
- this.updateComponent(data);
- this.renderLabel(data['markup'], data['context']);
- if (this.value >= this.getMaxValue()) {
- this.forceState("complete",null);
- return;
- }
- } else if (this.state == "initialState" && this.value >=
this.getMinValue()) {
- this.state = "progressState";
- this.forceState("progressState", function () { this.poll() }.bind(this));
- return;
- }
- this.poll();
- }
-
- },
- poll: function () {
- A4J.AJAX.Poll(this.containerId, this.formId, this.options);
- },
- interpolate: function (placeholders) {
- for(var k in this.context) {
- var v = this.context[k];
- var regexp = new RegExp("\\{" + k + "\\}", "g");
- placeholders = placeholders.replace(regexp, v);
- }
- return placeholders;
- },
- updateComponent: function (data) {
- this.updateStyle(data['style']);
- this.setValue(data['percent']);
- if (!data['enabled']) { this.disable(); }
- this.updateClassName($(this.id + ":complete"),
data['completeClass']);
- this.updateClassName($(this.id + ":remain"), data['remainClass']);
- this.updateClassName($(this.id), data['styleClass']);
-
- if (this.options.pollinterval != data['interval']) {
- this.options.pollinterval = data['interval'];
- }
- },
- updateStyle: function (style) {
- if (!style) { return; }
- var d = $(this.id);
- if (d.style)
- if (d.style.cssText != style) {
- d.style.cssText = style;
- d = $(this.id + ":remain");
- if (d) d.style.cssText = style;
- d = $(this.id + ":complete");
- if (d) d.style.cssText = style;
- d = $(this.id + ":upload");
- if (d) d.style.cssText = style;
- }
- },
- updateClassName: function (o, newName) {
- if (!newName) return;
- if (o && o.className) {
- if (o.className.indexOf(newName) < 0){
- o.className = o.className + " " + newName;
- }
- }
- },
- getContext: function () {
- var context = this.context;
- if (!context) { context = {}; }
- context['minValue'] = this.minValue;
- context['maxValue'] = this.maxValue;
- context['value'] = (this.value == 0 ? "0" : this.value);
- if (this.progressVar) {
- context[this.progressVar] = context['value'];
- }
- return context;
- },
- renderLabel: function (markup, context) {
- if (!markup || this.state != "progressState") {
- return;
- }
- if (!context) {
- context = this.getContext();
- }
- var html = markup.invoke('getContent', context).join('');
- $(this.id + ":remain").innerHTML = $(this.id +
":complete").innerHTML = html;
- },
- interpolate: function (placeholders, context) {
- for(var k in context) {
- var v = context[k];
- var regexp = new RegExp("\\{" + k + "\\}", "g");
- placeholders = placeholders.replace(regexp, v);
- }
- return placeholders;
- },
- setLabel: function (str) {
- if (this.state != "progressState") { return; }
- var d = $(this.id + ":remain");
- if (!d) { return; }
- var lbl = this.interpolate(str, this.getContext());
- if (lbl)
- d.innerHTML = $(this.id + ":complete").innerHTML = lbl;
- this.markup = null;
- },
- getMode: function () {
- return this.mode;
- },
- getMaxValue: function () {
- return this.maxValue;
- },
- getMinValue: function () {
- return this.minValue;
- },
- isAjaxMode: function () {
- return (this.getMode() == "ajax");
- },
- setValue: function (val) {
- this.value = val;
- var p = val;
- val = "" + val;
- if (val != null) {
- if (val.indexOf("%") < 0)
- val = val + "%";
- }
-
- if (!this.isAjaxMode()) {
- if ( parseFloat(p) <= parseFloat(this.getMinValue())) {
- this.switchState("initialState");
- }else if ( parseFloat(p) >= parseFloat(this.getMaxValue())) {
- this.switchState("completeState");
- }else {
- this.switchState("progressState");
- }
- }
- if (!this.isAjaxMode() && this.state != "progressState") return;
-
- if (this.markup) {
- this.renderLabel(this.markup, this.getContext());
- } else {
- //this.setLabel("{value}%");
- }
-
- var d = $(this.id + ":upload");
- if (d != null) d.style.width = val;
-
- },
- enable: function (ev) {
- if (!this.isAjaxMode()) {
- this.switchState("progressState");
- this.setValue(0);
- }else {
- this.disable();
- this.poll();
- }
- },
- disable: function () {
- A4J.AJAX.StopPoll(this.id);
- },
- finish: function () {
- //this.switchMode("completed");
- },
- hideAll: function () {
- Element.hide($(this.id + ":progressState"));
- Element.hide($(this.id + ":completeState"));
- Element.hide($(this.id + ":initialState"));
- },
- switchState: function (state) {
- this.state = state;
- this.hideAll();
- Element.show($(this.id + ":" + state));
- },
- renderState: function (state) {
- this.state = state;
- Element.show($(this.id + ":" + state));
- },
- forceState: function (state, oncomplete) {
- var options = {};
- options['parameters'] = {};
- options['parameters'][this.id] = this.id;
- options['parameters']['forcePercent'] = state;
- options['actionUrl'] = this.options.actionUrl;
- if (oncomplete) {
- options['oncomplete'] = oncomplete;
- }
- A4J.AJAX.SubmitRequest(this.containerId, this.formId, null, options);
- }
- });
Copied:
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
(from rev 5970,
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js)
===================================================================
---
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
(rev 0)
+++
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-09
02:00:25 UTC (rev 5971)
@@ -0,0 +1,234 @@
+ProgressBar = {};
+ProgressBar = Class.create();
+Object.extend(ProgressBar.prototype, {
+ initialize: function(id, containerId, formId, mode, minValue, maxValue, context,
markup, options, progressVar, state, value) {
+ this.id = id;
+
+ this.containerId = containerId;
+ this.formId = formId;
+ this.mode = mode;
+ this.state = state;
+ this.minValue = minValue;
+ this.maxValue = maxValue;
+ this.value = value;
+
+ this.context = context;
+ this.markup = markup;
+ this.options = options || {};
+
+ this.options.onbeforedomupdate = function(request, event, data) {
+ this.onComplete(data);
+ }.bind(this);
+
+ this.progressVar = progressVar;
+ $(this.id).component = this;
+ },
+
+ getValue: function () {
+ return this.value;
+ },
+ onComplete: function (data) {
+ if (!$(this.id)) { return; }
+ if (data) {
+ this.value = data['percent'];
+ if (this.state == "progressState") {
+ this.updateComponent(data);
+ this.renderLabel(data['markup'], data['context']);
+ if (this.value >= this.getMaxValue()) {
+ this.forceState("complete",null);
+ return;
+ }
+ } else if (this.state == "initialState" && this.value >=
this.getMinValue()) {
+ this.state = "progressState";
+ this.forceState("progressState", function () { this.poll() }.bind(this));
+ return;
+ }
+ this.poll();
+ }
+
+ },
+ poll: function () {
+ A4J.AJAX.Poll(this.containerId, this.formId, this.options);
+ },
+ interpolate: function (placeholders) {
+ for(var k in this.context) {
+ var v = this.context[k];
+ var regexp = new RegExp("\\{" + k + "\\}", "g");
+ placeholders = placeholders.replace(regexp, v);
+ }
+ return placeholders;
+ },
+ updateComponent: function (data) {
+ this.updateStyle(data['style']);
+ this.setValue(data['percent']);
+ if (!data['enabled']) { this.disable(); }
+ this.updateClassName($(this.id + ":complete"),
data['completeClass']);
+ this.updateClassName($(this.id + ":remain"), data['remainClass']);
+ this.updateClassName($(this.id), data['styleClass']);
+
+ if (this.options.pollinterval != data['interval']) {
+ this.options.pollinterval = data['interval'];
+ }
+ },
+ updateStyle: function (style) {
+ if (!style) { return; }
+ var d = $(this.id);
+ if (d.style)
+ if (d.style.cssText != style) {
+ d.style.cssText = style;
+ d = $(this.id + ":remain");
+ if (d) d.style.cssText = style;
+ d = $(this.id + ":complete");
+ if (d) d.style.cssText = style;
+ d = $(this.id + ":upload");
+ if (d) d.style.cssText = style;
+ }
+ },
+ updateClassName: function (o, newName) {
+ if (!newName) return;
+ if (o && o.className) {
+ if (o.className.indexOf(newName) < 0){
+ o.className = o.className + " " + newName;
+ }
+ }
+ },
+ getContext: function () {
+ var context = this.context;
+ if (!context) { context = {}; }
+ context['minValue'] = this.minValue;
+ context['maxValue'] = this.maxValue;
+ context['value'] = (this.value == 0 ? "0" : this.value);
+ if (this.progressVar) {
+ context[this.progressVar] = context['value'];
+ }
+ return context;
+ },
+ renderLabel: function (markup, context) {
+ if (!markup || this.state != "progressState") {
+ return;
+ }
+ if (!context) {
+ context = this.getContext();
+ }
+ var html = markup.invoke('getContent', context).join('');
+ $(this.id + ":remain").innerHTML = $(this.id +
":complete").innerHTML = html;
+ },
+ interpolate: function (placeholders, context) {
+ for(var k in context) {
+ var v = context[k];
+ var regexp = new RegExp("\\{" + k + "\\}", "g");
+ placeholders = placeholders.replace(regexp, v);
+ }
+ return placeholders;
+ },
+ setLabel: function (arg, params) {
+ var str;
+
+ if (params && params.label) {
+ //componentControl
+ str = params.label;
+ } else {
+ str = arg;
+ }
+
+ if (this.state != "progressState") { return; }
+ var d = $(this.id + ":remain");
+ if (!d) { return; }
+ var lbl = this.interpolate(str, this.getContext());
+ if (lbl)
+ d.innerHTML = $(this.id + ":complete").innerHTML = lbl;
+ this.markup = null;
+ },
+ getMode: function () {
+ return this.mode;
+ },
+ getMaxValue: function () {
+ return this.maxValue;
+ },
+ getMinValue: function () {
+ return this.minValue;
+ },
+
+ isAjaxMode: function () {
+ return (this.getMode() == "ajax");
+ },
+ setValue: function (arg, params) {
+ var val;
+
+ if (params && params.value) {
+ //componentControl
+ val = params.value;
+ } else {
+ val = arg;
+ }
+
+ this.value = val;
+ var p = val;
+ val = "" + val;
+ if (val != null) {
+ if (val.indexOf("%") < 0)
+ val = val + "%";
+ }
+
+ if (!this.isAjaxMode()) {
+ if ( parseFloat(p) <= parseFloat(this.getMinValue())) {
+ this.switchState("initialState");
+ }else if ( parseFloat(p) >= parseFloat(this.getMaxValue())) {
+ this.switchState("completeState");
+ }else {
+ this.switchState("progressState");
+ }
+ }
+ if (!this.isAjaxMode() && this.state != "progressState") return;
+
+ if (this.markup) {
+ this.renderLabel(this.markup, this.getContext());
+ } else {
+ //this.setLabel("{value}%");
+ }
+
+ var d = $(this.id + ":upload");
+ if (d != null) d.style.width = val;
+
+ },
+ enable: function (ev) {
+ if (!this.isAjaxMode()) {
+ this.switchState("progressState");
+ this.setValue(0);
+ }else {
+ this.disable();
+ this.poll();
+ }
+ },
+ disable: function () {
+ A4J.AJAX.StopPoll(this.id);
+ },
+ finish: function () {
+ //this.switchMode("completed");
+ },
+ hideAll: function () {
+ Element.hide($(this.id + ":progressState"));
+ Element.hide($(this.id + ":completeState"));
+ Element.hide($(this.id + ":initialState"));
+ },
+ switchState: function (state) {
+ this.state = state;
+ this.hideAll();
+ Element.show($(this.id + ":" + state));
+ },
+ renderState: function (state) {
+ this.state = state;
+ Element.show($(this.id + ":" + state));
+ },
+ forceState: function (state, oncomplete) {
+ var options = {};
+ options['parameters'] = {};
+ options['parameters'][this.id] = this.id;
+ options['parameters']['forcePercent'] = state;
+ options['actionUrl'] = this.options.actionUrl;
+ if (oncomplete) {
+ options['oncomplete'] = oncomplete;
+ }
+ A4J.AJAX.SubmitRequest(this.containerId, this.formId, null, options);
+ }
+ });