com.google.gwt.event.dom.client.DoubleClickEvent Java Examples

The following examples show how to use com.google.gwt.event.dom.client.DoubleClickEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GanttWidget.java    From gantt with Apache License 2.0 6 votes vote down vote up
@Override
public void onDoubleClick(DoubleClickEvent event) {
    GWT.log("onDoubleClick(DoubleClickEvent)");
    if (event.getNativeButton() == NativeEvent.BUTTON_LEFT) {
        doubleClickDetectionMaxTimer.cancel();
        if (!insideDoubleClickDetectionInterval && numberOfMouseClicksDetected < 2) {
            return; // ignore double-click
        }
        if (targetBarElement != null) {
            disableClickOnNextMouseUp();
            targetBarElement = null;
        }
        Element bar = getBar(event.getNativeEvent());
        if (bar != null && numberOfMouseClicksDetected > 1) {
            fireClickRpc(bar, event.getNativeEvent());
        }
        cancelDoubleClickDetection();
    }
}
 
Example #2
Source File: CubaTwinColSelectWidget.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void onDoubleClick(DoubleClickEvent event) {
    if (!isEnabled() || isReadOnly()) {
        return;
    }

    super.onDoubleClick(event);
}
 
Example #3
Source File: ImplPanel.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
  return addDomHandler(handler, DoubleClickEvent.getType());
}
 
Example #4
Source File: ImplPanel.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
  return addDomHandler(handler, DoubleClickEvent.getType());
}
 
Example #5
Source File: EventDispatcherPanel.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
@Override
public void onDoubleClick(DoubleClickEvent event) {
  if (dispatch(event, event.getNativeEvent().getEventTarget().<Element>cast())) {
    event.stopPropagation();
  }
}
 
Example #6
Source File: EventDispatcherPanel.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
@Override
boolean dispatch(DoubleClickEvent event, Element context, WaveDoubleClickHandler handler) {
  return handler.onDoubleClick(event, context);
}
 
Example #7
Source File: EventDispatcherPanel.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
@Override
void registerGwtHandler() {
  addDomHandler(this, DoubleClickEvent.getType());
}
 
Example #8
Source File: GanttWidget.java    From gantt with Apache License 2.0 4 votes vote down vote up
/**
 * Reset listeners.
 */
public void resetListeners() {
    Event.sinkEvents(container, Event.ONSCROLL | Event.ONCONTEXTMENU);

    if (contextMenuHandlerRegistration == null) {
        contextMenuHandlerRegistration = addDomHandler(contextMenuHandler, ContextMenuEvent.getType());
    }

    if (scrollHandlerRegistration == null) {
        scrollHandlerRegistration = addHandler(scrollHandler, ScrollEvent.getType());
    }
    if (isMsTouchSupported()) {
        // IE10 pointer events (ms-prefixed events)
        if (pointerDownHandlerRegistration == null) {
            pointerDownHandlerRegistration = addDomHandler(msPointerDownHandler, PointerDownEvent.getType());
        }
        if (pointerUpHandlerRegistration == null) {
            pointerUpHandlerRegistration = addDomHandler(msPointerUpHandler, PointerUpEvent.getType());
        }
        if (pointerMoveHandlerRegistration == null) {
            pointerMoveHandlerRegistration = addDomHandler(msPointerMoveHandler, PointerMoveEvent.getType());
        }
        if (pointerCancelHandlerRegistration == null) {
            pointerCancelHandlerRegistration = addHandler(msPointerCancelHandler, PointerCancelEvent.getType());
        }
    } else if (touchSupported) {
        // touch events replaces mouse events
        if (touchStartHandlerRegistration == null) {
            touchStartHandlerRegistration = addDomHandler(touchStartHandler, TouchStartEvent.getType());
        }
        if (touchEndHandlerRegistration == null) {
            touchEndHandlerRegistration = addDomHandler(touchEndHandler, TouchEndEvent.getType());
        }
        if (touchMoveHandlerRegistration == null) {
            touchMoveHandlerRegistration = addDomHandler(touchMoveHandler, TouchMoveEvent.getType());
        }
        if (touchCancelHandlerRegistration == null) {
            touchCancelHandlerRegistration = addHandler(touchCancelHandler, TouchCancelEvent.getType());
        }

    } else {
        if (mouseDblClickHandlerRegistration == null) {
            mouseDblClickHandlerRegistration = addDomHandler(doubleClickHandler, DoubleClickEvent.getType());
        }
        if (mouseDownHandlerRegistration == null) {
            mouseDownHandlerRegistration = addDomHandler(mouseDownHandler, MouseDownEvent.getType());
        }
        if (mouseUpHandlerRegistration == null) {
            mouseUpHandlerRegistration = addDomHandler(mouseUpHandler, MouseUpEvent.getType());
        }
        if (isMovableSteps() || isResizableSteps()) {
            if (mouseMoveHandlerRegistration == null) {
                mouseMoveHandlerRegistration = addDomHandler(mouseMoveHandler, MouseMoveEvent.getType());
            }
        } else if (mouseMoveHandlerRegistration != null) {
            mouseMoveHandlerRegistration.removeHandler();
            mouseMoveHandlerRegistration = null;
        }
    }
}
 
