]> source.dussan.org Git - vaadin-framework.git/commitdiff
Rename widgetEventsAllowed to handleWidgetEvents (#10529)
authorLeif Åstrand <legioth@gmail.com>
Fri, 12 Jan 2018 11:49:45 +0000 (13:49 +0200)
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>
Fri, 12 Jan 2018 11:49:45 +0000 (13:49 +0200)
client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.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/ColumnState.java
uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java

index 20b624892ca341db75936ab8f98e2e12f46f3dbd..5d66489ed15dc3719208eefd22bf889c13b010e2 100644 (file)
@@ -39,7 +39,7 @@ import elemental.json.JsonValue;
 public class ColumnConnector extends AbstractExtensionConnector {
 
     public abstract static class CustomColumn
-            extends Column<Object, JsonObject> {
+    extends Column<Object, JsonObject> {
 
         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
index 9e186ba64d3bf7fb412108bfe192be5089990bec..f0b309bae70615036b1b86bc238b445f00c45b32 100755 (executable)
@@ -2339,7 +2339,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
                     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<T> extends ResizeComposite implements HasSelectionHandlers<T>,
                     Column<?, ?> column = grid
                             .getVisibleColumn(cell.getColumn());
                     handleWidgetEvent = column != null
-                            && column.isWidgetEventsAllowed();
+                            && column.isHandleWidgetEvents();
                 }
             }
 
@@ -4762,7 +4762,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
 
         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<T> extends ResizeComposite implements HasSelectionHandlers<T>,
          *         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;
         }
 
     }
index 803ac58b587a15b0c318f6b5eedbd89e81542488..3a18de05c690edc36974d694fd134da3555c3ec7 100644 (file)
@@ -2065,16 +2065,14 @@ public class Grid<T> extends AbstractListing<T> 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<T, V> setWidgetEventsAllowed(
-                boolean widgetEventsAllowed) {
-            if (getState(false).widgetEventsAllowed != widgetEventsAllowed) {
-                getState().widgetEventsAllowed = widgetEventsAllowed;
-            }
+        public Column<T, V> setHandleWidgetEvents(
+                boolean handleWidgetEvents) {
+            getState().handleWidgetEvents = handleWidgetEvents;
             return this;
         }
 
@@ -2082,13 +2080,13 @@ public class Grid<T> extends AbstractListing<T> 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;
         }
 
         /**
index 225eff104d2ed00d3893d55449da81b9dc39afb0..9f413b432f69883e6676eb63f800af7e4350c26b 100644 (file)
@@ -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;
index df719879558ef658978913d303c6ce5603d8b166..97437fbbd2c95c47929b93e37a84b294547ab8f9 100644 (file)
@@ -27,7 +27,7 @@ public class GridComponents extends AbstractTestUIWithLog {
     protected void setup(VaadinRequest request) {
         Grid<String> 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 -> {