/** * Automatically adjusts hasDirection's direction on KeyUpEvent events. * Implementation of KeyUpHandler interface method. */ public void onKeyUp(KeyUpEvent event) { refreshDirection(); }
@Override protected void onLoad() { super.onLoad(); autoDirHandler.refreshDirection(); } }
/** * Sets this object's text. Note that some browsers will manipulate the text * before adding it to the widget. For example, most browsers will strip all * <code>\r</code> from the text, except IE which will add a <code>\r</code> * before each <code>\n</code>. Use {@link #getText()} to get the text * directly from the widget. * * @param text the object's new text */ public void setText(String text) { getElement().setPropertyString("value", text != null ? text : ""); autoDirHandler.refreshDirection(); }
/** * Sets the DirectionEstimator object. */ public void setDirectionEstimator(DirectionEstimator directionEstimator) { this.directionEstimator = directionEstimator; if ((directionEstimator == null) != (handlerRegistration == null)) { if (directionEstimator == null) { handlerRegistration.removeHandler(); handlerRegistration = null; } else { handlerRegistration = target.addKeyUpHandler(this); } } refreshDirection(); } }
/** * Automatically adjusts hasDirection's direction on KeyUpEvent events. * Implementation of KeyUpHandler interface method. */ public void onKeyUp(KeyUpEvent event) { refreshDirection(); }
/** * Automatically adjusts hasDirection's direction on KeyUpEvent events. * Implementation of KeyUpHandler interface method. */ public void onKeyUp(KeyUpEvent event) { refreshDirection(); }
@Override protected void onLoad() { super.onLoad(); autoDirHandler.refreshDirection(); } }
@Override protected void onLoad() { super.onLoad(); autoDirHandler.refreshDirection(); } }
/** * Sets this object's text. Note that some browsers will manipulate the text * before adding it to the widget. For example, most browsers will strip all * <code>\r</code> from the text, except IE which will add a <code>\r</code> * before each <code>\n</code>. Use {@link #getText()} to get the text * directly from the widget. * * @param text the object's new text */ public void setText(String text) { getElement().setPropertyString("value", text != null ? text : ""); autoDirHandler.refreshDirection(); }
/** * Sets this object's text. Note that some browsers will manipulate the text * before adding it to the widget. For example, most browsers will strip all * <code>\r</code> from the text, except IE which will add a <code>\r</code> * before each <code>\n</code>. Use {@link #getText()} to get the text * directly from the widget. * * @param text the object's new text */ public void setText(String text) { getElement().setPropertyString("value", text != null ? text : ""); autoDirHandler.refreshDirection(); }
/** * Sets the DirectionEstimator object. */ public void setDirectionEstimator(DirectionEstimator directionEstimator) { this.directionEstimator = directionEstimator; if ((directionEstimator == null) != (handlerRegistration == null)) { if (directionEstimator == null) { handlerRegistration.removeHandler(); handlerRegistration = null; } else { handlerRegistration = target.addKeyUpHandler(this); } } refreshDirection(); } }
/** * Sets the DirectionEstimator object. */ public void setDirectionEstimator(DirectionEstimator directionEstimator) { this.directionEstimator = directionEstimator; if ((directionEstimator == null) != (handlerRegistration == null)) { if (directionEstimator == null) { handlerRegistration.removeHandler(); handlerRegistration = null; } else { handlerRegistration = target.addKeyUpHandler(this); } } refreshDirection(); } }
@PatchMethod static void setText(ValueBoxBase<?> valueBoxBase, String text) { DOM.setElementProperty(valueBoxBase.getElement(), "value", text != null ? text : ""); AutoDirectionHandler autoDirHandler = GwtReflectionUtils.getPrivateFieldValue(valueBoxBase, "autoDirHandler"); autoDirHandler.refreshDirection(); int cursorPos = text != null ? text.length() : 0; valueBoxBase.setCursorPos(cursorPos); }
@PatchMethod static void setText(ValueBoxBase<?> valueBoxBase, String text) { DOM.setElementProperty(valueBoxBase.getElement(), "value", text != null ? text : ""); AutoDirectionHandler autoDirHandler = GwtReflectionUtils.getPrivateFieldValue(valueBoxBase, "autoDirHandler"); autoDirHandler.refreshDirection(); int cursorPos = text != null ? text.length() : 0; valueBoxBase.setCursorPos(cursorPos); }