Java Code Examples for com.google.gwt.user.client.Event#ONFOCUS
The following examples show how to use
com.google.gwt.user.client.Event#ONFOCUS .
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: CubaFileUploadWidget.java From cuba with Apache License 2.0 | 5 votes |
@Override public void onBrowserEvent(Event event) { super.onBrowserEvent(event); int type = DOM.eventGetType(event); if (getFileInputElement().isOrHasChild(Element.as(event.getEventTarget()))) { if (type == Event.ONFOCUS) { submitButton.addStyleDependentName("focus"); } else if (type == Event.ONBLUR) { submitButton.removeStyleDependentName("focus"); } } }
Example 2
Source File: AriaSuggestBox.java From unitime with Apache License 2.0 | 5 votes |
@Override public void onBrowserEvent(Event event) { switch (DOM.eventGetType(event)) { case Event.ONBLUR: BlurEvent.fireNativeEvent(event, this); break; case Event.ONFOCUS: FocusEvent.fireNativeEvent(event, this); break; } super.onBrowserEvent(event); }
Example 3
Source File: TimeSelector.java From unitime with Apache License 2.0 | 5 votes |
@Override public void onBrowserEvent(Event event) { switch (DOM.eventGetType(event)) { case Event.ONBLUR: BlurEvent.fireNativeEvent(event, this); break; case Event.ONFOCUS: FocusEvent.fireNativeEvent(event, this); break; } super.onBrowserEvent(event); }
Example 4
Source File: EventWrapper.java From swellrt with Apache License 2.0 | 5 votes |
public static String asString(Event event) { // Start with the event type string String string = DOM.eventGetTypeString(event); // Next type-specific fields switch (event.getTypeInt()) { case Event.ONKEYPRESS: case Event.ONKEYUP: case Event.ONKEYDOWN: string += key(event) + modifiers(event); break; case Event.ONCLICK: case Event.ONDBLCLICK: case Event.ONMOUSEMOVE: string += mousePoint(event) + modifiers(event); break; case Event.ONMOUSEDOWN: case Event.ONMOUSEUP: string += mousePoint(event) + mouseButtons(event) + modifiers(event); break; case Event.ONMOUSEOUT: string += mousePoint(event) + modifiers(event) + " to: " + getToElement(event); break; case Event.ONMOUSEOVER: string += mousePoint(event) + modifiers(event) + " from: " + getFromElement(event); break; case Event.ONMOUSEWHEEL: string += " " + getMouseWheelVelocityY(event) + mousePoint(event) + modifiers(event); break; case Event.ONFOCUS: case Event.ONBLUR: case Event.ONCHANGE: case Event.ONERROR: case Event.ONLOAD: case Event.ONLOSECAPTURE: case Event.ONSCROLL: break; } return string; }
Example 5
Source File: CompositeFocusHelper.java From putnami-web-toolkit with GNU Lesser General Public License v3.0 | 5 votes |
private void previewNativeEvent(NativePreviewEvent event) { if (event.isCanceled() || event.isConsumed()) { event.cancel(); return; } boolean eventTargetsContainerOrPartner = this.eventTargetsContainerOrPartner(event); int type = event.getTypeInt(); switch (type) { case Event.ONMOUSEDOWN: case Event.ONTOUCHSTART: if (!eventTargetsContainerOrPartner) { this.blur(); return; } break; case Event.ONFOCUS: // Not used because focus events are not previewed yet if (!eventTargetsContainerOrPartner) { this.blur(); } else { this.focus(); } break; default: break; } }
Example 6
Source File: EventWrapper.java From incubator-retired-wave with Apache License 2.0 | 5 votes |
public static String asString(Event event) { // Start with the event type string String string = DOM.eventGetTypeString(event); // Next type-specific fields switch (event.getTypeInt()) { case Event.ONKEYPRESS: case Event.ONKEYUP: case Event.ONKEYDOWN: string += key(event) + modifiers(event); break; case Event.ONCLICK: case Event.ONDBLCLICK: case Event.ONMOUSEMOVE: string += mousePoint(event) + modifiers(event); break; case Event.ONMOUSEDOWN: case Event.ONMOUSEUP: string += mousePoint(event) + mouseButtons(event) + modifiers(event); break; case Event.ONMOUSEOUT: string += mousePoint(event) + modifiers(event) + " to: " + getToElement(event); break; case Event.ONMOUSEOVER: string += mousePoint(event) + modifiers(event) + " from: " + getFromElement(event); break; case Event.ONMOUSEWHEEL: string += " " + getMouseWheelVelocityY(event) + mousePoint(event) + modifiers(event); break; case Event.ONFOCUS: case Event.ONBLUR: case Event.ONCHANGE: case Event.ONERROR: case Event.ONLOAD: case Event.ONLOSECAPTURE: case Event.ONSCROLL: break; } return string; }