protected void setupDelegatingMouseUpHandler() { widgetContainer.addDomHandler(new MouseUpHandler() { @Override public void onMouseUp(final MouseUpEvent event) { gridLayer.onNodeMouseUp(new NodeMouseUpEvent(event) { @Override public int getX() { //Adjust the x-coordinate (relative to the DOM Element) to be relative to the GridCanvas. return super.getX() + widgetContainer.getElement().getOffsetLeft(); } @Override public int getY() { //Adjust the y-coordinate (relative to the DOM Element) to be relative to the GridCanvas. return super.getY() + widgetContainer.getElement().getOffsetTop(); } }); } }, MouseUpEvent.getType()); }
private void addEntryExamplePanelHandler() { this.explanationView.addEntryExamplePanelHandler(new MouseUpHandler() { @Override public void onMouseUp(MouseUpEvent event) { entryDescriptionSoundController.playOrStopEntrySound(entry.getEntrySound()); } }); }
/** * Constructs a {@PopupMenuItem} * * @param text The text label for the item. * @param cmd The command to run when the item is clicked. * @param isEnabled True if this menu item is enabled. * @param hide True if clicking this menu item should hide the popup. */ public PopupMenuItem(String text, Command command, boolean isEnabled, boolean hide) { super(text, false); this.command = command; this.defaultEnabled = isEnabled; this.hide = hide; setStyleName(CSS.item()); if (isPreClicked) { // If this menu is pre-clicked it doesn't require a full click to select // an item, just a mouseup over the item. If the user then does click the // item then that will also give a mouseup so this handler will deal with // that case as well. addMouseUpHandler(new MouseUpHandler() { @Override public void onMouseUp(MouseUpEvent event) { onClicked(); } }); } else { addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent e) { onClicked(); } }); } // Ensure that clicking this menu item doesn't affect the current selection. addMouseDownHandler(PREVENT_DEFAULT_HANDLER); }
@Override public void onBrowserEvent(Event event) { switch(DOM.eventGetType(event)){ case Event.ONMOUSEUP: case Event.ONMOUSEOVER: case Event.ONCLICK: for(MouseUpHandler h:mouseListeners){ h.onMouseUp(null); } } }
private void attachDragProxyHandlers(final LienzoPanel floatingPanel, final ShapeDragProxy proxy) { final Style style = floatingPanel.getElement().getStyle(); final HandlerRegistration[] handlerRegs = new HandlerRegistration[2]; //MouseMoveEvents handlerRegs[0] = RootPanel.get().addDomHandler(new MouseMoveHandler() { @Override public void onMouseMove(final MouseMoveEvent mouseMoveEvent) { style.setLeft(mouseMoveEvent.getX() - (floatingPanel.getWidth() / 2), Style.Unit.PX); style.setTop(mouseMoveEvent.getY() - (floatingPanel.getHeight() / 2), Style.Unit.PX); proxy.onDragPreview(mouseMoveEvent.getX(), mouseMoveEvent.getY()); } }, MouseMoveEvent.getType()); //MouseUpEvent handlerRegs[1] = RootPanel.get().addDomHandler(new MouseUpHandler() { @Override public void onMouseUp(final MouseUpEvent mouseUpEvent) { handlerRegs[0].removeHandler(); handlerRegs[1].removeHandler(); RootPanel.get().remove(floatingPanel); proxy.onDragComplete(mouseUpEvent.getX(), mouseUpEvent.getY()); } }, MouseUpEvent.getType()); }
public void setMouseReleased(JavaScriptObject aValue) { if (mouseReleased != aValue) { if (mouseUpReg != null) { mouseUpReg.removeHandler(); mouseUpReg = null; } mouseReleased = aValue; if (mouseReleased != null) { MouseUpHandler handler = new MouseUpHandler() { @Override public void onMouseUp(MouseUpEvent event) { // if (mouseState == MOUSE.PRESSED) // Event.releaseCapture(event.getRelativeElement()); if (mouseReleased != null) { event.stopPropagation(); mouseState = MOUSE.NULL; executeEvent(mouseReleased, EventsPublisher.publish(event)); } } }; if (component instanceof Widget) mouseUpReg = ((Widget) component).addDomHandler(handler, MouseUpEvent.getType()); else if (component instanceof HasMouseUpHandlers) mouseUpReg = ((HasMouseUpHandlers) component).addMouseUpHandler(handler); } } }
public static MouseUpHandler createOnMouseUpListener(final EventListenerGVO ev, final List<InputVariableGVO> input) { return new MouseUpHandler() { public void onMouseUp(MouseUpEvent event) { Map<String,String> mouseInfo = getMouseInfo(event); CallbackHandler.createCallBack(event.getSource(), QAMLConstants.EVENT_ONMOUSE_UP, ev, input, mouseInfo); } }; }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { eventHandlers.put(handler, (DomEvent.Type) MouseUpEvent.getType()); if (canvas != null) { canvas.addDomHandler(handler, MouseUpEvent.getType()); } return null; }
/** * Constructs a {@PopupMenuItem} * * @param text The text label for the item. * @param cmd The command to run when the item is clicked. * @param isEnabled True if this menu item is enabled. * @param hide True if clicking this menu item should hide the popup. */ public PopupMenuItem(String text, Command cmd, boolean isEnabled, boolean hide) { super(text); setStyleName(RESOURCES.css().item()); setEnabled(isEnabled); defaultEnabled = isEnabled; command = cmd; this.hide = hide; if (isPreClicked) { // If this menu is pre-clicked it doesn't require a full click to select // an item, just a mouseup over the item. If the user then does click the // item then that will also give a mouseup so this handler will deal with // that case as well. addMouseUpHandler(new MouseUpHandler() { @Override public void onMouseUp(MouseUpEvent event) { onClicked(); } }); } else { addClickHandler(new ClickHandler() { public void onClick(ClickEvent e) { onClicked(); } }); } // Ensure that clicking this menu item doesn't affect the current selection. addMouseDownHandler(PREVENT_DEFAULT_HANDLER); }
@Override public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return addDomHandler(handler, MouseUpEvent.getType()); }
private void attachDragProxyHandlers( final LienzoPanel floatingPanel, final ShapeDragProxy proxy ) { final Style style = floatingPanel.getElement().getStyle(); final HandlerRegistration[] handlerRegs = new HandlerRegistration[ 2 ]; //MouseMoveEvents handlerRegs[ 0 ] = RootPanel.get().addDomHandler( new MouseMoveHandler() { @Override public void onMouseMove( final MouseMoveEvent mouseMoveEvent ) { style.setLeft( mouseMoveEvent.getX() - ( floatingPanel.getWidth() / 2 ), Style.Unit.PX ); style.setTop( mouseMoveEvent.getY() - ( floatingPanel.getHeight() / 2 ), Style.Unit.PX ); proxy.onDragPreview( mouseMoveEvent.getX(), mouseMoveEvent.getY() ); } }, MouseMoveEvent.getType() ); //MouseUpEvent handlerRegs[ 1 ] = RootPanel.get().addDomHandler( new MouseUpHandler() { @Override public void onMouseUp( final MouseUpEvent mouseUpEvent ) { handlerRegs[ 0 ].removeHandler(); handlerRegs[ 1 ].removeHandler(); RootPanel.get().remove( floatingPanel ); proxy.onDragComplete( mouseUpEvent.getX(), mouseUpEvent.getY() ); } }, MouseUpEvent.getType() ); }
@Override public void addEntryExamplePanelHandler(MouseUpHandler handler) { entryExamplePanel.asWidget().addHandler(handler, MouseUpEvent.getType()); }
@Override public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return addHandler(handler, MouseUpEvent.getType()); }
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return addDomHandler(handler, MouseUpEvent.getType()); }
public void addMouseUpHandler(MouseUpHandler handler){ mouseListeners.add(handler); }
public void removeMouseUpHandler(MouseUpHandler handler){ mouseListeners.remove(handler); }
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return html.addMouseUpHandler(handler); }
@Override public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) { return this.addDomHandler(handler, MouseUpEvent.getType()); }
@Test public void testAddMouseUpHandler() { final ArgumentCaptor<MouseUpHandler> handler = ArgumentCaptor.forClass(MouseUpHandler.class); final MouseUpEvent mouseUpEvent = mock(MouseUpEvent.class); final HandlerRegistration registration = mock(HandlerRegistration.class); doReturn(registration).when(gridLienzoPanel).addMouseUpHandler(handler.capture()); doNothing().when(gridLienzoPanel).refreshScrollPosition(); gridLienzoPanel.addMouseUpHandler(); handler.getValue().onMouseUp(mouseUpEvent); verify(gridLienzoPanel).refreshScrollPosition(); }
public HandlerRegistration addCellMouseUpHandler( final MouseUpHandler handler ) { return addDomHandler( handler, MouseUpEvent.getType() ); }
@Override public com.google.gwt.event.shared.HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return this.addDomHandler(handler, MouseUpEvent.getType()); }
@Override public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return this.addDomHandler(handler, MouseUpEvent.getType()); }
@Override public void showSuggestions(Oracle.Request request, final IsWidget textInput, Collection<? extends Suggestion<T>> suggestions, final SuggestionCallback<T> callback) { boolean anySuggestions = suggestions != null && !suggestions.isEmpty(); if (!anySuggestions && this.hideWhenEmpty) { this.hideSuggestions(); return; } if (this.suggestionPopup.isAttached()) { this.suggestionPopup.hide(); } this.suggestionsContainer.clear(); SuggestionItem<T> selected = null; for (final Oracle.Suggestion<T> currentSuggestion : suggestions) { String display = highlighter.highlight(currentSuggestion.getValue(), request.getQuery()); final SuggestionItem<T> suggestionItem = new SuggestionItem<T>(currentSuggestion, display); if (selected == null) { selected = suggestionItem; } if (this.selectedItem != null && currentSuggestion.equals(this.selectedItem.suggestion)) { selected = suggestionItem; } suggestionItem.addDomHandler(new MouseUpHandler() { @Override public void onMouseUp(MouseUpEvent event) { if (textInput instanceof Focusable) { ((Focusable) textInput).setFocus(true); } SuggestionDisplayImpl.this.setSuggestionItemSelected(suggestionItem); callback.onSuggestionSelected(suggestionItem.suggestion); } }, MouseUpEvent.getType()); this.suggestionsContainer.append(suggestionItem); } this.setSuggestionItemSelected(selected); if (this.lastTextInput != textInput) { if (this.lastTextInput != null) { this.suggestionPopup.removeAutoHidePartner(this.lastTextInput.asWidget().getElement()); } this.lastTextInput = textInput; this.suggestionPopup.addAutoHidePartner(this.lastTextInput.asWidget().getElement()); } this.suggestionPopup.showRelativeTo(this.lastTextInput.asWidget()); this.scrollToSelected(); }
@Override public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return addMouseUpHandler(handler); }
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return widget.addMouseUpHandler(handler); }
@Override public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) { return addDomHandler(handler, MouseUpEvent.getType()); }
@Override public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return addDomHandler(handler, com.google.gwt.event.dom.client.MouseUpEvent.getType()); }
void addEntryExamplePanelHandler(MouseUpHandler mouseUpHandler);