]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix issues caused by 6.8 merge: prevent NPE with componentStyles; ensure split positi...
authorJohannes Dahlström <johannesd@vaadin.com>
Tue, 19 Jun 2012 10:42:11 +0000 (13:42 +0300)
committerJohannes Dahlström <johannesd@vaadin.com>
Tue, 19 Jun 2012 10:42:11 +0000 (13:42 +0300)
src/com/vaadin/terminal/gwt/client/ui/splitpanel/AbstractSplitPanelConnector.java
src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java
src/com/vaadin/ui/AbstractSplitPanel.java

index b5cedc42d455a5c7b60012fc03665d52df34c024..892ce0c35f272538df3c9f29f9e19ca45aa7fa41 100644 (file)
@@ -144,6 +144,7 @@ public abstract class AbstractSplitPanelConnector extends
 
         getLayoutManager().setNeedsLayout(this);
 
+        getWidget().ensureScrollable();
     }
 
     @Override
index e112fac304e8689f7e362a771ef29230c8fc20c6..988ddf02caa4dd5b3bbc5dac1901ae5c0b5ded90 100644 (file)
@@ -4,6 +4,7 @@
 
 package com.vaadin.terminal.gwt.client.ui.splitpanel;
 
+import java.util.Collections;
 import java.util.List;
 
 import com.google.gwt.dom.client.Node;
@@ -77,7 +78,7 @@ public class VAbstractSplitPanel extends ComplexPanel {
 
     private boolean positionReversed = false;
 
-    List<String> componentStyleNames;
+    List<String> componentStyleNames = Collections.emptyList();
 
     private Element draggingCurtain;
 
@@ -760,4 +761,11 @@ public class VAbstractSplitPanel extends ComplexPanel {
         return enabled;
     }
 
+    /**
+     * Ensures the panels are still scrollable eg. after style sheet changes
+     */
+    void ensureScrollable() {
+        touchScrollHandler.setElements(firstContainer, secondContainer);
+    }
+
 }
index 6a7099ba9d66b10f8321cd166b6bcd2dc27abc4e..45656901bdd8883c54fae13f58062eaa39a5b28e 100644 (file)
@@ -33,8 +33,8 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer {
 
     // TODO use Unit in AbstractSplitPanelState and remove these
     private Unit posUnit;
-    private Unit posMinUnit = Unit.PERCENTAGE;
-    private Unit posMaxUnit = Unit.PERCENTAGE;
+    private Unit posMinUnit;
+    private Unit posMaxUnit;
 
     private AbstractSplitPanelRpc rpc = new AbstractSplitPanelRpc() {
 
@@ -53,6 +53,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer {
     public AbstractSplitPanel() {
         registerRpc(rpc);
         setSplitPosition(50, Unit.PERCENTAGE, false);
+        setSplitPositionLimits(0, Unit.PERCENTAGE, 100, Unit.PERCENTAGE);
     }
 
     /**
@@ -430,11 +431,11 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer {
         SplitterState state = getSplitterState();
 
         state.setMinPosition(minPos);
-        state.setMinPositionUnit("" + minPosUnit);
+        state.setMinPositionUnit(minPosUnit.getSymbol());
         posMinUnit = minPosUnit;
 
         state.setMaxPosition(maxPos);
-        state.setMaxPositionUnit("" + maxPosUnit);
+        state.setMaxPositionUnit(maxPosUnit.getSymbol());
         posMaxUnit = maxPosUnit;
 
         requestRepaint();