aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2014-11-12 10:06:22 +0200
committerAnna Koskinen <anna@vaadin.com>2014-11-13 17:15:21 +0200
commitacf28902774c68919726051984e847bcedaf7a3f (patch)
tree8996d62ac3aabb8688b7a447bff236e9c2e8de38
parentee6f9483f36eeeecf32730016d02fb22e5cbaab3 (diff)
downloadvaadin-framework-acf28902774c68919726051984e847bcedaf7a3f.tar.gz
vaadin-framework-acf28902774c68919726051984e847bcedaf7a3f.zip
Revert "Table column width can be changed from defined to expandratio (#15101)"
This reverts commit 7237b88645a27b157bc85d62292dc93faddd19f9. Change-Id: Ifbe26c90a91a21a1ac416bda8e59acbbd80cf5f0
-rw-r--r--client/src/com/vaadin/client/ui/VScrollTable.java1
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TableExpandRatio.java110
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TableExpandRatioTest.java88
3 files changed, 0 insertions, 199 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java
index b07d2dc9c0..6c241f1033 100644
--- a/client/src/com/vaadin/client/ui/VScrollTable.java
+++ b/client/src/com/vaadin/client/ui/VScrollTable.java
@@ -3636,7 +3636,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
c.setWidth(widthWithoutAddedIndent, true);
}
} else if (col.hasAttribute("er")) {
- c.setUndefinedWidth();
c.setExpandRatio(col.getFloatAttribute("er"));
} else if (recalcWidths) {
diff --git a/uitest/src/com/vaadin/tests/components/table/TableExpandRatio.java b/uitest/src/com/vaadin/tests/components/table/TableExpandRatio.java
deleted file mode 100644
index 92c9b8d988..0000000000
--- a/uitest/src/com/vaadin/tests/components/table/TableExpandRatio.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright 2000-2014 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.table;
-
-import java.util.Arrays;
-
-import com.vaadin.annotations.PreserveOnRefresh;
-import com.vaadin.annotations.Theme;
-import com.vaadin.data.util.BeanItemContainer;
-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.Table;
-import com.vaadin.ui.VerticalLayout;
-
-@PreserveOnRefresh
-@Theme("valo")
-public class TableExpandRatio extends AbstractTestUI {
-
- @Override
- protected void setup(VaadinRequest request) {
-
- BeanItemContainer<MyItem> container = new BeanItemContainer<TableExpandRatio.MyItem>(
- MyItem.class, Arrays.asList(new MyItem("one", 1), new MyItem(
- "two", 2)));
-
- final Table table = new Table(null, container);
-
- table.setWidth("800px");
- table.setImmediate(true);
-
- Button widthButton = new Button("Set Width",
- new Button.ClickListener() {
-
- @Override
- public void buttonClick(ClickEvent event) {
- table.setColumnWidth("value", 300);
-
- }
- });
-
- Button expandButton = new Button("Set Expand Ratio",
- new Button.ClickListener() {
-
- @Override
- public void buttonClick(ClickEvent event) {
- table.setColumnExpandRatio("value", 1);
-
- }
- });
-
- widthButton.setId("widthbutton");
- expandButton.setId("expandbutton");
-
- VerticalLayout layout = new VerticalLayout(widthButton, expandButton,
- table);
- addComponent(layout);
- }
-
- public class MyItem {
-
- private String name;
- private Integer value;
-
- public MyItem(String name, Integer value) {
- this.name = name;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Integer getValue() {
- return value;
- }
-
- public void setValue(Integer value) {
- this.value = value;
- }
- }
-
- @Override
- protected String getTestDescription() {
- return "When a column has fixed width and it is changed to expand ratio, the width should update accordingly";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 15101;
- }
-}
diff --git a/uitest/src/com/vaadin/tests/components/table/TableExpandRatioTest.java b/uitest/src/com/vaadin/tests/components/table/TableExpandRatioTest.java
deleted file mode 100644
index 3cf66d4e4b..0000000000
--- a/uitest/src/com/vaadin/tests/components/table/TableExpandRatioTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2000-2014 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.table;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.number.IsCloseTo.closeTo;
-
-import java.util.List;
-
-import org.junit.Test;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-
-import com.vaadin.testbench.elements.ButtonElement;
-import com.vaadin.testbench.elements.TableElement;
-import com.vaadin.tests.tb3.MultiBrowserTest;
-
-public class TableExpandRatioTest extends MultiBrowserTest {
-
- @Override
- public void setup() throws Exception {
- super.setup();
-
- openTestURL();
- }
-
- /*
- * Needed for IE to get focus when button is clicked
- */
- @Override
- protected boolean requireWindowFocusForIE() {
-
- return true;
- }
-
- @Test
- public void cellWidthUpdatesWhenExpandRatioSetAfterDefinedWidth() {
-
- // test that after setting defined size to the second column, the first
- // column will have correct size
-
- setDefinedWidth();
-
- assertThat(getFirstCellWidth(), closeTo(500, 10));
-
- // test that after setting expandratio to the second column, it is
- // correct
-
- setExpandRatio();
-
- assertThat(getFirstCellWidth(), closeTo(65, 5));
-
- }
-
- private void setExpandRatio() {
- $(ButtonElement.class).id("expandbutton").click();
- }
-
- private void setDefinedWidth() {
- $(ButtonElement.class).id("widthbutton").click();
- }
-
- private double getFirstCellWidth() {
-
- List<WebElement> rows = $(TableElement.class).first()
- .findElement(By.className("v-table-body"))
- .findElements(By.tagName("tr"));
- WebElement firstrow = rows.get(0);
- List<WebElement> cells = firstrow.findElements(By
- .className("v-table-cell-content"));
-
- int cellwidth = cells.get(0).getSize().getWidth();
- return cellwidth;
- }
-}