Author: ppitonak(a)redhat.com
Date: 2010-12-07 12:15:38 -0500 (Tue, 07 Dec 2010)
New Revision: 20438
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/static.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichProgressBarBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/ajaxMode.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/clientMode.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/list.xhtml
Log:
https://jira.jboss.org/browse/RFPL-864
* samples for progress bar fixed
* new sample with static progress bar added
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichProgressBarBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichProgressBarBean.java 2010-12-07
15:33:15 UTC (rev 20437)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichProgressBarBean.java 2010-12-07
17:15:38 UTC (rev 20438)
@@ -48,6 +48,9 @@
private Attributes attributes;
private boolean buttonRendered = true;
private Long startTime;
+ private boolean initialFacetRendered = true;
+ private boolean finishFacetRendered = true;
+ private boolean childrenRendered = false;
/**
* Initializes the managed bean.
@@ -60,9 +63,10 @@
attributes = Attributes.getUIComponentAttributes(UIProgressBar.class,
getClass());
attributes.setAttribute("maxValue", 100);
- attributes.setAttribute("minValue", -1);
+ attributes.setAttribute("minValue", 0);
attributes.setAttribute("interval", 1000);
attributes.setAttribute("rendered", true);
+ attributes.setAttribute("value", -1);
// attributes tested in another way
attributes.remove("mode");
@@ -77,8 +81,8 @@
}
public String startProcess() {
- attributes.get("enabled").setValue(true);
- setButtonRendered(false);
+ attributes.setAttribute("enabled", true);
+ buttonRendered = false;
setStartTime(new Date().getTime());
return null;
}
@@ -87,16 +91,16 @@
if (Boolean.TRUE.equals(attributes.get("enabled").getValue())) {
Long current = (new Date().getTime() - startTime) / 1000;
if (current > 100) {
- setButtonRendered(true);
+ buttonRendered = true;
} else if (current.equals(0L)) {
- return new Long(1);
+ return 1L;
}
return (new Date().getTime() - startTime) / 1000;
}
if (startTime == null) {
- return Long.valueOf(-1);
+ return -1L;
} else {
- return Long.valueOf(101);
+ return 101L;
}
}
@@ -115,4 +119,28 @@
public void setButtonRendered(boolean buttonRendered) {
this.buttonRendered = buttonRendered;
}
+
+ public boolean isFinishFacetRendered() {
+ return finishFacetRendered;
+ }
+
+ public void setFinishFacetRendered(boolean finishFacetRendered) {
+ this.finishFacetRendered = finishFacetRendered;
+ }
+
+ public boolean isInitialFacetRendered() {
+ return initialFacetRendered;
+ }
+
+ public void setInitialFacetRendered(boolean initialFacetRendered) {
+ this.initialFacetRendered = initialFacetRendered;
+ }
+
+ public boolean isChildrenRendered() {
+ return childrenRendered;
+ }
+
+ public void setChildrenRendered(boolean childrenRendered) {
+ this.childrenRendered = childrenRendered;
+ }
}
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/ajaxMode.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/ajaxMode.xhtml 2010-12-07
15:33:15 UTC (rev 20437)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/ajaxMode.xhtml 2010-12-07
17:15:38 UTC (rev 20438)
@@ -41,7 +41,6 @@
<ui:define name="component">
<rich:progressBar id="progressBar"
-
comleteClass="#{richProgressBarBean.attributes['completeClass'].value}"
data="#{richProgressBarBean.attributes['data'].value}"
enabled="#{richProgressBarBean.attributes['enabled'].value}"
finishClass="#{richProgressBarBean.attributes['finishClass'].value}"
@@ -56,6 +55,7 @@
onclick="#{richProgressBarBean.attributes['onclick'].value}"
oncomplete="#{richProgressBarBean.attributes['oncomplete'].value}"
ondblclick="#{richProgressBarBean.attributes['ondblclick'].value}"
+
onfinish="#{richProgressBarBean.attributes['onfinish'].value}"
onmousedown="#{richProgressBarBean.attributes['onmousedown'].value}"
onmousemove="#{richProgressBarBean.attributes['onmousemove'].value}"
onmouseout="#{richProgressBarBean.attributes['onmouseout'].value}"
@@ -63,9 +63,11 @@
onmouseup="#{richProgressBarBean.attributes['onmouseup'].value}"
onsubmit="#{richProgressBarBean.attributes['onsubmit'].value}"
parameters="#{richProgressBarBean.attributes['parameters'].value}"
-
reRenderAfterComplete="#{richProgressBarBean.attributes['reRenderAfterComplete'].value}"
-
remainClass="#{richProgressBarBean.attributes['remainClass'].value}"
+
progressClass="#{richProgressBarBean.attributes['progressClass'].value}"
+
remainingClass="#{richProgressBarBean.attributes['remainingClass'].value}"
rendered="#{richProgressBarBean.attributes['rendered'].value}"
+
style="#{richProgressBarBean.attributes['style'].value}"
+
styleClass="#{richProgressBarBean.attributes['styleClass'].value}"
value="#{richProgressBarBean.currentValue}"
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/clientMode.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/clientMode.xhtml 2010-12-07
15:33:15 UTC (rev 20437)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/clientMode.xhtml 2010-12-07
17:15:38 UTC (rev 20438)
@@ -63,7 +63,6 @@
</script>
<rich:progressBar id="progressBar"
-
comleteClass="#{richProgressBarBean.attributes['completeClass'].value}"
data="#{richProgressBarBean.attributes['data'].value}"
enabled="#{richProgressBarBean.attributes['enabled'].value}"
finishClass="#{richProgressBarBean.attributes['finishClass'].value}"
@@ -76,6 +75,7 @@
mode="client"
onbeforedomupdate="#{richProgressBarBean.attributes['onbeforedomupdate'].value}"
onclick="#{richProgressBarBean.attributes['onclick'].value}"
+
onfinish="#{richProgressBarBean.attributes['onfinish'].value}"
oncomplete="#{richProgressBarBean.attributes['oncomplete'].value}"
ondblclick="#{richProgressBarBean.attributes['ondblclick'].value}"
onmousedown="#{richProgressBarBean.attributes['onmousedown'].value}"
@@ -85,9 +85,11 @@
onmouseup="#{richProgressBarBean.attributes['onmouseup'].value}"
onsubmit="#{richProgressBarBean.attributes['onsubmit'].value}"
parameters="#{richProgressBarBean.attributes['parameters'].value}"
-
reRenderAfterComplete="#{richProgressBarBean.attributes['reRenderAfterComplete'].value}"
-
remainClass="#{richProgressBarBean.attributes['remainClass'].value}"
+
progressClass="#{richProgressBarBean.attributes['progressClass'].value}"
+
remainingClass="#{richProgressBarBean.attributes['remainingClass'].value}"
rendered="#{richProgressBarBean.attributes['rendered'].value}"
+
style="#{richProgressBarBean.attributes['style'].value}"
+
styleClass="#{richProgressBarBean.attributes['styleClass'].value}"
value="#{richProgressBarBean.currentValue}"
<f:facet name="initial">
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/list.xhtml 2010-12-07
15:33:15 UTC (rev 20437)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/list.xhtml 2010-12-07
17:15:38 UTC (rev 20438)
@@ -32,12 +32,16 @@
<ui:define name="links">
<metamer:testPageLink id="ajaxMode" outcome="ajaxMode"
value="Ajax Mode">
- Simple page containing <b>rich:progressBar</b> in ajax mode
and input boxes for all its attributes.
+ Simple page containing a <b>rich:progressBar</b> in ajax mode
and input boxes for all its attributes.
</metamer:testPageLink>
<metamer:testPageLink id="clientMode"
outcome="clientMode" value="Client Mode">
- Simple page containing <b>rich:progressBar</b> in client mode
and input boxes for all its attributes.
+ Simple page containing a <b>rich:progressBar</b> in client
mode and input boxes for all its attributes.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="static" outcome="static"
value="Static">
+ Simple page containing a static <b>rich:progressBar</b>. Can
be used for testing styling attributes, min value, max value etc.
+ </metamer:testPageLink>
</ui:define>
</ui:composition>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/static.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/static.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richProgressBar/static.xhtml 2010-12-07
17:15:38 UTC (rev 20438)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <h:panelGrid id="settingsPanel" columns="2">
+ Children rendered: <h:selectBooleanCheckbox
value="#{richProgressBarBean.childrenRendered}" onclick="submit()"
/>
+ 'initial' facet rendered: <h:selectBooleanCheckbox
value="#{richProgressBarBean.initialFacetRendered}" onclick="submit()"
/>
+ 'finish' facet rendered: <h:selectBooleanCheckbox
value="#{richProgressBarBean.finishFacetRendered}" onclick="submit()"
/>
+ </h:panelGrid>
+
+ <rich:progressBar id="progressBar"
+
data="#{richProgressBarBean.attributes['data'].value}"
+
enabled="#{richProgressBarBean.attributes['enabled'].value}"
+
finishClass="#{richProgressBarBean.attributes['finishClass'].value}"
+
focus="#{richProgressBarBean.attributes['focus'].value}"
+
initialClass="#{richProgressBarBean.attributes['initialClass'].value}"
+
interval="#{richProgressBarBean.attributes['interval'].value}"
+
label="#{richProgressBarBean.attributes['label'].value}"
+
maxValue="#{richProgressBarBean.attributes['maxValue'].value}"
+
minValue="#{richProgressBarBean.attributes['minValue'].value}"
+ mode="client"
+
onbeforedomupdate="#{richProgressBarBean.attributes['onbeforedomupdate'].value}"
+
onclick="#{richProgressBarBean.attributes['onclick'].value}"
+
oncomplete="#{richProgressBarBean.attributes['oncomplete'].value}"
+
ondblclick="#{richProgressBarBean.attributes['ondblclick'].value}"
+
onfinish="#{richProgressBarBean.attributes['onfinish'].value}"
+
onmousedown="#{richProgressBarBean.attributes['onmousedown'].value}"
+
onmousemove="#{richProgressBarBean.attributes['onmousemove'].value}"
+
onmouseout="#{richProgressBarBean.attributes['onmouseout'].value}"
+
onmouseover="#{richProgressBarBean.attributes['onmouseover'].value}"
+
onmouseup="#{richProgressBarBean.attributes['onmouseup'].value}"
+
onsubmit="#{richProgressBarBean.attributes['onsubmit'].value}"
+
parameters="#{richProgressBarBean.attributes['parameters'].value}"
+
progressClass="#{richProgressBarBean.attributes['progressClass'].value}"
+
remainingClass="#{richProgressBarBean.attributes['remainingClass'].value}"
+
rendered="#{richProgressBarBean.attributes['rendered'].value}"
+
style="#{richProgressBarBean.attributes['style'].value}"
+
styleClass="#{richProgressBarBean.attributes['styleClass'].value}"
+
value="#{richProgressBarBean.attributes['value'].value}"
+ >
+
+ <h:outputText value="child + "
rendered="#{richProgressBarBean.childrenRendered}" />
+
+ <f:facet name="initial">
+ <h:panelGroup
rendered="#{richProgressBarBean.initialFacetRendered}">
+ <h:outputText id="initialOutput"
value="Initial" />
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="finish">
+ <h:panelGroup
rendered="#{richProgressBarBean.finishFacetRendered}">
+ <h:outputText id="completeOutput"
value="Complete"/>
+ </h:panelGroup>
+ </f:facet>
+ </rich:progressBar>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richProgressBarBean.attributes}"
id="attributes" render="log"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file