diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-29 12:02:47 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-29 13:44:25 +0000 |
commit | 3c05a351908353c4c99c14bb5a8fcd3ea9fc7afe (patch) | |
tree | cac0e0cb7721fd8264cf902a7b382abf2acbc73e /uitest | |
parent | 54665ea8ee6cc091eb3409c3f1476a30d11c7af2 (diff) | |
download | vaadin-framework-3c05a351908353c4c99c14bb5a8fcd3ea9fc7afe.tar.gz vaadin-framework-3c05a351908353c4c99c14bb5a8fcd3ea9fc7afe.zip |
Update GridLayout DOM in onConnectorHierarchyChange (#10324, #10097)
* Add ChildComponentData that is sent in the state instead of previous
UIDL data
* Store child data in a map instead of as a linked list
* Move Cell instead of moving component form one Cell to the other if
moved
* Clean up internal state in remove(Widget)
Change-Id: I3dabe0165b6dcdf70c0df06a0151b73d080187a5
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/gridlayout/InsertRowInMiddle.html | 31 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/gridlayout/InsertRowInMiddle.java | 54 |
2 files changed, 85 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/InsertRowInMiddle.html b/uitest/src/com/vaadin/tests/components/gridlayout/InsertRowInMiddle.html new file mode 100644 index 0000000000..7de29edd1b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/gridlayout/InsertRowInMiddle.html @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.gridlayout.InsertRowInMiddle?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsgridlayoutInsertRowInMiddle::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentsgridlayoutInsertRowInMiddle::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[1]</td> + <td>some new row</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/InsertRowInMiddle.java b/uitest/src/com/vaadin/tests/components/gridlayout/InsertRowInMiddle.java new file mode 100644 index 0000000000..0fc764e463 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/gridlayout/InsertRowInMiddle.java @@ -0,0 +1,54 @@ +/* + * Copyright 2012 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.components.gridlayout; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; + +public class InsertRowInMiddle extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final GridLayout layout = new GridLayout(1, 2); + layout.addComponent(new Label("some row"), 0, 0); + Button newRowButton = new Button("Insert Row"); + newRowButton.addListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + layout.insertRow(1); + layout.addComponent(new Label("some new row"), 0, 1); + } + }); + layout.addComponent(newRowButton, 0, 1); + addComponent(layout); + } + + @Override + protected String getTestDescription() { + return "A new row added to the middle of a GridLayout should appear without any exception being thrown."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(10097); + } + +} |