From: Artur Signell Date: Tue, 6 Sep 2016 19:29:20 +0000 (+0300) Subject: Remove strange TextField column API X-Git-Tag: 8.0.0.alpha1~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0857fafb22eff83388ef4d9f208681e16191b190;p=vaadin-framework.git Remove strange TextField column API Change-Id: I1cfa901b8699afafe490ec4e8045c643c7912e89 --- diff --git a/server/src/main/java/com/vaadin/ui/AbstractTextField.java b/server/src/main/java/com/vaadin/ui/AbstractTextField.java index e447fd6724..e1b0273c6c 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractTextField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractTextField.java @@ -212,32 +212,6 @@ public abstract class AbstractTextField extends AbstractField { 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. * diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java index e5d7ef04ec..63367363d5 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java @@ -36,15 +36,13 @@ public class AbstractTextFieldDeclarativeTest String design = ""; 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); diff --git a/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java b/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java index b35fd89a27..2eac070b5e 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java @@ -31,11 +31,6 @@ public abstract class AbstractTextFieldState extends AbstractFieldState { @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. */ diff --git a/uitest/src/main/java/com/vaadin/tests/components/textfield/InputPromptAndCursorPosition.java b/uitest/src/main/java/com/vaadin/tests/components/textfield/InputPromptAndCursorPosition.java index bc69e04dcb..643c96b170 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/textfield/InputPromptAndCursorPosition.java +++ b/uitest/src/main/java/com/vaadin/tests/components/textfield/InputPromptAndCursorPosition.java @@ -12,7 +12,7 @@ public class InputPromptAndCursorPosition extends AbstractTestUI { @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"); diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java b/uitest/src/main/java/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java index 76a3dba08f..b17a2a771b 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java @@ -33,7 +33,7 @@ public class FormLayoutWithInvisibleComponent extends TestBase { messages = new TextArea("Messages hidden"); messages.setRows(10); - messages.setColumns(40); + messages.setWidth("40em"); messages.setVisible(false); messages.setEnabled(false); formLayout.addComponent(messages); diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridHeaderFooterComponents.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridHeaderFooterComponents.java index ffcf312544..cae129a906 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridHeaderFooterComponents.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridHeaderFooterComponents.java @@ -123,7 +123,7 @@ public class GridHeaderFooterComponents extends AbstractTestUIWithLog { 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 "