Fixed issue with SplitPanels which were not marking sets as dirty. Change-Id: I23bb8bfca87a825aef132f249e05871cf7b36a34tags/7.2.4
@@ -335,7 +335,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* @return position of the splitter | |||
*/ | |||
public float getSplitPosition() { | |||
return getSplitterState().position; | |||
return getSplitterState(false).position; | |||
} | |||
/** | |||
@@ -358,7 +358,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS | |||
*/ | |||
public void setMinSplitPosition(float pos, Unit unit) { | |||
setSplitPositionLimits(pos, unit, getSplitterState().maxPosition, | |||
setSplitPositionLimits(pos, unit, getSplitterState(false).maxPosition, | |||
posMaxUnit); | |||
} | |||
@@ -369,7 +369,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* @return the minimum position of the splitter | |||
*/ | |||
public float getMinSplitPosition() { | |||
return getSplitterState().minPosition; | |||
return getSplitterState(false).minPosition; | |||
} | |||
/** | |||
@@ -392,8 +392,8 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS | |||
*/ | |||
public void setMaxSplitPosition(float pos, Unit unit) { | |||
setSplitPositionLimits(getSplitterState().minPosition, posMinUnit, pos, | |||
unit); | |||
setSplitPositionLimits(getSplitterState(false).minPosition, posMinUnit, | |||
pos, unit); | |||
} | |||
/** | |||
@@ -403,7 +403,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* @return the maximum position of the splitter | |||
*/ | |||
public float getMaxSplitPosition() { | |||
return getSplitterState().maxPosition; | |||
return getSplitterState(false).maxPosition; | |||
} | |||
/** | |||
@@ -467,7 +467,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* @return <code>true</code> if locked, <code>false</code> otherwise. | |||
*/ | |||
public boolean isLocked() { | |||
return getSplitterState().locked; | |||
return getSplitterState(false).locked; | |||
} | |||
/** | |||
@@ -540,6 +540,10 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
} | |||
private SplitterState getSplitterState() { | |||
return getState(false).splitterState; | |||
return ((AbstractSplitPanelState) super.getState()).splitterState; | |||
} | |||
private SplitterState getSplitterState(boolean markAsDirty) { | |||
return ((AbstractSplitPanelState) super.getState(markAsDirty)).splitterState; | |||
} | |||
} |
@@ -1,16 +1,16 @@ | |||
package com.vaadin.tests.components.window; | |||
import static org.junit.Assert.assertEquals; | |||
import static org.junit.Assert.assertNotEquals; | |||
import com.vaadin.tests.tb3.MultiBrowserTest; | |||
import org.junit.Test; | |||
import org.openqa.selenium.By; | |||
import org.openqa.selenium.Point; | |||
import org.openqa.selenium.WebDriver; | |||
import org.openqa.selenium.WebElement; | |||
import org.openqa.selenium.interactions.Action; | |||
import org.openqa.selenium.interactions.Actions; | |||
import org.openqa.selenium.support.ui.ExpectedCondition; | |||
import com.vaadin.tests.tb3.MultiBrowserTest; | |||
import static org.junit.Assert.assertNotEquals; | |||
public class WindowMoveListenerTest extends MultiBrowserTest { | |||
@@ -18,7 +18,7 @@ public class WindowMoveListenerTest extends MultiBrowserTest { | |||
public void testWindowRepositioning() throws Exception { | |||
openTestURL(); | |||
WebElement window = getDriver().findElement(By.id("testwindow")); | |||
final WebElement window = getDriver().findElement(By.id("testwindow")); | |||
WebElement button = getDriver().findElement(By.id("testbutton")); | |||
// I'd loved to use the header, but that doesn't work. Footer works | |||
@@ -26,7 +26,7 @@ public class WindowMoveListenerTest extends MultiBrowserTest { | |||
WebElement windowHeader = getDriver().findElement( | |||
By.className("v-window-footer")); | |||
Point winPos = window.getLocation(); | |||
final Point winPos = window.getLocation(); | |||
// move window | |||
Action a = new Actions(driver).clickAndHold(windowHeader) | |||
@@ -41,10 +41,16 @@ public class WindowMoveListenerTest extends MultiBrowserTest { | |||
// re-set window | |||
button.click(); | |||
assertEquals("Window was not re-positioned correctly.", winPos.x, | |||
window.getLocation().x); | |||
assertEquals("Window was not re-positioned correctly.", winPos.y, | |||
window.getLocation().y); | |||
waitUntilWindowHasReseted(window, winPos); | |||
} | |||
private void waitUntilWindowHasReseted(final WebElement window, final Point winPos) { | |||
waitUntil(new ExpectedCondition<Boolean>() { | |||
@Override | |||
public Boolean apply(WebDriver input) { | |||
return winPos.x == window.getLocation().x && | |||
winPos.y == window.getLocation().y; | |||
} | |||
}, 5); | |||
} | |||
} |