|
I have addKeyDownHandler. Follows model i have used this.addKeyDownHandler(new KeyDownHandler() { public void onKeyDown(KeyDownEvent event) { int teclado = event.getNativeEvent().getKeyCode(); int limite = 0; if (getValorAtual() != null) { limite = getValorAtual().length(); } if ((teclado == KeyCodes.KEY_DELETE)) { getValorAtual().delete(0, limite); clearValor(null); formataConteudo(); } else if (teclado == KeyCodes.KEY_BACKSPACE) { ((TextBox) event.getSource()).cancelKey(); if (limite > 0) { getValorAtual().delete((limite - 1), limite); // senão é negativo, então segue o antigo if (getValorAtual().indexOf("-") < 0) { if (getValorAtual().length() == getScala()) { getValorAtual().insert(0, "0"); } } else { if (getValorAtual().length() == getScala() || getValorAtual().length() == (getScala() + 1)) { getValorAtual().insert(1, "0"); } if (getValorAtual().toString() .equals("-" + zeroDecimal(getScala() + 1))) { getValorAtual().deleteCharAt(0); } } } formataConteudo(); } } }); Em 01/02/2017 13:25, Ed escreveu:
-- You received this message because you are subscribed to the Google Groups "GWT Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout. |
- GST 2.8 Keyboard Handler Question Ed
- Re: GST 2.8 Keyboard Handler Question natan clara
- GST 2.8 Keyboard Handler Question Thomas Broyer
