From f79949cc274a1fdbd865d800d567ad6d774197bd Mon Sep 17 00:00:00 2001 From: Mikael Grankvist Date: Tue, 13 Nov 2012 13:35:27 +0200 Subject: (#10180) Moved positioning from onStateChanged to onConnectorHierarchyChange. Added test. Change-Id: Iccd290a8e2be165207abe1b4805ec992d24bad0d --- ...oluteLayoutCorrectPositioningOfHiddenField.html | 52 +++++++++++++++++++ ...oluteLayoutCorrectPositioningOfHiddenField.java | 59 ++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.html create mode 100644 uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.java (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.html b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.html new file mode 100644 index 0000000000..f00d6b15f9 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.html @@ -0,0 +1,52 @@ + + + + + + +AbsoluteLayoutCorrectPositioningOfHiddenField + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AbsoluteLayoutCorrectPositioningOfHiddenField
open/run/com.vaadin.tests.components.absolutelayout.AbsoluteLayoutCorrectPositioningOfHiddenField?restartApplication
assertElementNotPresentvaadin=runcomvaadintestscomponentsabsolutelayoutAbsoluteLayoutCorrectPositioningOfHiddenField::PID_SpositionedLabel
clickvaadin=runcomvaadintestscomponentsabsolutelayoutAbsoluteLayoutCorrectPositioningOfHiddenField::PID_SactionButton
assertElementPresentvaadin=runcomvaadintestscomponentsabsolutelayoutAbsoluteLayoutCorrectPositioningOfHiddenField::PID_SpositionedLabel
screenCaptureAbsoluteLayoutLabelPositionNotOrigo
clickvaadin=runcomvaadintestscomponentsabsolutelayoutAbsoluteLayoutCorrectPositioningOfHiddenField::PID_SactionButton
screenCaptureAbsoluteLayoutLabelMovedDown
+ + diff --git a/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.java b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.java new file mode 100644 index 0000000000..42ea6158fd --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.java @@ -0,0 +1,59 @@ +package com.vaadin.tests.components.absolutelayout; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.AbsoluteLayout; +import com.vaadin.ui.AbsoluteLayout.ComponentPosition; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Label; + +public class AbsoluteLayoutCorrectPositioningOfHiddenField extends TestBase { + + @Override + protected void setup() { + setTheme("tests-tickets"); + final AbsoluteLayout abs = new AbsoluteLayout(); + abs.setStyleName("borders"); + abs.setWidth("250px"); + abs.setHeight("100px"); + + final Label l = new Label("Top 20, Left 20"); + l.setSizeUndefined(); + l.setId("positionedLabel"); + l.setVisible(false); + abs.addComponent(l, "top:20px;left:20px"); + + final Button action = new Button("Set visible"); + action.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + if (l.isVisible()) { + l.setValue("Top 70, Left 20"); + ComponentPosition position = abs.getPosition(l); + position.setCSSString("top:70px;left:20px;"); + abs.setPosition(l, position); + } else { + l.setVisible(true); + action.setCaption("Move down"); + } + } + }); + action.setId("actionButton"); + abs.addComponent(action, "top: 70px;left: 150px;"); + + addComponent(abs); + } + + @Override + protected String getDescription() { + return "AbsoluteLayout should reposition invisible components when set to visible"; + } + + @Override + protected Integer getTicketNumber() { + return 10180; + } + +} -- cgit v1.2.3