diff options
author | Denis Anisimov <denis@vaadin.com> | 2016-12-22 11:34:08 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-01-03 09:47:18 +0200 |
commit | a8835eaf31fd3a908647a71a26283f76383417bd (patch) | |
tree | 402301d7d2870c790caa09bfbfa18d4e279fcbee | |
parent | adbe38eea2174322e637c56399493b62a1fdd444 (diff) | |
download | vaadin-framework-a8835eaf31fd3a908647a71a26283f76383417bd.tar.gz vaadin-framework-a8835eaf31fd3a908647a71a26283f76383417bd.zip |
Update @since tags for 7.7.5
Change-Id: I73201908b537ca0a65106e03c9bad913b59fae9f
Re-added back disappeared commit from 7.7.5 migration PR:
Mark TextField/TextArea as busy when a text change event is pending
(#20469)
Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50
15 files changed, 59 insertions, 12 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/dd/DragHandle.java b/client/src/main/java/com/vaadin/client/ui/dd/DragHandle.java index c5a9475d39..000966bde7 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/DragHandle.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/DragHandle.java @@ -87,6 +87,7 @@ public class DragHandle { * later) both to provide the "-dragged" style and to make sure * that the drag handle can be properly styled (it's otherwise * invisible) + * @since 7.7.5 */ public DragHandle(String baseName) { this(baseName, null); @@ -185,6 +186,7 @@ public class DragHandle { * * @param dragHandleCallback * the callback object to use (can be null) + * @since 7.7.5 */ public void setCallback(DragHandleCallback dragHandleCallback) { userCallback = dragHandleCallback; diff --git a/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java index 251a5c7a97..50aa186bb1 100644 --- a/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java @@ -16,6 +16,7 @@ package com.vaadin.client.ui.textfield; import com.google.gwt.user.client.ui.Widget; +import com.vaadin.client.DeferredWorker; import com.vaadin.client.annotations.OnStateChange; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.client.ui.AbstractTextFieldWidget; @@ -29,7 +30,7 @@ import com.vaadin.ui.AbstractTextField; * Connector class for AbstractTextField. */ public abstract class AbstractTextFieldConnector extends AbstractFieldConnector - implements ValueChangeHandler.Owner { + implements ValueChangeHandler.Owner, DeferredWorker { private class AbstractTextFieldClientRpcImpl implements AbstractTextFieldClientRpc { @@ -134,4 +135,9 @@ public abstract class AbstractTextFieldConnector extends AbstractFieldConnector sendValueChange(); } + @Override + public boolean isWorkPending() { + return getValueChangeHandler().isScheduled(); + } + } diff --git a/client/src/main/java/com/vaadin/client/ui/textfield/ValueChangeHandler.java b/client/src/main/java/com/vaadin/client/ui/textfield/ValueChangeHandler.java index 89cca2394f..65d820c19a 100644 --- a/client/src/main/java/com/vaadin/client/ui/textfield/ValueChangeHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/textfield/ValueChangeHandler.java @@ -38,10 +38,15 @@ public class ValueChangeHandler { private Owner owner; + private boolean scheduled; + private Timer valueChangeTrigger = new Timer() { @Override public void run() { - Scheduler.get().scheduleDeferred(() -> owner.sendValueChange()); + Scheduler.get().scheduleDeferred(() -> { + owner.sendValueChange(); + scheduled = false; + }); } }; @@ -88,6 +93,7 @@ public class ValueChangeHandler { } private void lazyTextChange() { + scheduled = true; valueChangeTrigger.schedule(valueChangeTimeout); } @@ -95,10 +101,12 @@ public class ValueChangeHandler { if (valueChangeTrigger.isRunning()) { return; } + scheduled = true; valueChangeTrigger.schedule(valueChangeTimeout); } private void eagerTextChange() { + scheduled = true; valueChangeTrigger.run(); } @@ -126,4 +134,7 @@ public class ValueChangeHandler { this.valueChangeTimeout = valueChangeTimeout; } + public boolean isScheduled() { + return scheduled; + } } diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java index 1ffda08ef7..2cac853ea1 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -6107,6 +6107,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * * @param mode * a ColumnResizeMode value + * + * @since 7.7.5 */ public void setColumnResizeMode(ColumnResizeMode mode) { columnResizeMode = mode; @@ -6117,6 +6119,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * {@link ColumnResizeMode.ANIMATED}. * * @return a ColumnResizeMode value + * @since 7.7.5 */ public ColumnResizeMode getColumnResizeMode() { return columnResizeMode; diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTextField.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTextField.java index 8357a7649a..a5e75a3c15 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTextField.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTextField.java @@ -532,6 +532,11 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, possibleInputError = false; } + /** + * {@inheritDoc} + * + * @since 7.7.5 + */ @Override public boolean isWorkPending() { return scheduled; diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java index 0ea348553a..a6fbfb4e76 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java @@ -6090,6 +6090,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * * @param mode * a ColumnResizeMode value + * @since 7.7.5 */ public void setColumnResizeMode(ColumnResizeMode mode) { columnResizeMode = mode; @@ -6100,6 +6101,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * {@link ColumnResizeMode.ANIMATED}. * * @return a ColumnResizeMode value + * @since 7.7.5 */ public ColumnResizeMode getColumnResizeMode() { return columnResizeMode; diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/FieldGroup.java b/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/FieldGroup.java index 553bbc753c..e2e6b64f32 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/FieldGroup.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/FieldGroup.java @@ -104,6 +104,8 @@ public class FieldGroup implements Serializable { /** * Binds all fields to the properties in the item in use. + * + * @since 7.7.5 */ protected void bindFields() { for (Field<?> f : fieldToPropertyId.keySet()) { @@ -277,6 +279,7 @@ public class FieldGroup implements Serializable { * * @param field * The field to be cleared + * @since 7.7.5 */ protected void clearField(Field<?> field) { // Clear any possible existing binding to clear the field diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java index 75915e1bc6..18e47883ce 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java @@ -85,9 +85,9 @@ import com.vaadin.v7.data.Validator.InvalidValueException; import com.vaadin.v7.data.fieldgroup.DefaultFieldGroupFieldFactory; import com.vaadin.v7.data.fieldgroup.FieldGroup; import com.vaadin.v7.data.fieldgroup.FieldGroup.CommitException; +import com.vaadin.v7.data.fieldgroup.FieldGroupFieldFactory; import com.vaadin.v7.data.sort.Sort; import com.vaadin.v7.data.sort.SortOrder; -import com.vaadin.v7.data.fieldgroup.FieldGroupFieldFactory; import com.vaadin.v7.data.util.IndexedContainer; import com.vaadin.v7.data.util.converter.Converter; import com.vaadin.v7.data.util.converter.ConverterUtil; @@ -97,9 +97,9 @@ import com.vaadin.v7.event.ItemClickEvent; import com.vaadin.v7.event.ItemClickEvent.ItemClickListener; import com.vaadin.v7.event.ItemClickEvent.ItemClickNotifier; import com.vaadin.v7.event.SelectionEvent; -import com.vaadin.v7.event.SortEvent; import com.vaadin.v7.event.SelectionEvent.SelectionListener; import com.vaadin.v7.event.SelectionEvent.SelectionNotifier; +import com.vaadin.v7.event.SortEvent; import com.vaadin.v7.event.SortEvent.SortListener; import com.vaadin.v7.event.SortEvent.SortNotifier; import com.vaadin.v7.server.communication.data.DataGenerator; @@ -5328,6 +5328,7 @@ public class Grid extends AbstractComponent * * @param mode * a ColumnResizeMode value + * @since 7.7.5 */ public void setColumnResizeMode(ColumnResizeMode mode) { getState().columnResizeMode = mode; @@ -5338,6 +5339,7 @@ public class Grid extends AbstractComponent * {@link ColumnResizeMode#ANIMATED}. * * @return a ColumnResizeMode value + * @since 7.7.5 */ public ColumnResizeMode getColumnResizeMode() { return getState(false).columnResizeMode; diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractFieldState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractFieldState.java index 8f69abc302..fa15e5fa55 100644 --- a/compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractFieldState.java +++ b/compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractFieldState.java @@ -42,6 +42,8 @@ public class AbstractFieldState extends AbstractLegacyComponentState { * <p> * This is not used in all fields, but needs to be here for the time being * (#20468). + * + * @since 7.7.5 */ public Connector focusDelegate; } diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ColumnResizeMode.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ColumnResizeMode.java index 6f3de6a185..63eacd1fc1 100644 --- a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ColumnResizeMode.java +++ b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/ColumnResizeMode.java @@ -17,6 +17,8 @@ package com.vaadin.v7.shared.ui.grid; /** * Collection of modes used for resizing columns in the Grid. + * + * @since 7.7.5 */ public enum ColumnResizeMode { diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridState.java index a4c701c64b..577d177d6a 100644 --- a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridState.java +++ b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/grid/GridState.java @@ -143,6 +143,8 @@ public class GridState extends TabIndexState { /** * Column resize mode in grid. + * + * @since 7.7.5 */ public ColumnResizeMode columnResizeMode = ColumnResizeMode.ANIMATED; diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 9c426567b3..203cf5e521 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -2844,6 +2844,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * * @param mode * a ColumnResizeMode value + * @since 7.7.5 */ public void setColumnResizeMode(ColumnResizeMode mode) { getState().columnResizeMode = mode; @@ -2854,6 +2855,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * {@link ColumnResizeMode#ANIMATED}. * * @return a ColumnResizeMode value + * @since 7.7.5 */ public ColumnResizeMode getColumnResizeMode() { return getState(false).columnResizeMode; diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnResizeMode.java b/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnResizeMode.java index cae4845900..c8a75d56e2 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnResizeMode.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnResizeMode.java @@ -17,6 +17,8 @@ package com.vaadin.shared.ui.grid; /** * Collection of modes used for resizing columns in the Grid. + * + * @since 7.7.5 */ public enum ColumnResizeMode { diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java index 62dee006f7..6725d01137 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java @@ -102,6 +102,8 @@ public class GridState extends AbstractSingleSelectState { /** * Column resize mode in grid. + * + * @since 7.7.5 */ public ColumnResizeMode columnResizeMode = ColumnResizeMode.ANIMATED; diff --git a/uitest/src/test/java/com/vaadin/tests/components/textfield/TextChangeEventsTest.java b/uitest/src/test/java/com/vaadin/tests/components/textfield/TextChangeEventsTest.java index 5693400eba..1d01c35409 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/textfield/TextChangeEventsTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/textfield/TextChangeEventsTest.java @@ -1,5 +1,6 @@ package com.vaadin.tests.components.textfield; +import org.junit.Assert; import org.junit.Test; import com.vaadin.testbench.elements.TextAreaElement; @@ -15,14 +16,14 @@ public class TextChangeEventsTest extends SingleBrowserTest { TextAreaElement taDefault = $(TextAreaElement.class) .caption("Default text area").first(); taDefault.sendKeys("abc"); - waitUntil(driver -> getLogRow(0).equals( - "1. Text change event for Default text area, text content currently:'abc' Cursor at index:3")); + Assert.assertEquals(getLogRow(0), + "1. Text change event for Default text area, text content currently:'abc' Cursor at index:3"); TextAreaElement taTimeout = $(TextAreaElement.class) .caption("Timeout 3s").first(); taTimeout.sendKeys("abc"); - waitUntil(driver -> getLogRow(0).equals( - "2. Text change event for Timeout 3s, text content currently:'abc' Cursor at index:3")); + Assert.assertEquals(getLogRow(0), + "2. Text change event for Timeout 3s, text content currently:'abc' Cursor at index:3"); } @Test @@ -32,19 +33,19 @@ public class TextChangeEventsTest extends SingleBrowserTest { TextFieldElement tfDefault = $(TextFieldElement.class) .caption("Default").first(); tfDefault.sendKeys("abc"); - waitUntil(driver -> getLogRow(0).equals( - "1. Text change event for Default, text content currently:'abc' Cursor at index:3")); + Assert.assertEquals(getLogRow(0), + "1. Text change event for Default, text content currently:'abc' Cursor at index:3"); TextFieldElement tfEager = $(TextFieldElement.class).caption("Eager") .first(); tfEager.sendKeys("abc"); - waitUntil(driver -> getLogRow(0).contains( + Assert.assertTrue(getLogRow(0).contains( "Text change event for Eager, text content currently:'abc' Cursor at index:3")); TextFieldElement tfTimeout = $(TextFieldElement.class) .caption("Timeout 3s").first(); tfTimeout.sendKeys("abc"); - waitUntil(driver -> getLogRow(0).contains( + Assert.assertTrue(getLogRow(0).contains( "Text change event for Timeout 3s, text content currently:'abc' Cursor at index:3")); } } |