[richfaces-svn-commits] JBoss Rich Faces SVN: r2751 - in trunk/ui/datascroller/src/main: java/org/richfaces/component and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Sep 5 04:36:26 EDT 2007


Author: a.izobov
Date: 2007-09-05 04:36:26 -0400 (Wed, 05 Sep 2007)
New Revision: 2751

Modified:
   trunk/ui/datascroller/src/main/config/component/datascroller.xml
   trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
   trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-797

Modified: trunk/ui/datascroller/src/main/config/component/datascroller.xml
===================================================================
--- trunk/ui/datascroller/src/main/config/component/datascroller.xml	2007-09-05 08:03:14 UTC (rev 2750)
+++ trunk/ui/datascroller/src/main/config/component/datascroller.xml	2007-09-05 08:36:26 UTC (rev 2751)
@@ -102,12 +102,24 @@
 			</description>
 		</property>
 		<property>
+			<name>inactiveStyle</name>
+			<classname>java.lang.String</classname>
+			<description>Corresponds to the HTML style attribute for the inactive cell on scroller
+			</description>
+		</property>
+		<property>
 			<name>selectedStyleClass</name>
 			<classname>java.lang.String</classname>
 			<description>Corresponds to the HTML class attribute for the selected cell on scroller
 			</description>			
 		</property>
 		<property>
+			<name>inactiveStyleClass</name>
+			<classname>java.lang.String</classname>
+			<description>Corresponds to the HTML class attribute for the inactive cell on scroller
+			</description>			
+		</property>
+		<property>
 			<name>tableStyleClass</name>
 			<classname>java.lang.String</classname>
 			<description>Space-separated list of CSS style class(es) that are be applied to outside table of this component

Modified: trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java	2007-09-05 08:03:14 UTC (rev 2750)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java	2007-09-05 08:36:26 UTC (rev 2751)
@@ -175,6 +175,13 @@
 
     public abstract void setStepControls(String stepControls);
 
+    public abstract String getInactiveStyleClass();
+
+    public abstract String getInactiveStyle();
+
+    public abstract void setInactiveStyleClass(String inactiveStyleClass);
+
+    public abstract void setInactiveStyle(String inactiveStyle);
     /**
      * Finds the dataTable which id is mapped to the "for" property
      *

Modified: trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java	2007-09-05 08:03:14 UTC (rev 2750)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java	2007-09-05 08:36:26 UTC (rev 2751)
@@ -189,43 +189,33 @@
         }
 
         for (int i = start, size = start + pages; i < size; i++) {
-            //String styleClass;
-            //String style;
 
             boolean isCurrentPage = (i + 1 == currentPage);
-            /*
-                  if (isCurrentPage) {
-                      styleClass = scroller.getSelectedStyleClass();
-                      style = scroller.getSelectedStyle();
-                  }
-                  else {
-                      styleClass = scroller.getStyleClass();
-                      style = scroller.getStyle();
-                  }
+            String styleClass;
+            String style;
+			if (isCurrentPage) {
+			    styleClass = scroller.getSelectedStyleClass();
+			    style = scroller.getSelectedStyle();
+			} else {
+				styleClass = scroller.getInactiveStyleClass();
+			    style = scroller.getInactiveStyle();
+			}
+			if (styleClass==null){
+			    styleClass="";
+			}
 
-                  if (style==null){
-                      style="";
-                  }
-                  if (styleClass==null){
-                      styleClass="";
-                  }
-                */
-
             out.startElement("td", component);
+            
             if (isCurrentPage) {
-                //out.writeAttribute("class", "dr-dscr-act rich-datascr-act "+scroller.getStyleClass(), null);
-                out.writeAttribute("class", "dr-dscr-act rich-datascr-act",
-                        null);
-                out.writeAttribute("style", "" + scroller.getSelectedStyle(),
-                        null);
+                out.writeAttribute("class", "dr-dscr-act rich-datascr-act "+
+                		styleClass, null);
             } else {
-                //out.writeAttribute("class", "dr-dscr-inact rich-datascr-inact "+scroller.getStyleClass(), null);
-                out.writeAttribute("class", "dr-dscr-inact rich-datascr-inact",
-                        null);
-                //out.writeAttribute("style", ""+scroller.getStyle(), null);
+                out.writeAttribute("class", "dr-dscr-inact rich-datascr-inact "+
+                		styleClass, null);
                 out.writeAttribute("onclick", getOnClick(context, component,
                         Integer.toString(i + 1)), null);
             }
+            if (null != style) out.writeAttribute("style", style, null);
             out.writeText(Integer.toString(i + 1), null);
             //renderChild(context, link);
             out.endElement("td");




More information about the richfaces-svn-commits mailing list