public void onBrowserEvent(Event event) { int eventType = DOM.eventGetType(event); int keyCode = DOM.eventGetKeyCode(event); switch (eventType) { case Event.ONKEYDOWN: { if (isCantidadKey(keyCode)) { char newChar = ((char) convert(keyCode)); setText(getText() + String.valueOf(newChar)); DOM.eventPreventDefault(event); return; } } default: super.onBrowserEvent(event); } }
@Override public void onBrowserEvent(Event event) { super.onBrowserEvent(event); owner.updateAutoHide(event); }