2 * Copyright 2000-2018 Vaadin Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com.vaadin.v7.client.widget.grid.events;
18 import com.google.gwt.dom.client.BrowserEvents;
19 import com.vaadin.v7.client.widget.grid.CellReference;
20 import com.vaadin.v7.client.widget.grid.events.AbstractGridMouseEventHandler.GridDoubleClickHandler;
21 import com.vaadin.v7.client.widgets.Grid;
22 import com.vaadin.v7.client.widgets.Grid.AbstractGridMouseEvent;
23 import com.vaadin.v7.shared.ui.grid.GridConstants.Section;
26 * Represents native mouse double click event in Grid.
31 public class GridDoubleClickEvent
32 extends AbstractGridMouseEvent<GridDoubleClickHandler> {
34 public static final Type<GridDoubleClickHandler> TYPE = new Type<GridDoubleClickHandler>(
35 BrowserEvents.DBLCLICK, new GridDoubleClickEvent());
40 public GridDoubleClickEvent() {
44 * @deprecated This constructor's arguments are no longer used. Use the
45 * no-args constructor instead.
48 public GridDoubleClickEvent(Grid<?> grid, CellReference<?> targetCell) {
52 public Type<GridDoubleClickHandler> getAssociatedType() {
57 protected String getBrowserEventType() {
58 return BrowserEvents.DBLCLICK;
62 protected void doDispatch(GridDoubleClickHandler handler, Section section) {
63 if ((section == Section.BODY
64 && handler instanceof BodyDoubleClickHandler)
65 || (section == Section.HEADER
66 && handler instanceof HeaderDoubleClickHandler)
67 || (section == Section.FOOTER
68 && handler instanceof FooterDoubleClickHandler)) {
69 handler.onDoubleClick(this);