[richfaces-svn-commits] JBoss Rich Faces SVN: r5875 - in trunk/sandbox/ui/progressBAR/src: main/java/org/richfaces/renderkit and 3 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Feb 6 11:05:07 EST 2008


Author: andrei_exadel
Date: 2008-02-06 11:05:07 -0500 (Wed, 06 Feb 2008)
New Revision: 5875

Modified:
   trunk/sandbox/ui/progressBAR/src/main/config/component/progressBar.xml
   trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
   trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss
   trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
   trunk/sandbox/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java
Log:
refactoring according to changes made in component markup

Modified: trunk/sandbox/ui/progressBAR/src/main/config/component/progressBar.xml
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/config/component/progressBar.xml	2008-02-06 16:04:55 UTC (rev 5874)
+++ trunk/sandbox/ui/progressBAR/src/main/config/component/progressBar.xml	2008-02-06 16:05:07 UTC (rev 5875)
@@ -65,13 +65,11 @@
 			<name>completeClass</name>
 			<classname>java.lang.String</classname>
 			<description>CSS class that defines style for progress line rendering</description>
-			<defaultvalue>"rich-progress-bar-completed"</defaultvalue>
 		</property>
 		<property>
 			<name>remainClass</name>
 			<classname>java.lang.String</classname>
 			<description>CSS class that defines style for remained part of progress bar</description>
-			<defaultvalue>"rich-progress-bar-remained"</defaultvalue>
 		</property>
 		<property>
 			<name>initialClass</name>

Modified: trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java	2008-02-06 16:04:55 UTC (rev 5874)
+++ trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java	2008-02-06 16:05:07 UTC (rev 5875)
@@ -354,7 +354,7 @@
 	getUtils().writeAttribute(
 		writer,
 		"class",
-		"rich-progress-bar "
+		"rich-progress-bar-block rich-progress-bar-width rich-progress-bar-shell"
 			+ (styleClass != null ? styleClass : ""));
 	getUtils().writeAttribute(writer, "id", clientId);
 	getUtils().writeAttribute(writer, "style",
@@ -394,7 +394,7 @@
 	// <div class='remainClass'  id='clientId:remain'  style='style'></div>
 	writer.startElement("div", component);
 	getUtils().writeAttribute(writer, "class",
-		remainClass + " rich-progress-bar-base");
+		"rich-progress-bar-width rich-progress-bar-remained rich-progress-bar-padding " + remainClass);
 	getUtils().writeAttribute(writer, "id", clientId + ":remain");
 	getUtils().writeAttribute(writer, "style", style);
 	writer.endElement("div");
@@ -410,7 +410,7 @@
 	// <div class='completeClass' id='clientId:complete' style='style'></div>
 	writer.startElement("div", component);
 	getUtils().writeAttribute(writer, "class",
-		completeClass + " rich-progress-bar-base");
+		"rich-progress-bar-height rich-progress-bar-width rich-progress-bar-completed rich-progress-bar-padding " + completeClass);
 	getUtils().writeAttribute(writer, "id", clientId + ":complete");
 	getUtils().writeAttribute(writer, "style", style);
 	writer.endElement("div");

Modified: trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss	2008-02-06 16:04:55 UTC (rev 5874)
+++ trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss	2008-02-06 16:05:07 UTC (rev 5875)
@@ -6,19 +6,27 @@
    	component="org.richfaces.component.UIProgressBar">	
 
 	<f:verbatim>
+
+body{margin : 20px}
+*{font-family : verdana; font-size : 11px}
+	
+.rich-progress-bar-height{height : 13px;}
+.rich-progress-bar-width{width : 200px}	
+.rich-progress-bar-block{white-space : nowrap;}		
+.rich-progress-bar-uploaded{overflow : hidden; position : absolute; top : 0px; left : 0px;}
+.rich-progress-bar-shell{position : relative; margin-bottom : 2px; border : 1px solid;}
+.rich-progress-bar-remained{text-align : center; font-weight : bold; position : relative;}
+.rich-progress-bar-completed{text-align : center; font-weight : bold; background-repeat : repeat-x;}
+.rich-progress-bar-padding{padding: 0px}
 		
-		
-.rich-progress-bar-uploaded{overflow : hidden; position : absolute; border-style: solid; border-width: 1px 0px 1px 1px; height : 16px;}
-.rich-progress-bar{position : relative; margin-bottom : 2px; height : 16px; width : 200px; white-space: nowrap;}
-.rich-progress-bar-base{text-align : center; position : absolute; height : 16px; width : 200px; font-weight : bold;}
-.rich-progress-bar-remained{border : 1px solid; color : #000000;}
-.rich-progress-bar-completed{background-repeat : repeat-x; repeat-y;}
-		
 	</f:verbatim>
 	
+	<u:selector name=".rich-progress-bar-shell">
+    <u:style name="border-color" skin="panelBorderColor" />
+	</u:selector>
+	
 	<u:selector name=".rich-progress-bar-remained">
     <u:style name="background-color" skin="controlBackgroundColor" />
-    <u:style name="border-color" skin="panelBorderColor" />
     <u:style name="text-color" skin="controlTextColor" />
 	</u:selector>
 	

Modified: trunk/sandbox/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-06 16:04:55 UTC (rev 5874)
+++ trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js	2008-02-06 16:05:07 UTC (rev 5875)
@@ -57,9 +57,9 @@
 		this.updateStyle(data['style']);
 		this.setValue(data['percent']);
 		if (!data['enabled']) { this.disable(); }
-		this.updateClassName($(this.id + ":complete"), data['completeClass'], "rich-progress-bar-base");
-		this.updateClassName($(this.id + ":remain"), data['remainClass'], "rich-progress-bar-base");
-		this.updateClassName($(this.id), data['styleClass'], "rich-progress-bar");
+		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'];
@@ -79,10 +79,11 @@
 			if (d) d.style.cssText = style;
 		}
 	},
-	updateClassName: function (o, newName, defaultClass) {
+	updateClassName: function (o, newName) {
+	if (!newName) return;
 		if (o && o.className) {
 			if (o.className.indexOf(newName) < 0){
-				o.className = newName + " "+ defaultClass;
+				o.className = o.className + " " + newName;
 			}
 		}
 	},

Modified: trunk/sandbox/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java	2008-02-06 16:04:55 UTC (rev 5874)
+++ trunk/sandbox/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java	2008-02-06 16:05:07 UTC (rev 5875)
@@ -96,7 +96,7 @@
 	assertTrue(classAttr.contains("rich-progress-bar"));
 	
 	HtmlElement node = (HtmlElement)progress.getHtmlElementById(clientId + ":remain");
-	assertTrue(node.getAttributeValue("class").contains("rich-progress-bar-base"));
+	assertTrue(node.getAttributeValue("class").indexOf("rich-progress-bar-remained") != -1);
 	
 	node = (HtmlElement) progress.getLastChild();
 	assertTrue("span".equalsIgnoreCase(node.getTagName()));




More information about the richfaces-svn-commits mailing list