diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2016-08-02 12:07:22 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-01-03 09:47:18 +0200 |
commit | 16220d8e6735f77cb8165e1a4d8d46c1a1be07d3 (patch) | |
tree | 58277b3b0c68d3f018eb15e03b7f4f06f13fc5bc /compatibility-client | |
parent | 21e8f88ec9e5aa14bc4ab09e09723b614edae173 (diff) | |
download | vaadin-framework-16220d8e6735f77cb8165e1a4d8d46c1a1be07d3.tar.gz vaadin-framework-16220d8e6735f77cb8165e1a4d8d46c1a1be07d3.zip |
Start client-side Grid DOM event handling refactor
Change-Id: I67dad4cfbd6e9e355c48703253ff3d6da00e4eef
Diffstat (limited to 'compatibility-client')
-rw-r--r-- | compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java | 49 |
1 files changed, 33 insertions, 16 deletions
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 a6fbfb4e76..82d599b31d 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 @@ -7324,31 +7324,34 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, eventCell.set(cell, getSectionFromContainer(container)); // Editor can steal focus from Grid and is still handled - if (isEditorEnabled() && handleEditorEvent(event, container)) { + if (handleEditorEvent(event, container)) { return; } // Fire GridKeyEvents and GridClickEvents. Pass the event to escalator. - super.onBrowserEvent(event); + if (handleSuperEvent(event, container)) { + return; + } - if (!isElementInChildWidget(e)) { + if (handleChildWidgetEvent(event, container)) { + return; + } - if (handleHeaderCellDragStartEvent(event, container)) { - return; - } + if (handleHeaderCellDragStartEvent(event, container)) { + return; + } - // Sorting through header Click / KeyUp - if (handleHeaderDefaultRowEvent(event, container)) { - return; - } + // Sorting through header Click / KeyUp + if (handleHeaderDefaultRowEvent(event, container)) { + return; + } - if (handleRendererEvent(event, container)) { - return; - } + if (handleRendererEvent(event, container)) { + return; + } - if (handleCellFocusEvent(event, container)) { - return; - } + if (handleCellFocusEvent(event, container)) { + return; } } @@ -7402,6 +7405,10 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, } private boolean handleEditorEvent(Event event, RowContainer container) { + if (!isEditorEnabled()) { + return false; + } + Widget w; if (editor.focusedColumnIndex < 0) { w = null; @@ -7415,6 +7422,16 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, return getEditor().getEventHandler().handleEvent(editorEvent); } + private boolean handleSuperEvent(Event event, RowContainer container) { + super.onBrowserEvent(event); + return false; + } + + private boolean handleChildWidgetEvent(Event event, + RowContainer container) { + return isElementInChildWidget(Element.as(event.getEventTarget())); + } + private boolean handleRendererEvent(Event event, RowContainer container) { if (container == escalator.getBody()) { |