/** * Sets the mode how the TextField triggers {@link TextChangeEvent}s. * * @param inputEventMode * the new mode * * @see TextChangeEventMode */ public void setTextChangeEventMode(TextChangeEventMode inputEventMode) { textChangeEventMode = inputEventMode; markAsDirty(); }
/** * The text change timeout modifies how often text change events are * communicated to the application when {@link #getTextChangeEventMode()} is * {@link TextChangeEventMode#LAZY} or {@link TextChangeEventMode#TIMEOUT}. * * * @see #getTextChangeEventMode() * * @param timeout * the timeout in milliseconds */ public void setTextChangeTimeout(int timeout) { textChangeEventTimeout = timeout; markAsDirty(); }
/** * Sets the null-string representation. * * <p> * The null-valued strings are represented on the user interface by * replacing the null value with this string. If the null representation is * set null (not 'null' string), painting null value throws exception. * </p> * * <p> * The default value is string 'null' * </p> * * @param nullRepresentation * Textual representation for null strings. * @see TextField#setNullSettingAllowed(boolean) */ public void setNullRepresentation(String nullRepresentation) { this.nullRepresentation = nullRepresentation; markAsDirty(); }
/** * Sets the null conversion mode. * * <p> * If this property is true, writing null-representation string to text * field always sets the field value to real null. If this property is * false, null setting is not made, but the null values are maintained. * Maintenance of null-values is made by only converting the textfield * contents to real null, if the text field matches the null-string * representation and the current value of the field is null. * </p> * * <p> * By default this setting is false. * </p> * * @param nullSettingAllowed * Should the null-string representation always be converted to * null-values. * @see TextField#getNullRepresentation() */ public void setNullSettingAllowed(boolean nullSettingAllowed) { this.nullSettingAllowed = nullSettingAllowed; markAsDirty(); }
@Override public void setValue(String newValue) throws ReadOnlyException { super.setValue(newValue); /* * Make sure w reset lastKnownTextContent field on value change. The * clearing must happen here as well because TextChangeListener can * revert the original value. Client must respect the value in this * case. AbstractField optimizes value change if the existing value is * reset. Also we need to force repaint if the flag is on. */ if (lastKnownTextContent != null) { lastKnownTextContent = null; markAsDirty(); } }
/** * Sets the range of text to be selected. * * As a side effect the field will become focused. * * @since 6.4 * * @param pos * the position of the first character to be selected * @param length * the number of characters to be selected */ public void setSelectionRange(int pos, int length) { selectionPosition = pos; selectionLength = length; focus(); markAsDirty(); }