Beispiel #1
0
  /**
   * {@inheritDoc}
   *
   * @see SubmittableElement#setDefaultValue(String)
   */
  public void setDefaultValue(String defaultValue) {
    initDefaultValue();
    if (defaultValue == null) {
      defaultValue = "";
    }

    // for FF, if value is still default value, change value too
    if (hasFeature(HTMLINPUT_DEFAULT_IS_CHECKED) && getText().equals(getDefaultValue())) {
      setTextInternal(defaultValue);
    }
    defaultValue_ = defaultValue;
  }
Beispiel #2
0
 @Override
 void typeDone(final String newValue, final int newCursorPosition) {
   setTextInternal(newValue);
   setSelectionStart(newCursorPosition);
   setSelectionEnd(newCursorPosition);
 }
Beispiel #3
0
  /**
   * Sets the new value of this text area.
   *
   * <p>Note that this acts like 'pasting' the text, but to simulate characters entry you should use
   * {@link #type(String)}.
   *
   * @param newValue the new value
   */
  public final void setText(final String newValue) {
    initDefaultValue();
    setTextInternal(newValue);

    HtmlInput.executeOnChangeHandlerIfAppropriate(this);
  }