com.google.gwt.event.dom.client.HasFocusHandlers Java Examples
The following examples show how to use
com.google.gwt.event.dom.client.HasFocusHandlers.
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: FilterBox.java From unitime with Apache License 2.0 | 5 votes |
private void fixHandlers(final FilterBox box, Widget w) { if (w instanceof HasBlurHandlers) ((HasBlurHandlers)w).addBlurHandler(box.iBlurHandler); if (w instanceof HasFocusHandlers) ((HasFocusHandlers)w).addFocusHandler(box.iFocusHandler); if (w instanceof HasKeyDownHandlers) ((HasKeyDownHandlers)w).addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) if (box.isFilterPopupShowing()) box.hideFilterPopup(); } }); }
Example #2
Source File: InputList.java From putnami-web-toolkit with GNU Lesser General Public License v3.0 | 5 votes |
private void resetFocusHandler() { this.registrationCollection.removeHandler(); boolean hasError = this.hasErrors(); if (!hasError && !this.focused) { this.setTabIndex(0); this.registrationCollection.add(this.addFocusHandler(this)); } else if (hasError && !this.focused) { this.setTabIndex(-1); if (this.input instanceof HasFocusHandlers) { this.registrationCollection.add(((HasFocusHandlers) this.input).addFocusHandler(this)); } } else { this.setTabIndex(-1); if (this.input instanceof HasBlurHandlers) { this.registrationCollection.add(((HasBlurHandlers) this.input).addBlurHandler(this)); } Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { if (InternalListItem.this.input instanceof Focusable) { ((Focusable) InternalListItem.this.input).setFocus(true); } } }); } }
Example #3
Source File: CompositeFocusHelper.java From putnami-web-toolkit with GNU Lesser General Public License v3.0 | 5 votes |
private CompositeFocusHelper(Widget containerWidget, HasFocusHandlers... hasFocusContents) { this.containerWidget = containerWidget; containerWidget.addDomHandler(this.keyDownHandler, KeyDownEvent.getType()); if (hasFocusContents != null) { for (HasFocusHandlers hasFocus : hasFocusContents) { this.addHasFocusContent(hasFocus); } } this.handlerManager = new HandlerManager(containerWidget); }
Example #4
Source File: CompositeFocusHelper.java From putnami-web-toolkit with GNU Lesser General Public License v3.0 | 4 votes |
public void addHasFocusContent(HasFocusHandlers hasFocusContent) { if (this.hasFocusContents.add(hasFocusContent)) { hasFocusContent.addFocusHandler(this.focusHandler); } }
Example #5
Source File: CompositeFocusHelper.java From putnami-web-toolkit with GNU Lesser General Public License v3.0 | 4 votes |
public static CompositeFocusHelper createFocusHelper(IsWidget containerWidget, HasFocusHandlers... focusContents) { assert containerWidget != null : "containerWidget cannot be null"; assert containerWidget.asWidget() != null : "containerWidget.asWidget() cannot be null"; return new CompositeFocusHelper(containerWidget.asWidget(), focusContents); }