@Test public void testKeyCodeMapping() { final int[] keyCode = { -1 }; box.addKeyDownHandler(new KeyDownHandler() { public void onKeyDown(KeyDownEvent event) { keyCode[0] = event.getNativeKeyCode(); } }); box.press("a"); assertThat(keyCode[0], is(65)); box.press("B"); assertThat(keyCode[0], is(66)); }
@Override public void press(int keyCode) { String oldValue = getValue(); super.press(keyCode); ValueChangeEvent.fireIfNotEqual(this, oldValue, getValue()); blur(); }
StubTextBoxBase extends StubValueBoxBase<String> implements IsTextBoxBase { @Override public void press(int keyCode) { String oldValue = getValue(); super.press(keyCode); ValueChangeEvent.fireIfNotEqual(this, oldValue, getValue()); blur(); } }
StubTextBoxBase extends StubValueBoxBase<String> implements IsTextBoxBase { @Override public void press(int keyCode) { String oldValue = getValue(); super.press(keyCode); ValueChangeEvent.fireIfNotEqual(this, oldValue, getValue()); blur(); } StubTextBoxBase(); }
StubTextBoxBase extends StubValueBoxBase<String> implements IsTextBoxBase { @Override public void press(int keyCode) { String oldValue = getValue(); super.press(keyCode); ValueChangeEvent.fireIfNotEqual(this, oldValue, getValue()); blur(); } StubTextBoxBase(); void type(final String value); void typeEachWithoutBlur(String value); void typeEach(String value); @Override int getMaxLength(); @Override void setMaxLength(final int length); @Override void keyUp(int keyCode, StubKeyModifiers mods); @Override void keyPress(char c, StubKeyModifiers mods); @Override void press(int keyCode); @Override void press(char charCode); @Override void setValue(String value, final boolean fireEvents); @Override void setTextAlignment(final TextAlignConstant align); @Override void setText(String value); @Override String getText(); @Override TextBoxBase asWidget(); @Override String getPlaceholder(); @Override void setPlaceholder(String placeholder); }
StubTextBoxBase extends StubValueBoxBase<String> implements IsTextBoxBase { @Override public void press(int keyCode) { String oldValue = getValue(); super.press(keyCode); ValueChangeEvent.fireIfNotEqual(this, oldValue, getValue()); blur(); } StubTextBoxBase(); void type(final String value); void typeEachWithoutBlur(String value); void typeEach(String value); @Override int getMaxLength(); @Override void setMaxLength(final int length); @Override void keyUp(int keyCode, StubKeyModifiers mods); @Override void keyPress(char c, StubKeyModifiers mods); @Override void press(int keyCode); @Override void press(char charCode); @Override void setValue(String value, final boolean fireEvents); @Override void setTextAlignment(final TextAlignConstant align); @Override void setText(String value); @Override String getText(); @Override TextBoxBase asWidget(); @Override String getPlaceholder(); @Override void setPlaceholder(String placeholder);  }