]> source.dussan.org Git - vaadin-framework.git/commitdiff
Revert "Table column width can be changed from defined to expandratio (#15101)"
authorSauli Tähkäpää <sauli@vaadin.com>
Wed, 12 Nov 2014 08:06:22 +0000 (10:06 +0200)
committerAnna Koskinen <anna@vaadin.com>
Thu, 13 Nov 2014 15:15:21 +0000 (17:15 +0200)
This reverts commit 7237b88645a27b157bc85d62292dc93faddd19f9.

Change-Id: Ifbe26c90a91a21a1ac416bda8e59acbbd80cf5f0

client/src/com/vaadin/client/ui/VScrollTable.java
uitest/src/com/vaadin/tests/components/table/TableExpandRatio.java [deleted file]
uitest/src/com/vaadin/tests/components/table/TableExpandRatioTest.java [deleted file]

index b07d2dc9c0dd2e7aa784f07b74a1151709640b20..6c241f1033d89473243d7311ffeedb0bda6a92bc 100644 (file)
@@ -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 (file)
index 92c9b8d..0000000
+++ /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 (file)
index 3cf66d4..0000000
+++ /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;
-    }
-}