summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authormtzukanov <mtzukanov@vaadin.com>2015-10-22 13:52:39 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2015-10-29 11:56:45 +0000
commit6ed91a94302900e89b1de9b54d0561701af49a0c (patch)
tree2e46b0d1271e95ff84fffa75d84a6de1c54a424c /uitest
parent5ea93a227f4ca7f33d9235f0bd4ca3e51ea44664 (diff)
downloadvaadin-framework-6ed91a94302900e89b1de9b54d0561701af49a0c.tar.gz
vaadin-framework-6ed91a94302900e89b1de9b54d0561701af49a0c.zip
Fixes column header drop indicator (#18925)
Calculation of the frozen column width was wrong in multiselect mode. It did not take into account the last frozen column, but added the select column twice. The same problem was in AutoScroller (as the same methods were copy-pasted there), for which reason the autoscrolling was not scrolling till the end. This patch fixes the calculation error and removes copy-pasted code, reusing the same code in both places. Change-Id: I164e2fc96688088b620ad8785c533c593723f83e
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridDragAndDrop.java62
1 files changed, 62 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridDragAndDrop.java b/uitest/src/com/vaadin/tests/components/grid/GridDragAndDrop.java
new file mode 100644
index 0000000000..d77a8ddedc
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridDragAndDrop.java
@@ -0,0 +1,62 @@
+/*
+ * 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.grid;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Grid;
+
+@SuppressWarnings("serial")
+public class GridDragAndDrop extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+
+ List<String> columnIds = Arrays.asList("Hello", "this", "are",
+ "multiple", "columns", "plus", "these", "resemble", "a",
+ "group", "here", "no", "more");
+
+ Grid grid = new Grid();
+
+ for (String columnId : columnIds) {
+ grid.addColumn(columnId);
+ }
+
+ for (int i = 0; i < 100; i++) {
+ grid.addRow(columnIds.toArray());
+ }
+
+ grid.setColumnReorderingAllowed(true);
+
+ grid.setFrozenColumnCount(1);
+ grid.setSelectionMode(Grid.SelectionMode.MULTI);
+
+ addComponent(grid);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Start dragging a column header and move left and right.<br> The drop indicator should appear exactly on the lines between column headers.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 18925;
+ }
+}