From c905ac6adf1aeb3ff4f3b15ae6e5344a7ea3d490 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 12 Jan 2018 13:49:45 +0200 Subject: [PATCH] Rename widgetEventsAllowed to handleWidgetEvents (#10529) --- .../connectors/grid/ColumnConnector.java | 8 ++++---- .../java/com/vaadin/client/widgets/Grid.java | 18 +++++++++--------- server/src/main/java/com/vaadin/ui/Grid.java | 16 +++++++--------- .../com/vaadin/shared/ui/grid/ColumnState.java | 2 +- .../tests/components/grid/GridComponents.java | 2 +- 5 files changed, 22 insertions(+), 24 deletions(-) diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java index 20b624892c..5d66489ed1 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java @@ -39,7 +39,7 @@ import elemental.json.JsonValue; public class ColumnConnector extends AbstractExtensionConnector { public abstract static class CustomColumn - extends Column { + extends Column { private final String connectorId; private ContentMode tooltipContentMode; @@ -195,9 +195,9 @@ public class ColumnConnector extends AbstractExtensionConnector { column.setTooltipContentMode(getState().tooltipContentMode); } - @OnStateChange("widgetEventsAllowed") - void updateWidgetEventsAllowed() { - column.setWidgetEventsAllowed(getState().widgetEventsAllowed); + @OnStateChange("handleWidgetEvents") + void updateHandleWidgetEvents() { + column.setHandleWidgetEvents(getState().handleWidgetEvents); } @Override 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 9e186ba64d..f0b309bae7 100755 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -2339,7 +2339,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, if (cell != null) { Column column = grid .getVisibleColumn(cell.getColumn()); - if (column == null || !column.isWidgetEventsAllowed()) { + if (column == null || !column.isHandleWidgetEvents()) { return; } } @@ -2463,7 +2463,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, Column column = grid .getVisibleColumn(cell.getColumn()); handleWidgetEvent = column != null - && column.isWidgetEventsAllowed(); + && column.isHandleWidgetEvents(); } } @@ -4762,7 +4762,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private String hidingToggleCaption = null; - private boolean widgetEventsAllowed = false; + private boolean handleWidgetEvents = false; private double minimumWidthPx = GridConstants.DEFAULT_MIN_WIDTH; private double maximumWidthPx = GridConstants.DEFAULT_MAX_WIDTH; @@ -5550,21 +5550,21 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, * not * @since 8.3 */ - public boolean isWidgetEventsAllowed() { - return widgetEventsAllowed; + public boolean isHandleWidgetEvents() { + return handleWidgetEvents; } /** * Sets whether Grid should handle events from Widgets in this Column. - * - * @param widgetEventsAllowed + * + * @param handleWidgetEvents * {@code true} to let grid handle events from widgets; * {@code false} to not * * @since 8.3 */ - public void setWidgetEventsAllowed(boolean widgetEventsAllowed) { - this.widgetEventsAllowed = widgetEventsAllowed; + public void setHandleWidgetEvents(boolean handleWidgetEvents) { + this.handleWidgetEvents = handleWidgetEvents; } } diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 803ac58b58..3a18de05c6 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -2065,16 +2065,14 @@ public class Grid extends AbstractListing implements HasComponents, * {@link ComboBox} or {@link TextField} it might be problematic as the * component gets re-rendered and might lose focus. * - * @param widgetEventsAllowed + * @param handleWidgetEvents * {@code true} to handle events; {@code false} to not * @return this column * @since 8.3 */ - public Column setWidgetEventsAllowed( - boolean widgetEventsAllowed) { - if (getState(false).widgetEventsAllowed != widgetEventsAllowed) { - getState().widgetEventsAllowed = widgetEventsAllowed; - } + public Column setHandleWidgetEvents( + boolean handleWidgetEvents) { + getState().handleWidgetEvents = handleWidgetEvents; return this; } @@ -2082,13 +2080,13 @@ public class Grid extends AbstractListing implements HasComponents, * Gets whether Grid is handling the events in this Column from * Component and Widgets. * - * @see #setWidgetEventsAllowed(boolean) + * @see #setHandleWidgetEvents(boolean) * * @return {@code true} if handling events; {@code false} if not * @since 8.3 */ - public boolean isWidgetEventsAllowed() { - return getState(false).widgetEventsAllowed; + public boolean isHandleWidgetEvents() { + return getState(false).handleWidgetEvents; } /** diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java index 225eff104d..9f413b432f 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/ColumnState.java @@ -37,7 +37,7 @@ public class ColumnState extends AbstractGridExtensionState { * * @since 8.3 */ - public boolean widgetEventsAllowed = false; + public boolean handleWidgetEvents = false; /** The assistive device caption for the column. */ public String assistiveCaption; diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java index df71987955..97437fbbd2 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java @@ -27,7 +27,7 @@ public class GridComponents extends AbstractTestUIWithLog { protected void setup(VaadinRequest request) { Grid grid = new Grid<>(); grid.addComponentColumn(Label::new).setId("label") - .setCaption("Column 0").setWidgetEventsAllowed(true); + .setCaption("Column 0").setHandleWidgetEvents(true); grid.getDefaultHeaderRow().getCell("label") .setComponent(new Label("Label")); grid.addComponentColumn(string -> { -- 2.39.5