@Override public void onMouseDown(MouseDownEvent event) { this.onMouseUp(null); Icon dragIcon = (Icon) event.getSource(); this.selectedRow = (TableRow<T>) dragIcon.getParent().getParent(); this.body = (TableEditorBody<T>) this.selectedRow.getParent(); this.overRegistration = new HandlerRegistrationCollection(); this.upRegistration = RootPanel.get().addDomHandler(this, MouseUpEvent.getType()); this.rows = Lists.newArrayList(this.body.getRows()); for (TableRow<T> row : this.rows) { this.overRegistration.add(row.addDomHandler(this, MouseOverEvent.getType())); } TableOrder.this.disableTextSelection(true); RootPanel.get().getElement().getStyle().setCursor(Style.Cursor.MOVE); StyleUtils.addStyle(this.selectedRow, TableOrder.STYLE_ROW_DRAGING); }
public void onMouseOver(final MouseOverEvent event) { HighlightedResult widget = (HighlightedResult) event.getSource(); HighlightedGroup group = widget.getHighlightedGroup(); if (group.getGroup() != null) { widget.setMouseOverEvent(event); if (!hasHighlightedChildren(widget)) { area.setSelectionRange(0, 0); int start = group.getGroup().getRegexFragment().getStart(); int length = group.getGroup().getRegexFragment().getCaptured().length + 2; if (start + length > area.getText().length()) length = area.getText().length() - start; area.setSelectionRange(start, length); } } }
@Override public void onMouseOver(MouseOverEvent event) { if( SiteManager.isUserLoggedIn() ) { //If the user is logged in, then if( SiteManager.getUserID() == userID ) { //If this is the avatar of the user who is logged in if( AvatarSpoilersHelper.isAvatarSpoilerActive( spoilerID, spoilerExpDate ) ) { //If this user is pranked he can clean his prank activateControls( false , true ); } else { //If this user is NOT pranked then there is nothing to be done activateControls( false , false ); } } else { //If this is an avatar of some other user if( AvatarSpoilersHelper.isAvatarSpoilerActive( spoilerID, spoilerExpDate ) ) { //If the other user is pranked then one can clean his prank or set a new one activateControls( true , true ); } else { //If the other user is NOT pranked then one can prank him activateControls( true , false ); } } } }
@Inject public ConsoleButtonImpl( ButtonResources resources, TooltipWidget tooltip, @NotNull @Assisted String prompt, @NotNull @Assisted SVGResource image) { this.resources = resources; this.tooltip = tooltip; this.tooltip.setDescription(prompt); resources.buttonCss().ensureInjected(); initWidget(UI_BINDER.createAndBindUi(this)); icon = new SVGImage(image); icon.getElement().setAttribute("class", resources.buttonCss().mainButtonIcon()); setCheckedStatus(false); addDomHandler(this, ClickEvent.getType()); addDomHandler(this, MouseOutEvent.getType()); addDomHandler(this, MouseOverEvent.getType()); }
private Widget getEndPointDetails(final String css, Date time, String address, final Wgs84LatLonBean position) { HTML line = new HTML(); line.addStyleName("itinerary-details-line"); line.addStyleName("itinerary-details-" + css); line.addStyleName(css + "-icon"); String html = "<span class='time'>" + FormatUtils.formatTime(time) + "</span> - " + FormatUtils.formatAddress(address); line.setHTML(html); final String infoHtml = "<div class='info-panel-" + css + " " + css + "-icon'>" + html + "</div>"; line.addMouseOverHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { if (selected) listener.onItineraryStepClicked(infoHtml, position); } }); return line; }
public void onMouseOver(MouseOverEvent event) { Widget widget = (Widget) event.getSource(); if (doHilite) { GwtUtil.setStyle(widget, "backgroundColor", hiliteBackground); GwtUtil.setStyle(widget, "border", "1px solid " + hiliteBorder); } BasicImageGrid.this.setMouseOverAt(widget); mouseOverTimer.schedule(1500); }
public void onMouseOver(MouseOverEvent event) { Widget widget = (Widget)event.getSource(); DOM.setStyleAttribute(widget.getElement(), "backgroundColor", "#bde"); DOM.setStyleAttribute(widget.getElement(), "border", "1px solid #abc"); ImageGridPanel.this.setMouseOverAt(widget); mouseOverTimer.schedule(1500); }
void createButton() { itemButton.setSize(ButtonSize.SMALL); itemButton.setType(ButtonType.LINK); configureIcon(itemButton, getDock().getImageIcon()); mouseEventHandler = new MouseEventHandler(); itemButton.addDomHandler(mouseEventHandler, MouseOverEvent.getType()); itemButton.addStyleName(CSS.CSS().sideDockItem()); itemButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (!isOpened()) { openAndExecuteExpandCommand(); } else { closeAndExecuteCommand(); } } }); }
public void setMouseEntered(JavaScriptObject aValue) { if (mouseEntered != aValue) { if (mouseOverReg != null) { mouseOverReg.removeHandler(); mouseOverReg = null; } mouseEntered = aValue; if (mouseEntered != null) { MouseOverHandler handler = new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { if (mouseEntered != null) { event.stopPropagation(); executeEvent(mouseEntered, EventsPublisher.publish(event)); } } }; if (component instanceof Widget) { mouseOverReg = ((Widget) component).addDomHandler(handler, MouseOverEvent.getType()); } else if (component instanceof HasMouseOverHandlers) { mouseOverReg = ((HasMouseOverHandlers) component).addMouseOverHandler(handler); } } } }
@SuppressWarnings("unchecked") @Override public void onMouseOver(final MouseOverEvent event) { popupHideTimer.cancel(); if (popupShowTimer != null) { popupShowTimer.cancel(); } popupShowTimer = new TypedTimer((ContextField<T>) event.getSource()); popupShowTimer.schedule(popupPanel.isShowing() ? 0 : POPUP_SHOW_DELAY); }
@SuppressWarnings("unchecked") @Override public void onClick(final ClickEvent event) { if (selectedField != null) { selectedField.setSelected(false); } if (selectedField == event.getSource()) { selectedField = null; return; } selectedField = (ContextField<T>) event.getSource(); selectedField.setSelected(true); selectedField.fireEvent(new MouseOverEvent() {}); }
private void bindHandlers() { if (this.widget == null) { return; } this.registrations.removeHandler(); switch (this.getTrigger()) { case FOCUS: this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, FocusEvent.getType())); this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, BlurEvent.getType())); break; case HOVER: this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, MouseOverEvent.getType())); this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, MouseOutEvent.getType())); break; case MANUAL: break; default: break; } }
@Override public void onMouseOver(MouseOverEvent event) { if (event.getNativeButton() == NativeEvent.BUTTON_LEFT) { this.hoverRow = (TableRow<T>) event.getSource(); this.body.switchRows(this.hoverRow, this.selectedRow); } event.preventDefault(); }
public void setAutoPlay(boolean autoPlay) { this.autoPlay = autoPlay; this.handlerRegistrations.removeHandler(); if (autoPlay) { this.autoPlayTimer.scheduleRepeating(this.timerDelay); this.handlerRegistrations.add(this.addDomHandler(this, MouseOverEvent.getType())); this.handlerRegistrations.add(this.addDomHandler(this, MouseOutEvent.getType())); } else { this.autoPlayTimer.cancel(); } }
@UiHandler("popupObjectButton") void doMouseOver(MouseOverEvent event) { if(active) { borderImage.setResource(AtomClientBundle.INSTANCE.menuPopupOver()); popupObjectButton.setStyleName(popupObjectButtonStyle.over()); panel.setStyleName(popupObjectButtonStyle.activeSpace()); } }
@Override public void addHandlers(MouseOverHandler mouseOverHandler, MouseOutHandler mouseOutHandler) { // TODO(user): Investigate why the event propagation does not work and // remove unnecessary handler setup. addDomHandler(mouseOverHandler, MouseOverEvent.getType()); addDomHandler(mouseOutHandler, MouseOutEvent.getType()); enclosingBox.addMouseOverHandler(mouseOverHandler); gadgetFrame.addMouseOverHandler(mouseOverHandler); iframeDiv.addMouseOverHandler(mouseOverHandler); gadgetIframe.addHandler(mouseOverHandler, MouseOverEvent.getType()); metaButtons.addMouseOverHandler(mouseOverHandler); metaLeft.addMouseOverHandler(mouseOverHandler); metaButtonsPanel.addMouseOverHandler(mouseOverHandler); metaRight.addMouseOverHandler(mouseOverHandler); menu.getButton().addMouseOverHandler(mouseOverHandler); }
/** * 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(); } }
public void onMouseOut(final MouseOutEvent event) { HighlightedResult widget = (HighlightedResult) event.getSource(); HighlightedGroup group = widget.getHighlightedGroup(); widget.setMouseOverEvent(null); if (group.getGroup() != null) { area.setSelectionRange(0, 0); Widget parent = widget.getParent(); while (parent instanceof HighlightedResult) { MouseOverEvent mouseOverEvent = ((HighlightedResult) parent).getMouseOverEvent(); if (mouseOverEvent != null) { final Widget finalParent = parent; onMouseOver(new MouseOverEvent() { @Override public Object getSource() { return finalParent; } }); break; } else parent = parent.getParent(); } } }
private MouseOverHandler getMouseOverhandler(final Anchor anchor) { return new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { anchor.addStyleName(ThemeStyles.get().style().borderBottom()); } }; }
private void onSocialButtonMouseOverHandler(MouseOverEvent event ) { MaterialImage source = (MaterialImage)event.getSource(); source.setBackgroundColor(Color.ORANGE); }
public void onMouseOver(MouseOverEvent event) { ChartState chartInfo = getChartState(event); Chart chart = chartInfo.chart; int x = getLocalX(event); int y = getLocalY(event); chart.setPlotFocus(x, y); boolean isMouseInPlot = false; if ((null != chart) && (null != chart.getPlot()) && (null != chart.getPlot().getBounds())) { isMouseInPlot = chart.getPlot().getBounds().inside(x, y); } chart.setCursor( isMouseInPlot ? Cursor.DRAGGABLE : Cursor.DEFAULT); //((DOMView) chart.getView()).focus(); chartInfo.setHandled(true); }
public void onMouseOver(MouseOverEvent event) { if(!AggregateUI.getUI().displayingHelpBalloons()) { return; } if(helpBalloon != null) { // hide the tool tip widget.setTitle(BasicConsts.EMPTY_STRING); // show the help balloon; helpBalloon.display(); } }
private void attachEventHandlers() { addDomHandler( event -> { if (overItem != null) { overItem.removeStyleName(resources.css().popupItemOver()); } overItem = ItemWidget.this; addStyleName(resources.css().popupItemOver()); if (childList != null) { childList.hide(); } if (dataProvider.isGroup(item)) { Pair<List<MenuItem>, String> children = dataProvider.getChildren(item); createChildPopup(children); } }, MouseOverEvent.getType()); addDomHandler( event -> { if (dataProvider.isGroup(item)) { return; } hide(true); getActionHandler().ifPresent(actionHandler -> actionHandler.onAction(item)); }, ClickEvent.getType()); }
/** {@inheritDoc} */ @Override public void onMouseOver(MouseOverEvent mouseOverEvent) { tooltip.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + TOP_TOOLTIP_SHIFT); tooltip.show(); }
private void addDomHandlers() { panel.addDomHandler(this, MouseOverEvent.getType()); panel.addDomHandler(this, MouseOutEvent.getType()); panel.addDomHandler(this, MouseDownEvent.getType()); panel.addDomHandler(this, MouseUpEvent.getType()); panel.addDomHandler(this, ClickEvent.getType()); }
@Test public void tooltipShouldBeShown() throws Exception { widget.onMouseOver(mock(MouseOverEvent.class)); verify(tooltip).setPopupPosition(0, TOP_TOOLTIP_SHIFT); verify(tooltip).show(); }
public void updateAlignWidget(Widget w) { if (hreg != null) { hreg.removeHandler(); hreg = null; } _popup.alignTo(w, PopupPane.Align.TOP_RIGHT, -15, 0); hreg = w.addDomHandler(new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { if (_dropClosed) _popup.show(); } }, MouseOverEvent.getType()); }
public void updateAlignWidget(Widget w) { if (hreg!=null) { hreg.removeHandler(); hreg= null; } popup.alignTo(w, PopupPane.Align.BOTTOM_LEFT, 0, 0); hreg= w.addDomHandler(new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { if (dropClosed) popup.show(); } },MouseOverEvent.getType() ); }
@EventHandler("headerPanel") private void onHeaderMouseOver(MouseOverEvent event) { if (!expanded) { headerPanel.setClassName("acl-header-panel-over"); mouseOver = true; } }
public static MouseOverHandler createOnMouseEnterListener(final EventListenerGVO ev, final List<InputVariableGVO> input) { return new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { Map<String,String> mouseInfo = getMouseInfo(event); CallbackHandler.createCallBack(event.getSource(), QAMLConstants.EVENT_ONMOUSE_ENTER, ev, input, mouseInfo); } }; }
/** * Creates a mouse over handler for a specific row and column. * * @param row the row number. * @param column the column number. * @return the mouse over handler. */ private MouseOverHandler createMouseOverHandler(final int row, final int column) { return new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { mouseOver(row, column); } }; }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) { eventHandlers.put(handler, (DomEvent.Type) MouseOverEvent.getType()); if (canvas != null) { canvas.addDomHandler(handler, MouseOverEvent.getType()); } return null; }
@Override public void onMouseOver(MouseOverEvent event) { if (enabled) { addStyleDependentName(CLICKABLE_ENTER); } }
public void onMouseOver(MouseOverEvent event) { if (service.getIndexStateService().isEnabled(index)) { for (MouseOverHandler handler : overHandlers) { handler.onMouseOver(event); } } }
@Override public void onMouseOver(MouseOverEvent event) { if (shape instanceof Shape) { ((Shape) shape).setFillColor("yellow"); ((Shape) shape).setStrokeColor("yellow"); ((Shape) shape).setStrokeWidth(3); } }
public void onMouseOver(MouseOverEvent event) { if (service.getEditingState() == GeometryEditState.IDLE) { idleController.onMouseOver(event); } else if (service.getEditingState() == GeometryEditState.DRAGGING) { dragController.onMouseOver(event); } else if (service.getEditingState() == GeometryEditState.INSERTING) { insertController.onMouseOver(event); } }
public void onMouseOver(MouseOverEvent event) { if (service.getEditingState() == GeometryEditState.INSERTING && isCorrectVertex()) { // Now snap the vertex to this location: if (service.getIndexService().getType(index) == GeometryIndexType.TYPE_VERTEX) { try { service.getIndexStateService().highlightBegin(Collections.singletonList(index)); Coordinate location = getSnapLocation(); service.setTentativeMoveLocation(location); } catch (GeometryIndexNotFoundException e) { throw new IllegalStateException(e); } } } }
/** * 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 ""; }