public void setKeyReleased(JavaScriptObject aValue) { if (keyReleased != aValue) { if (keyUpReg != null) { keyUpReg.removeHandler(); keyUpReg = null; } keyReleased = aValue; if (keyReleased != null && component instanceof HasKeyUpHandlers) { keyUpReg = ((HasKeyUpHandlers) component).addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { if (keyReleased != null) { event.stopPropagation(); executeEvent(keyReleased, EventsPublisher.publish(event)); } } }); } } }
/** * initialize one editor. * * @param editor editor to initialize */ @SuppressWarnings({"rawtypes", "unchecked"}) public void initializeEditors(final Object editor) { if (editor instanceof HasValueChangeHandlers && this.valueChangeHandler != null) { ((HasValueChangeHandlers) editor).addValueChangeHandler(this.valueChangeHandler); // if widget has a value change handler, validate on change if (this.validateOnVueChangeHandler != null) { ((HasValueChangeHandlers) editor).addValueChangeHandler(this.validateOnVueChangeHandler); } } // if widget has a key up handler, validate on key up if (editor instanceof HasKeyUpHandlers && this.validateOnKeyUpHandler != null) { ((HasKeyUpHandlers) editor).addKeyUpHandler(this.validateOnKeyUpHandler); } // try to submit form on return if (editor instanceof HasKeyPressHandlers && this.commitOnReturnHandler != null) { ((HasKeyPressHandlers) editor).addKeyPressHandler(this.commitOnReturnHandler); } }
public void setEditor( T editor, boolean fShowCancel ) { m_table.clear(); m_editor = editor; if( m_editor != null ) { m_table.setWidget( 0, 0, m_editor ); if( m_editor instanceof HasKeyUpHandlers ) ((HasKeyUpHandlers) m_editor).addKeyUpHandler( this ); if( m_editor instanceof Focusable ) ((Focusable) m_editor).setFocus( true ); } m_table.setWidget( 0, 1, m_okBut ); if( fShowCancel ) m_table.setWidget( 0, 2, m_cancelBut ); }
/** * Sets the KeyUp() event handler in many widgets * @param handler the handler * @param widgets the widgets */ public static void addKeyUpHandler(final KeyUpHandler handler,final HasKeyUpHandlers... widgets) { if (handler != null && widgets != null && widgets.length > 0) { for (HasKeyUpHandlers w : widgets) { if (w != null) w.addKeyUpHandler(handler); } } }
@Override public HandlerRegistration addKeyUpHandler(final KeyUpHandler pkeyUpHandler) { if (this.contents.getWidget() instanceof HasKeyUpHandlers) { return ((HasKeyUpHandlers) this.contents.getWidget()).addKeyUpHandler(pkeyUpHandler); } else { return null; } }
private static Observable<KeyUpEvent> keyUp(HasKeyUpHandlers source) { return Observable.create(s -> register(s, source.addKeyUpHandler(s::onNext))); }
public HasKeyUpHandlers getUserUrlKeyUpHandlers() { return user_textbox; }
HasKeyUpHandlers getUserUrlKeyUpHandlers();