]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove strange TextField column API
authorArtur Signell <artur@vaadin.com>
Tue, 6 Sep 2016 19:29:20 +0000 (22:29 +0300)
committerArtur Signell <artur@vaadin.com>
Wed, 7 Sep 2016 08:48:17 +0000 (08:48 +0000)
Change-Id: I1cfa901b8699afafe490ec4e8045c643c7912e89

server/src/main/java/com/vaadin/ui/AbstractTextField.java
server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java
shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java
uitest/src/main/java/com/vaadin/tests/components/textfield/InputPromptAndCursorPosition.java
uitest/src/main/java/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java
uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridHeaderFooterComponents.java

index e447fd67245e2066ffbceef930f1ff50784996f5..e1b0273c6c7035ab4640e2e437ec4f4c076583e7 100644 (file)
@@ -212,32 +212,6 @@ public abstract class AbstractTextField extends AbstractField<String> {
                 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.
      *
index e5d7ef04ece2ee002d8f612b7c3465152293c0ba..63367363d5023a807fb84647a50149d8215e7ab9 100644 (file)
@@ -36,15 +36,13 @@ public class AbstractTextFieldDeclarativeTest
         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);
index b35fd89a276aa473d0dd64f30b59eddbf006bb0e..2eac070b5e89aaf146067fe5e749d95890bc7c0c 100644 (file)
@@ -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.
      */
index bc69e04dcbffda8f4877741fb38d16d1edb95ad5..643c96b1705679b3cd1cb8e40791e5c7a8ac26ce 100644 (file)
@@ -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");
index 76a3dba08fb9711cf5dd8ae9e4a39a5e3a40520a..b17a2a771be45ee36bccc7b327bf71ec4c485d53 100644 (file)
@@ -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);
index ffcf312544947c3512b78def20bab5911b72bc26..cae129a9060f17b33f3dd94b5f60c2cd4558f72d 100644 (file)
@@ -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 "