]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed Table to change child element style names when primary stylename is changed...
authorJohn Ahlroos <john@vaadin.com>
Tue, 2 Oct 2012 06:17:27 +0000 (09:17 +0300)
committerJohn Ahlroos <john@vaadin.com>
Tue, 2 Oct 2012 06:17:27 +0000 (09:17 +0300)
client/src/com/vaadin/client/ui/table/VScrollTable.java

index fe0530cff18fd6dba12bbc73ecd199acc8edec4d..2955a99189622a0194225c9905ff83f5f673fb93 100644 (file)
@@ -555,6 +555,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
 
     @Override
     public void setStyleName(String style) {
+        updateStyleNames(style, false);
+    }
+
+    @Override
+    public void setStylePrimaryName(String style) {
+        updateStyleNames(style, true);
+    }
+
+    private void updateStyleNames(String newStyle, boolean isPrimary) {
         scrollBodyPanel
                 .removeStyleName(getStylePrimaryName() + "-body-wrapper");
         scrollBodyPanel.removeStyleName(getStylePrimaryName() + "-body");
@@ -564,7 +573,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
                     + "-body-noselection");
         }
 
-        super.setStyleName(style);
+        if (isPrimary) {
+            super.setStylePrimaryName(newStyle);
+        } else {
+            super.setStyleName(newStyle);
+        }
 
         scrollBodyPanel.addStyleName(getStylePrimaryName() + "-body-wrapper");
         scrollBodyPanel.addStyleName(getStylePrimaryName() + "-body");
@@ -577,7 +590,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
         }
     }
 
-
     public void init(ApplicationConnection client) {
         this.client = client;
         // Add a handler to clear saved context menu details when the menu