listener);
}
- /**
- * Gets the number of columns in the editor. If the number of columns is set
- * 0, the actual number of displayed columns is determined implicitly by the
- * adapter.
- *
- * @return the number of columns in the editor.
- */
- public int getColumns() {
- return getState(false).columns;
- }
-
- /**
- * Sets the number of columns in the editor. If the number of columns is set
- * 0, the actual number of displayed columns is determined implicitly by the
- * adapter.
- *
- * @param columns
- * the number of columns to set.
- */
- public void setColumns(int columns) {
- if (columns < 0) {
- columns = 0;
- }
- getState().columns = columns;
- }
-
/**
* Sets the mode how the TextField triggers {@link ValueChange}s.
*
String design = "<vaadin-text-field "
// + "null-representation=this-is-null "
// + "null-setting-allowed "
- + "maxlength=5 columns=3 "
- + "placeholder=input value-change-mode=eager "
+ + "maxlength=5 " + "placeholder=input value-change-mode=eager "
+ "value-change-timeout=100 />";
AbstractTextField tf = new TextField();
// FIXME
// tf.setNullRepresentation("this-is-null");
// tf.setNullSettingAllowed(true);
tf.setMaxLength(5);
- tf.setColumns(3);
tf.setPlaceholder("input");
tf.setValueChangeMode(ValueChangeMode.EAGER);
tf.setValueChangeTimeout(100);
@NoLayout
public int maxLength = -1;
- /**
- * Number of visible columns in the TextField.
- */
- public int columns = 0;
-
/**
* The prompt to display in an empty field. Null when disabled.
*/
@Override
protected void setup(VaadinRequest request) {
final TextField tf = new TextField();
- tf.setColumns(40);
+ tf.setWidth("40em");
tf.setValue(
"Delete this text to reveal input prompt and update cursor position.");
tf.setPlaceholder("This is an input prompt");
messages = new TextArea("Messages hidden");
messages.setRows(10);
- messages.setColumns(40);
+ messages.setWidth("40em");
messages.setVisible(false);
messages.setEnabled(false);
formLayout.addComponent(messages);
private TextField createTextField(final Object pid) {
TextField filterField = new TextField();
- filterField.setColumns(8);
+ filterField.setWidth("8em");
filterField.setValue("Filter: " + pid);
filterField.addValueChangeListener(listener -> {
log("value change for field in " + pid + " to "