Java源码示例:com.google.gwt.event.dom.client.DoubleClickEvent
示例1
@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();
}
}
示例2
@Override
public void onDoubleClick(DoubleClickEvent event) {
if (!isEnabled() || isReadOnly()) {
return;
}
super.onDoubleClick(event);
}
示例3
public void onDoubleClick(DoubleClickEvent e){
e.preventDefault();
// if (!didSwitch && mouseElm != null)
if (mouseElm != null && !(mouseElm instanceof SwitchElm))
doEdit(mouseElm);
}
示例4
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
return addDomHandler(handler, DoubleClickEvent.getType());
}
示例5
@Override
public void onDoubleClick(DoubleClickEvent event) {
event.preventDefault();
event.stopPropagation();
select();
}
示例6
@UiHandler("btnDoubleClick")
void onDoubleClick(DoubleClickEvent e) {
MaterialToast.fireToast("Double Click Triggered");
btnDoubleClick.setText("Double Clicked");
}
示例7
@Override
void registerGwtHandler() {
addDomHandler(this, DoubleClickEvent.getType());
}
示例8
@Override
boolean dispatch(DoubleClickEvent event, Element context, WaveDoubleClickHandler handler) {
return handler.onDoubleClick(event, context);
}
示例9
@Override
public void onDoubleClick(DoubleClickEvent event) {
if (dispatch(event, event.getNativeEvent().getEventTarget().<Element>cast())) {
event.stopPropagation();
}
}
示例10
@Override
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
return addDomHandler(handler, DoubleClickEvent.getType());
}
示例11
@Override
public com.google.gwt.event.shared.HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
return this.addDomHandler(handler, DoubleClickEvent.getType());
}
示例12
@Override
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
return this.addDomHandler(handler, DoubleClickEvent.getType());
}
示例13
@Override
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
return this.addDomHandler(handler, DoubleClickEvent.getType());
}
示例14
/**
* 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;
}
}
}
示例15
@Override
void registerGwtHandler() {
addDomHandler(this, DoubleClickEvent.getType());
}
示例16
@Override
boolean dispatch(DoubleClickEvent event, Element context, WaveDoubleClickHandler handler) {
return handler.onDoubleClick(event, context);
}
示例17
@Override
public void onDoubleClick(DoubleClickEvent event) {
if (dispatch(event, event.getNativeEvent().getEventTarget().<Element>cast())) {
event.stopPropagation();
}
}
示例18
@Override
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
return addDomHandler(handler, DoubleClickEvent.getType());
}
示例19
protected void onDoubleClick(DoubleClickEvent event){
}
示例20
/**
* 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);
示例21
/**
* 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);