aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorDenis <denis@vaadin.com>2016-12-15 12:40:54 +0200
committerPekka Hyvönen <pekka@vaadin.com>2016-12-15 12:40:54 +0200
commit809a486c60a680d31308ffd078e6f8036252a990 (patch)
tree75a3d7481a12d042606316fad190130ada181b62 /server/src
parent616e1f8ce5e544693268f54a2ac4cec2158d4a19 (diff)
downloadvaadin-framework-809a486c60a680d31308ffd078e6f8036252a990.tar.gz
vaadin-framework-809a486c60a680d31308ffd078e6f8036252a990.zip
Migrate 7.7.5 branch patches to v8. (#7969)
* Prevent adding several scrollbar handlers (#19189). Change-Id: Ib0cc6c6835aab6d263f153362a328bcf2be7bc5c * Prevent adding several scrollbar handlers (#19189). * Keep expand ratio for last row/column when reducing grid layout size (#20297) Change-Id: Iff53a803596f4fc1eae8e4bfa307b9c1f4df961a * Fixed drag and drop failure when message dragged from email client (#20451) When dragging message form email client on Windows, item.webkitGetAsEntry() might return null creating NPE on the client side. Added additional checks for this situation. Change-Id: I569f7e6d0d7b137f24be53d1fbce384695ae8c73 * Change expected pre-release version number pattern in publish report Change-Id: Icdacecc490d2490ea9e262f5c5736c1dece2a89d * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeEvents.java * Fixed touch scrolling issue in Surface and WP devices (#18737) Fixed by using pointerevents instead of touchevents when the browser is IE11, or Edge. Also added touch-action: none; css rules into escalator.css to prevent default touch behaviour on IE11 and Edge. Does not affect IE8 to IE10 browsers, behaviour on those will stay the same as before the fix. No new unit tests since we do not have automatic touch testing possibilities yet. Please test manually with Surface: IE11 and Edge, use for example uitest: com.vaadin.tests.components.grid.basics.GridBasicsomponents.grid.basics.GridBasics Change-Id: Iddbf1852e6ffafc855f749d6f4ebb235ed0f5703 * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 # Conflicts: # client/src/main/java/com/vaadin/client/connectors/GridConnector.java # client/src/main/java/com/vaadin/client/widgets/Grid.java # server/src/main/java/com/vaadin/ui/Grid.java # shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java # themes/src/main/themes/VAADIN/themes/base/grid/grid.scss # uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java Change-Id: Ieca56121875198ed559a41c143b28926e2695433 * Fix NPE in case some items don't contain all properties of Grid. This could occur in when parent is a different entity than its children in hierarchical data. Change-Id: Icd53b5b5e5544a3680d0cd99702ab78224b2dc08 # Conflicts: # server/src/main/java/com/vaadin/data/fieldgroup/FieldGroup.java # server/src/main/java/com/vaadin/ui/Grid.java * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/test/java/com/vaadin/tests/components/textfield/TextChangeEventsTest.java * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 * Removed V8 VTextField unused import, forgotten @RunLocally. * Don't rely on selenium "sendKeys" behavior. * Revert "Change expected pre-release version number pattern in publish report" This reverts commit 8df27b952dddb691aead6a633c5b3724c98bf343. * Migrate TextField/TextArea patch from 7.7 to master (modern components) Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50
Diffstat (limited to 'server/src')
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java25
-rw-r--r--server/src/main/java/com/vaadin/ui/GridLayout.java4
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java24
3 files changed, 49 insertions, 4 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java
index 120640bd53..7b868ee542 100644
--- a/server/src/main/java/com/vaadin/ui/Grid.java
+++ b/server/src/main/java/com/vaadin/ui/Grid.java
@@ -68,6 +68,7 @@ import com.vaadin.shared.Registration;
import com.vaadin.shared.data.DataCommunicatorConstants;
import com.vaadin.shared.data.sort.SortDirection;
import com.vaadin.shared.ui.grid.AbstractGridExtensionState;
+import com.vaadin.shared.ui.grid.ColumnResizeMode;
import com.vaadin.shared.ui.grid.ColumnState;
import com.vaadin.shared.ui.grid.DetailsManagerState;
import com.vaadin.shared.ui.grid.GridConstants;
@@ -79,6 +80,7 @@ import com.vaadin.shared.ui.grid.HeightMode;
import com.vaadin.shared.ui.grid.SectionState;
import com.vaadin.shared.util.SharedUtil;
import com.vaadin.ui.Grid.FooterRow;
+import com.vaadin.ui.Grid.SelectionMode;
import com.vaadin.ui.components.grid.AbstractSelectionModel;
import com.vaadin.ui.components.grid.EditorComponentGenerator;
import com.vaadin.ui.components.grid.EditorImpl;
@@ -845,7 +847,6 @@ public class Grid<T> extends AbstractListing<T>
if (column != null && column.isResizable()) {
column.getState().width = pixels;
fireColumnResizeEvent(column, true);
- markAsDirty();
}
}
}
@@ -3466,6 +3467,27 @@ public class Grid<T> extends AbstractListing<T>
}
/**
+ * Sets the column resize mode to use. The default mode is
+ * {@link ColumnResizeMode#ANIMATED}.
+ *
+ * @param mode
+ * a ColumnResizeMode value
+ */
+ public void setColumnResizeMode(ColumnResizeMode mode) {
+ getState().columnResizeMode = mode;
+ }
+
+ /**
+ * Returns the current column resize mode. The default mode is
+ * {@link ColumnResizeMode#ANIMATED}.
+ *
+ * @return a ColumnResizeMode value
+ */
+ public ColumnResizeMode getColumnResizeMode() {
+ return getState(false).columnResizeMode;
+ }
+
+ /**
* Creates a new Editor instance. Can be overridden to create a custom
* Editor. If the Editor is a {@link AbstractGridExtension}, it will be
* automatically added to {@link DataCommunicator}.
@@ -3744,7 +3766,6 @@ public class Grid<T> extends AbstractListing<T>
getDataCommunicator().setInMemorySorting(null);
return;
}
-
sortOrder.addAll(order);
sort(userOriginated);
}
diff --git a/server/src/main/java/com/vaadin/ui/GridLayout.java b/server/src/main/java/com/vaadin/ui/GridLayout.java
index f56a90be95..e4562f81ce 100644
--- a/server/src/main/java/com/vaadin/ui/GridLayout.java
+++ b/server/src/main/java/com/vaadin/ui/GridLayout.java
@@ -740,7 +740,7 @@ public class GridLayout extends AbstractLayout
// Forget expands for removed columns
if (columns < getColumns()) {
- for (int i = columns - 1; i < getColumns(); i++) {
+ for (int i = columns; i < getColumns(); i++) {
columnExpandRatio.remove(i);
getState().explicitColRatios.remove(i);
}
@@ -790,7 +790,7 @@ public class GridLayout extends AbstractLayout
}
// Forget expands for removed rows
if (rows < getRows()) {
- for (int i = rows - 1; i < getRows(); i++) {
+ for (int i = rows; i < getRows(); i++) {
rowExpandRatio.remove(i);
getState().explicitRowRatios.remove(i);
}
diff --git a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java
index 1eabf2fb62..64b466612f 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java
@@ -75,6 +75,30 @@ public class GridLayoutTest {
assertOrder(grid, new int[] { 0, 1, 2, 3 });
}
+ @Test
+ public void removeRowsExpandRatiosPreserved() {
+ GridLayout gl = new GridLayout(3, 3);
+ gl.setRowExpandRatio(0, 0);
+ gl.setRowExpandRatio(1, 1);
+ gl.setRowExpandRatio(2, 2);
+
+ gl.setRows(2);
+ assertEquals(0, gl.getRowExpandRatio(0), 0);
+ assertEquals(1, gl.getRowExpandRatio(1), 0);
+ }
+
+ @Test
+ public void removeColsExpandRatiosPreserved() {
+ GridLayout gl = new GridLayout(3, 3);
+ gl.setColumnExpandRatio(0, 0);
+ gl.setColumnExpandRatio(1, 1);
+ gl.setColumnExpandRatio(2, 2);
+
+ gl.setColumns(2);
+ assertEquals(0, gl.getColumnExpandRatio(0), 0);
+ assertEquals(1, gl.getColumnExpandRatio(1), 0);
+ }
+
private void assertContentPositions(GridLayout grid) {
assertEquals(grid.getComponentCount(), children.length);
int c = 0;