diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-03-13 09:50:41 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-03-14 11:01:55 +0000 |
commit | d2d4279e9946f9b193c0b706ecad9e01a5bf77c3 (patch) | |
tree | 86cd1107710b66192ecd49ae5a1451556b3efab1 /uitest | |
parent | 749fd7085ec2db6af0b4f401378b2694be3626c7 (diff) | |
download | vaadin-framework-d2d4279e9946f9b193c0b706ecad9e01a5bf77c3.tar.gz vaadin-framework-d2d4279e9946f9b193c0b706ecad9e01a5bf77c3.zip |
Fixed setting column width back to undefined by setting it to -1. #7922
svn changeset:25591/svn branch:6.8
Conflicts:
server/src/com/vaadin/ui/Table.java
Reverted change included by mistake in changeset [25591] for #7922
svn changeset:25606/svn branch:6.8
Change-Id: I6765a52ab213c131cca053227ee72b0007552f7f
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/TableColumnWidthsAndExpandRatios.html | 83 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/TableColumnWidthsAndExpandRatios.java | 57 |
2 files changed, 140 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/table/TableColumnWidthsAndExpandRatios.html b/uitest/src/com/vaadin/tests/components/table/TableColumnWidthsAndExpandRatios.html new file mode 100644 index 0000000000..75d98ce2e6 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableColumnWidthsAndExpandRatios.html @@ -0,0 +1,83 @@ +<?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:8888/" /> +<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.table.TableColumnWidthsAndExpandRatios?restartApplication</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>initial-all-columns-undefined</td> +</tr> +<!--Resize column 1 making it defined size--> +<tr> + <td>dragAndDrop</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnWidthsAndExpandRatios::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>-300,0</td> +</tr> +<!--Resize column 2 making it defined size--> +<tr> + <td>dragAndDrop</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnWidthsAndExpandRatios::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> + <td>-300,0</td> +</tr> +<!--Resize column 3 making it defined size--> +<tr> + <td>dragAndDrop</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnWidthsAndExpandRatios::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]</td> + <td>-300,0</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>columns-defined-width</td> +</tr> +<!--Reset column 1 width--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnWidthsAndExpandRatios::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VNativeButton[0]</td> + <td>114,4</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>column1-undefined</td> +</tr> +<!--Reset column2 width--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnWidthsAndExpandRatios::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[1]/VNativeButton[0]</td> + <td>98,13</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>column2-undefined</td> +</tr> +<!--Reset column 3 width--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTableColumnWidthsAndExpandRatios::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[2]/VNativeButton[0]</td> + <td>40,10</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>columns-undefined-width</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/table/TableColumnWidthsAndExpandRatios.java b/uitest/src/com/vaadin/tests/components/table/TableColumnWidthsAndExpandRatios.java new file mode 100644 index 0000000000..747c99468f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableColumnWidthsAndExpandRatios.java @@ -0,0 +1,57 @@ +package com.vaadin.tests.components.table; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.NativeButton; +import com.vaadin.ui.Table; + +public class TableColumnWidthsAndExpandRatios extends TestBase { + + @Override + protected void setup() { + getLayout().setSizeFull(); + + final Table table = new Table(); + table.setSizeFull(); + + table.addContainerProperty("column1", String.class, "Humpty"); + table.addContainerProperty("column2", String.class, "Dumpty"); + table.addContainerProperty("column3", String.class, "Doe"); + + for (int row = 0; row < 100; row++) { + table.addItem(); + } + + HorizontalLayout buttons = new HorizontalLayout(); + for (Object col : table.getContainerPropertyIds()) { + buttons.addComponent(createResetButton(col, table)); + } + + addComponent(table); + addComponent(buttons); + } + + private NativeButton createResetButton(final Object property, + final Table table) { + return new NativeButton("Reset " + property + " width", + new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + table.setColumnWidth(property, -1); + } + }); + } + + @Override + protected String getDescription() { + return "Changing column width to -1 should remove any previous size measurements"; + } + + @Override + protected Integer getTicketNumber() { + return 7922; + } + +} |