Example #9
Source File: Anchor.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
	return this.addDomHandler(handler, DoubleClickEvent.getType());
}
 
Example #10
Source File: ListItem.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
	return this.addDomHandler(handler, DoubleClickEvent.getType());
}
 
Example #11
Source File: AbstractInput.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public com.google.gwt.event.shared.HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
	return this.addDomHandler(handler, DoubleClickEvent.getType());
}
 
Example #12
Source File: CirSim.java    From circuitjs1 with GNU General Public License v2.0 4 votes vote down vote up
public void onDoubleClick(DoubleClickEvent e){
   	e.preventDefault();
//   	if (!didSwitch && mouseElm != null)
   	if (mouseElm != null && !(mouseElm instanceof SwitchElm))
   		doEdit(mouseElm);
   }
 
Example #13
Source File: EventDispatcherPanel.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@Override
public void onDoubleClick(DoubleClickEvent event) {
  if (dispatch(event, event.getNativeEvent().getEventTarget().<Element>cast())) {
    event.stopPropagation();
  }
}
 
Example #14
Source File: EventDispatcherPanel.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@Override
boolean dispatch(DoubleClickEvent event, Element context, WaveDoubleClickHandler handler) {
  return handler.onDoubleClick(event, context);
}
 
Example #15
Source File: EventDispatcherPanel.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@Override
void registerGwtHandler() {
  addDomHandler(this, DoubleClickEvent.getType());
}
 
Example #16
Source File: ButtonsView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnDoubleClick")
void onDoubleClick(DoubleClickEvent e) {
    MaterialToast.fireToast("Double Click Triggered");
    btnDoubleClick.setText("Double Clicked");
}
 
Example #17
Source File: SuggestPopup.java    From cuba with Apache License 2.0 4 votes vote down vote up
@Override
public void onDoubleClick(DoubleClickEvent event) {
	event.preventDefault();
	event.stopPropagation();
	select();
}
 
Example #18
Source File: HandlerPanel.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
  return addDomHandler(handler, DoubleClickEvent.getType());
}
 
Example #19
Source File: WaveDoubleClickHandler.java    From swellrt with Apache License 2.0 2 votes vote down vote up
/**
 * Handles a double-click event.
 *
 * @param event The event object from the browser.
 * @param context The target element whose kind is handled by this handler
 * @return true if the event is handled and should not continue to bubble,
 *         false otherwise.
 */
boolean onDoubleClick(DoubleClickEvent event, Element context);
 
Example #20
Source File: WaveDoubleClickHandler.java    From incubator-retired-wave with Apache License 2.0 2 votes vote down vote up
/**
 * Handles a double-click event.
 *
 * @param event The event object from the browser.
 * @param context The target element whose kind is handled by this handler
 * @return true if the event is handled and should not continue to bubble,
 *         false otherwise.
 */
boolean onDoubleClick(DoubleClickEvent event, Element context);
 
Example #21
Source File: DiagramController.java    From EasyML with Apache License 2.0 2 votes vote down vote up
protected  void onDoubleClick(DoubleClickEvent event){

	}