--- /dev/null
+<?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="http://localhost:8080/" />
+<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>/64/run/com.vaadin.tests.layouts.WidgetImplementationSwap?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertElementHeight</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td>
+ <td>66</td>
+</tr>
+<tr>
+ <td>assertElementHeight</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VHorizontalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td>
+ <td>66</td>
+</tr>
+<tr>
+ <td>assertElementHeight</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VTextArea[0]</td>
+ <td>66</td>
+</tr>
+<tr>
+ <td>assertElementHeight</td>
+ <td>vaadin=64runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VCssLayout[0]/VCssLayout$FlowPane[0]/VTextArea[0]</td>
+ <td>66</td>
+</tr>
+<tr>
+ <td>assertElementHeight</td>
+ <td>//input[@type='text']</td>
+ <td>66</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
--- /dev/null
+package com.vaadin.tests.layouts;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.AbsoluteLayout;
+import com.vaadin.ui.AbstractLayout;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class WidgetImplementationSwap extends TestBase {
+
+ @Override
+ protected void setup() {
+ setTheme("tests-tickets");
+
+ {
+ final AbstractLayout layout = new AbsoluteLayout();
+ layout.setCaption(layout.getClass().getSimpleName());
+ layout.setStyleName("borders");
+ layout.setWidth("500px");
+ layout.setHeight("50px");
+ addComponent(layout);
+ final TextField tf = new TextField();
+ layout.addComponent(tf);
+ Button b = new Button("-> TextArea", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (tf.getRows() == 0) {
+ tf.setRows(3);
+ event.getButton().setCaption("Move");
+ } else {
+ layout.setCaption(layout.getClass().getSimpleName()
+ + " done");
+ event.getButton().setCaption("done");
+ }
+
+ }
+ });
+ addComponent(b);
+ }
+ {
+ final AbstractLayout layout = new VerticalLayout();
+ layout.setCaption(layout.getClass().getSimpleName());
+ layout.setStyleName("borders");
+ layout.setWidth("500px");
+ layout.setHeight("50px");
+ addComponent(layout);
+ final TextField tf = new TextField();
+ layout.addComponent(tf);
+ Button b = new Button("-> TextArea", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (tf.getRows() == 0) {
+ tf.setRows(3);
+ event.getButton().setCaption("Move");
+ } else {
+ layout.setCaption(layout.getClass().getSimpleName()
+ + " done");
+ event.getButton().setCaption("done");
+ }
+
+ }
+ });
+ addComponent(b);
+ }
+
+ {
+ final AbstractLayout layout = new HorizontalLayout();
+ layout.setCaption(layout.getClass().getSimpleName());
+ layout.setStyleName("borders");
+ layout.setWidth("500px");
+ layout.setHeight("50px");
+ addComponent(layout);
+ final TextField tf = new TextField();
+ layout.addComponent(tf);
+ Button b = new Button("-> TextArea", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (tf.getRows() == 0) {
+ tf.setRows(3);
+ event.getButton().setCaption("Move");
+ } else {
+ layout.setCaption(layout.getClass().getSimpleName()
+ + " done");
+ event.getButton().setCaption("done");
+ }
+
+ }
+ });
+ addComponent(b);
+ }
+
+ {
+ final AbstractLayout layout = new GridLayout();
+ layout.setCaption(layout.getClass().getSimpleName());
+ layout.setStyleName("borders");
+ layout.setWidth("500px");
+ layout.setHeight("50px");
+ addComponent(layout);
+ final TextField tf = new TextField();
+ layout.addComponent(tf);
+ Button b = new Button("-> TextArea", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (tf.getRows() == 0) {
+ tf.setRows(3);
+ event.getButton().setCaption("Move");
+ } else {
+ layout.setCaption(layout.getClass().getSimpleName()
+ + " done");
+ event.getButton().setCaption("done");
+ }
+
+ }
+ });
+ addComponent(b);
+ }
+
+ {
+ final AbstractLayout layout = new CssLayout();
+ layout.setCaption(layout.getClass().getSimpleName());
+ layout.setStyleName("borders");
+ layout.setWidth("500px");
+ layout.setHeight("50px");
+ addComponent(layout);
+ final TextField tf = new TextField();
+ layout.addComponent(tf);
+ Button b = new Button("-> TextArea", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (tf.getRows() == 0) {
+ tf.setRows(3);
+ event.getButton().setCaption("Move");
+ } else {
+ layout.setCaption(layout.getClass().getSimpleName()
+ + " done");
+ event.getButton().setCaption("done");
+ }
+
+ }
+ });
+ addComponent(b);
+ }
+
+ }
+
+ @Override
+ protected String getDescription() {
+ return "First click turns TextField into a TextArea (on the client); second click modifies the layout - widget should still be a TextArea.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 5457;
+ }
+
+}