@Override public boolean onDoubleClick(DoubleClickEvent event, Element context) { // Ignore empty or disabled blip. if (DomUtil.findFirstChildElement(context, Type.META) == null || !isEnabled()) { return false; } // Ignore deleted blip. if (DomUtil.isQuasiDeleted(context)) { return true; } menuContextElement = context; menuContextEvent = event.getNativeEvent(); hideAndScheduleShowPopupMenu(); event.stopPropagation(); event.preventDefault(); return true; }
@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(); } }
/** * Gets the filter for a stream, creating one if one does not already exist. */ private FilterButton getStreamFilter(final String stream) { FilterButton filter = streamFilters.get(stream); if (filter == null) { // Just in case a user can cause a stream to be called "'><script // src='evil.js'></script><pre '", we only use safe values for CSS // classes. There's no need for the class names to be human readable. int streamId = streamFilters.countEntries(); String itemClass = "w-s-" + streamId; String containerClass = STREAM_FILTER_PREFIX + streamId; filter = new FilterButton(new DoubleClickHandler() { @Override public void onDoubleClick(DoubleClickEvent event) { enableOnlyOneStream(stream); } }, entries, containerClass, itemClass, stream, css.stream()); self.add(filter, streamsContainer); streamFilters.put(stream, filter); // TODO(ohler): Make styles work in IE. if (!UserAgent.isIE()) { // Replace stylesheet to make the new filter work. style.setInnerText(style.getInnerText() + filter.getCssRule()); } } return filter; }
public void onDoubleClick(DoubleClickEvent event) { ChartState chartInfo = getChartState(event); Chart chart = chartInfo.chart; chart.setAnimating(false); boolean handled = false; if (chart.maxZoomTo(getLocalX(event), getLocalY(event))) { event.stopPropagation(); event.preventDefault(); handled = true; } chartInfo.setHandled(handled); }
@Inject public TabWidget( PartStackUIResources resources, @Assisted String title, @Assisted SVGResource icon, @Assisted boolean closable) { this.resources = resources; this.title = title; this.icon = MoreObjects.firstNonNull(icon, emptySVGResource()); initWidget(UI_BINDER.createAndBindUi(this)); titleLabel.setText(title); iconPanel.add(new SVGImage(getIcon())); addDomHandler(this, ClickEvent.getType()); addDomHandler(this, DoubleClickEvent.getType()); if (closable) { closeButton.addDomHandler( event -> delegate.onTabClosing(TabWidget.this), ClickEvent.getType()); } else { closeButton.setVisible(false); } }
@Override public void onDoubleClick(DoubleClickEvent event) { Element row = getRow(event.getNativeEvent().getEventTarget().<Element>cast()); if (row != null) { movePointerTo(startRow + DOM.getChildIndex(body, row), false); onOpenRow(row); event.stopPropagation(); } }
/** * Update event caches to keep track of the latest event of each instance. * @param the event to cache */ private void updateEventCaches(Event<?> event){ if(event == null){ return; } if(event instanceof DoubleClickEvent){ doubleClickEvent = new org.gz.gwt.mousemanager.client.event.DoubleClickEvent((DoubleClickEvent)event, target); } if(event instanceof ClickEvent){ clickEvent = new org.gz.gwt.mousemanager.client.event.ClickEvent((ClickEvent)event, target); } if(event instanceof MouseUpEvent){ mouseUpEvent = new org.gz.gwt.mousemanager.client.event.MouseUpEvent((MouseUpEvent)event, target); } if(event instanceof MouseDownEvent){ mouseDownEvent = new org.gz.gwt.mousemanager.client.event.MouseDownEvent((MouseDownEvent)event, target); } if(event instanceof MouseMoveEvent){ mouseMoveEvent = new org.gz.gwt.mousemanager.client.event.MouseMoveEvent((MouseMoveEvent)event, target); } if(event instanceof MouseOverEvent){ mouseOverEvent = new org.gz.gwt.mousemanager.client.event.MouseOverEvent((MouseOverEvent)event, target); } if(event instanceof MouseOutEvent){ mouseOutEvent = new org.gz.gwt.mousemanager.client.event.MouseOutEvent((MouseOutEvent)event, target); } if(event instanceof MouseWheelEvent){ mouseWheelEvent = new org.gz.gwt.mousemanager.client.event.MouseWheelEvent((MouseWheelEvent)event, target); } if(event instanceof ContextMenuEvent){ contextMenuEvent = new org.gz.gwt.mousemanager.client.event.ContextMenuEvent(); } }
private LogPanel(Logs log) { this.log = log; initWidget(BINDER.createAndBindUi(this)); // Add filter buttons. Global filter, then log-level filters. StringBuilder rules = new StringBuilder(); rules.append(css.getText()); for (final Level level : Level.values()) { String itemClass = LEVEL_CLASSES.get(level); String containerClass = LEVEL_FILTER_PREFIX + itemClass; FilterButton levelFilter = new FilterButton(new DoubleClickHandler() { @Override public void onDoubleClick(DoubleClickEvent event) { enableOnlyMoreImportantLevels(level); } }, entries, containerClass, itemClass, level.name(), css.level()); levelFilters.put(level, levelFilter); self.add(levelFilter, levelsContainer); rules.append(levelFilter.getCssRule()); } // TODO(ohler): Make styles work in IE; the log panel consumes the entire // screen without them. In IE8, I've seen this crash in setInnerText(). if (!UserAgent.isIE()) { // Inject style. style.setInnerText(rules.toString()); Document.get().getBody().appendChild(style); } setActive(true); }
@Override public void onDoubleClick(DoubleClickEvent event) { if (dispatch(event, event.getNativeEvent().getEventTarget().<Element>cast())) { event.stopPropagation(); } }
protected HandlerRegistration addDoubleClickHandler(DoubleClickHandler doubleClickhandler) { return addDomHandler(doubleClickhandler, DoubleClickEvent.getType()); }
/** Blocks double clicking on the button and on the parent element. */ private void blockDoubleClicking() { addDomHandler( new DoubleClickHandler() { @Override public void onDoubleClick(DoubleClickEvent event) { event.stopPropagation(); event.preventDefault(); } }, DoubleClickEvent.getType()); }
@Inject public EditorTabWidget( @Assisted final EditorPartPresenter relatedEditorPart, @Assisted EditorPartStack relatedEditorPartStack, PartStackUIResources resources, EditorTabContextMenuFactory editorTabContextMenu, final EventBus eventBus, final EditorAgent editorAgent) { this.resources = resources; this.relatedEditorPart = relatedEditorPart; this.relatedEditorPartStack = relatedEditorPartStack; this.editorAgent = editorAgent; initWidget(UI_BINDER.createAndBindUi(this)); this.editorTabContextMenu = editorTabContextMenu; this.file = relatedEditorPart.getEditorInput().getFile(); this.icon = relatedEditorPart.getTitleImage(); this.title.setText(file.getDisplayName()); // add "path" attribute describing the full path of opened file, will be used full for testing this.title.getElement().setAttribute("path", file.getLocation().toString()); this.id = title + UUID.uuid(4); iconPanel.add(getIcon()); addDomHandler(this, ClickEvent.getType()); addDomHandler(this, DoubleClickEvent.getType()); addDomHandler(this, ContextMenuEvent.getType()); eventBus.addHandler(ResourceChangedEvent.getType(), this); eventBus.addHandler(FileEvent.TYPE, this); sinkEvents(Event.ONMOUSEDOWN); closeButton.addDomHandler( event -> editorAgent.closeEditor(relatedEditorPart), ClickEvent.getType()); relatedEditorPart.addPropertyListener( (source, propId) -> { if (propId == EditorPartPresenter.PROP_INPUT) { file = relatedEditorPart.getEditorInput().getFile(); title.setText(file.getDisplayName()); } }); }
@Inject public PartButtonWidget(@Assisted String title) { initWidget(UI_BINDER.createAndBindUi(this)); ensureDebugId("partButton-" + title); addDomHandler(this, DoubleClickEvent.getType()); addDomHandler(this, ClickEvent.getType()); }
private void addDoubleClick(final TablePanel table, final boolean isTags) { DoubleClickHandler dch = new DoubleClickHandler() { public void onDoubleClick(DoubleClickEvent event) { resubmitSearch(table, isTags); } }; table.addDoubleClickListner(dch); }
@Override public void onDoubleClick(DoubleClickEvent event) { if (enabled && event.getNativeButton() == NativeEvent.BUTTON_LEFT) { edit(); } }
@EventHandler("preference-tree-internal-item-label") public void contractExpand(final DoubleClickEvent event) { if (!children.getHidden()) { contract(); } else { expand(); } }
public static DoubleClickHandler createDoubleClickListener(final EventListenerGVO ev, final List<InputVariableGVO> input) { return new DoubleClickHandler() { public void onDoubleClick(DoubleClickEvent event) { Map<String,String> mouseInfo = getMouseInfo(event); CallbackHandler.createCallBack(event.getSource(), QAMLConstants.EVENT_ONDBLCLICK, ev, input, mouseInfo); } }; }
@Override public void onDoubleClick(DoubleClickEvent event) { if (valueRange.getSelectedIndex() != -1) { String value = valueRange.getValue(valueRange.getSelectedIndex()); chooser.select(stringToObject.get(value), true, true); } }
@Override public void onDoubleClick(DoubleClickEvent event) { if (event.getSource() == optionsListBox) { moveSelectedItemsLeftToRight(); optionsListBox.setSelectedIndex(-1); optionsListBox.setFocus(false); } else if (event.getSource() == selectionsListBox) { moveSelectedItemsRightToLeft(); selectionsListBox.setSelectedIndex(-1); selectionsListBox.setFocus(false); } }
public void onDoubleClick(DoubleClickEvent event) { if (event.getSource() == options) { addItem(); } else if (event.getSource() == selections) { removeItem(); } }
@Override public void onDoubleClick(DoubleClickEvent event) { if (event.getNativeButton() != Event.BUTTON_RIGHT) { handler.onDraw(geometry); } }
public void onDoubleClick(DoubleClickEvent event) { if (service.getIndexStateService().isEnabled(index)) { for (DoubleClickHandler handler : doubleClickHandlers) { handler.onDoubleClick(event); } } }
public void onDoubleClick(DoubleClickEvent event) { if (service.getEditingState() == GeometryEditState.IDLE) { idleController.onDoubleClick(event); } else if (service.getEditingState() == GeometryEditState.DRAGGING) { dragController.onDoubleClick(event); } else if (service.getEditingState() == GeometryEditState.INSERTING) { insertController.onDoubleClick(event); } }
/** * Zoom in to the double-clicked position. */ public void onDoubleClick(DoubleClickEvent event) { //Check if there was a last click that was handled in this class. if (null != lastClickPosition) { // Zoom in on the event location. Bbox bounds = mapWidget.getMapModel().getMapView().getBounds(); double x = lastClickPosition.getX() - (bounds.getWidth() / 4); double y = lastClickPosition.getY() - (bounds.getHeight() / 4); Bbox newBounds = new Bbox(x, y, bounds.getWidth() / 2, bounds.getHeight() / 2); mapWidget.getMapModel().getMapView().applyBounds(newBounds, ZoomOption.LEVEL_CHANGE); } }
/** Stop the measuring, and remove all graphics from the map. */ public void onDoubleClick(DoubleClickEvent event) { tempLength = 0; mapWidget.unregisterWorldPaintable(distanceLine); mapWidget.unregisterWorldPaintable(lineSegment); distanceLine.setGeometry(null); lineSegment.setGeometry(null); if (panel != null) { panel.destroy(); } dispatchState(State.STOP); }
@Override public void onDoubleClick(DoubleClickEvent event) { if (controller != null) { controller.onDoubleClick(event); if (!controller.isBusy()) { panController.onDoubleClick(event); } } else { panController.onDoubleClick(event); } }
public void onDoubleClick(DoubleClickEvent event) { event.stopPropagation(); }
/** * Return Event object string identifier * @param event * @return Type name of the event object */ private static String convertNativeEventToStringIdentifier(Event<?> event){ if(event == null){ return ""; } if(event instanceof DoubleClickEvent){ return DoubleClickEvent.getType().getName(); } if(event instanceof ClickEvent){ return ClickEvent.getType().getName(); } if(event instanceof MouseUpEvent){ return MouseUpEvent.getType().getName(); } if(event instanceof MouseDownEvent){ return MouseDownEvent.getType().getName(); } if(event instanceof MouseMoveEvent){ return MouseMoveEvent.getType().getName(); } if(event instanceof MouseOverEvent){ return MouseOverEvent.getType().getName(); } if(event instanceof MouseOutEvent){ return MouseOutEvent.getType().getName(); } if(event instanceof MouseWheelEvent){ return MouseWheelEvent.getType().getName(); } if(event instanceof ContextMenuEvent){ return ContextMenuEvent.getType().getName(); } return ""; }
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) { return addDomHandler(handler, DoubleClickEvent.getType()); }
@Override void registerGwtHandler() { addDomHandler(this, DoubleClickEvent.getType()); }
@Override boolean dispatch(DoubleClickEvent event, Element context, WaveDoubleClickHandler handler) { return handler.onDoubleClick(event, context); }
@Override public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) { return addDomHandler(handler, DoubleClickEvent.getType()); }
/** * Called for double-click events on the {@link DataField @DataField} {@link #contact}. This event is observed by * {@link ContactListPage#editComponent(ContactDisplay)}. */ @EventHandler("contact") public void onDoubleClick(final DoubleClickEvent event) { dblClick.fire(this); }
@Override public HandlerRegistration addDoubleClickHandler( DoubleClickHandler handler) { return addDomHandler(handler, DoubleClickEvent.getType() ); }
@Override public final HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) { return addDomHandler(handler, DoubleClickEvent.getType()); }
public void onDoubleClick(DoubleClickEvent e){ e.preventDefault(); // if (!didSwitch && mouseElm != null) if (mouseElm != null && !(mouseElm instanceof SwitchElm)) doEdit(mouseElm); }