]> source.dussan.org Git - vaadin-framework.git/commitdiff
cleaning code style
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 1 Sep 2009 07:57:05 +0000 (07:57 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 1 Sep 2009 07:57:05 +0000 (07:57 +0000)
svn changeset:8602/svn branch:6.1

src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java

index f97cd451c69a308d6be9974aa90ac834c55cf4f7..b89eb94c97f8fc6eda9cae90a1fba4b3a86e618a 100644 (file)
@@ -286,8 +286,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
             if (isAttached()) {
                 sizeInit();
             }
-
-            restoreRowVisibility();
+            scrollBody.restoreRowVisibility();
         }
 
         if (selectMode == Table.SELECT_MODE_NONE) {
@@ -302,18 +301,6 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
         headerChangedDuringUpdate = false;
     }
 
-    private void restoreRowVisibility() {
-        // Restore row visibility which is set to "none" when the row is
-        // rendered.
-        Element tableBodyElement = scrollBody.tBodyElement.cast();
-        final int rows = DOM.getChildCount(tableBodyElement);
-        for (int row = 0; row < rows; row++) {
-            final Element cell = DOM.getChild(tableBodyElement, row).cast();
-            cell.getStyle().setProperty("visibility", "");
-        }
-
-    }
-
     private void setCacheRate(double d) {
         if (cache_rate != d) {
             cache_rate = d;
@@ -427,7 +414,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
         }
         scrollBody.fixSpacers();
 
-        restoreRowVisibility();
+        scrollBody.restoreRowVisibility();
     }
 
     /**
@@ -2178,6 +2165,16 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
 
         }
 
+        /**
+         * Restore row visibility which is set to "none" when the row is
+         * rendered (due a performance optimization).
+         */
+        private void restoreRowVisibility() {
+            for (Widget row : renderedRows) {
+                row.getElement().getStyle().setProperty("visibility", "");
+            }
+        }
+
         public class VScrollTableRow extends Panel implements ActionOwner,
                 Container {