diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2016-08-04 20:58:28 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-08-05 14:21:23 +0000 |
commit | f6f111b88fcf65c9d75f36daaa046dd26efc68e5 (patch) | |
tree | 624771f12426fecb07ca6b63d2a6228c31e447f3 /uitest | |
parent | 138f8ddb6927f66bc2d5bfce6d7ae5963c0ca42e (diff) | |
download | vaadin-framework-f6f111b88fcf65c9d75f36daaa046dd26efc68e5.tar.gz vaadin-framework-f6f111b88fcf65c9d75f36daaa046dd26efc68e5.zip |
Rename Field, AbstractField to legacy names
Change-Id: I46ce708e0f10e4c9fa3d11a2aef5be0248c2999f
Diffstat (limited to 'uitest')
47 files changed, 172 insertions, 165 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java b/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java index 7b9f3d9926..cd5a61f502 100644 --- a/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java +++ b/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java @@ -16,13 +16,13 @@ package com.vaadin.tests; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component.Event; import com.vaadin.ui.Component.Listener; import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Field; import com.vaadin.ui.Label; import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.Panel; @@ -155,7 +155,7 @@ public class CustomLayoutDemo extends com.vaadin.server.LegacyApplication // Check if event occured at fsTree component if (event.getSource() == menu) { // Check if event is about changing value - if (event.getClass() == Field.ValueChangeEvent.class) { + if (event.getClass() == LegacyField.ValueChangeEvent.class) { // Update body area with selected item setBody(menu.getValue().toString()); } diff --git a/uitest/src/main/java/com/vaadin/tests/TestForPreconfiguredComponents.java b/uitest/src/main/java/com/vaadin/tests/TestForPreconfiguredComponents.java index b8d1c17241..e054b69916 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForPreconfiguredComponents.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForPreconfiguredComponents.java @@ -170,7 +170,7 @@ public class TestForPreconfiguredComponents extends CustomComponent { public void componentEvent(Event event) { statusLayout .addComponent(new Label(event.getClass().getName())); - // TODO should not use Field.toString() + // TODO should not use LegacyField.toString() statusLayout.addComponent(new Label("selected: " + event.getSource().toString())); } diff --git a/uitest/src/main/java/com/vaadin/tests/TestForTrees.java b/uitest/src/main/java/com/vaadin/tests/TestForTrees.java index 67f7faf44e..00fc2d54c2 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForTrees.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForTrees.java @@ -165,7 +165,7 @@ public class TestForTrees extends CustomComponent implements Handler { public void componentEvent(Event event) { statusLayout .addComponent(new Label(event.getClass().getName())); - // TODO should not use Field.toString() + // TODO should not use LegacyField.toString() statusLayout.addComponent(new Label("selected: " + event.getSource().toString())); } diff --git a/uitest/src/main/java/com/vaadin/tests/TestForUpload.java b/uitest/src/main/java/com/vaadin/tests/TestForUpload.java index 0046457f30..b8ac720a56 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForUpload.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForUpload.java @@ -29,9 +29,9 @@ import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.StreamResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; @@ -215,7 +215,7 @@ public class TestForUpload extends CustomComponent implements uploadBufferSelector.setValue("memory"); uploadBufferSelector.addItem("tempfile"); uploadBufferSelector - .addListener(new AbstractField.ValueChangeListener() { + .addListener(new LegacyAbstractField.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { setBuffer(); diff --git a/uitest/src/main/java/com/vaadin/tests/TreeFilesystemContainer.java b/uitest/src/main/java/com/vaadin/tests/TreeFilesystemContainer.java index 55e57a7d92..7f79bce024 100644 --- a/uitest/src/main/java/com/vaadin/tests/TreeFilesystemContainer.java +++ b/uitest/src/main/java/com/vaadin/tests/TreeFilesystemContainer.java @@ -20,11 +20,11 @@ import java.io.File; import com.vaadin.data.util.FilesystemContainer; import com.vaadin.data.util.FilesystemContainer.FileItem; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.VaadinSession; import com.vaadin.tests.util.SampleDirectory; import com.vaadin.ui.Component.Event; import com.vaadin.ui.Component.Listener; -import com.vaadin.ui.Field; import com.vaadin.ui.Label; import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.Panel; @@ -105,7 +105,7 @@ public class TreeFilesystemContainer extends // Check if event occured at fsTree component if (event.getSource() == filesystem) { // Check if event is about changing value - if (event.getClass() == Field.ValueChangeEvent.class) { + if (event.getClass() == LegacyField.ValueChangeEvent.class) { // Update property panel contents final FileItem fileItem = (FileItem) filesystem .getItem(filesystem.getValue()); diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java index 8666956bdb..9414bc0fb4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java @@ -5,11 +5,11 @@ import java.util.Date; import java.util.List; import java.util.Locale; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.Resource; import com.vaadin.server.ThemeResource; import com.vaadin.server.UserError; import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Field; import com.vaadin.ui.Layout.SpacingHandler; public abstract class AbstractComponentTestCase<T extends AbstractComponent> @@ -132,8 +132,8 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent> @Override public void execute(T c, Boolean enabled, Object data) { - if (c instanceof Field) { - ((Field<?>) c).setRequired(enabled); + if (c instanceof LegacyField) { + ((LegacyField<?>) c).setRequired(enabled); } else { throw new IllegalArgumentException(c.getClass().getName() + " is not a field and cannot be set to required"); @@ -144,7 +144,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent> @Override public void execute(T c, String value, Object data) { - ((Field<?>) c).setRequiredError(value); + ((LegacyField<?>) c).setRequiredError(value); } }; diff --git a/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java b/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java index 9bb01cd56f..6c051c6420 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java +++ b/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java @@ -8,13 +8,13 @@ import com.vaadin.data.Item; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; -import com.vaadin.ui.Field; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.NativeSelect; @@ -74,7 +74,7 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends actions.add(createReadonlyAction(false)); actions.add(createErrorIndicatorAction(false)); - if (Field.class.isAssignableFrom(getTestClass())) { + if (LegacyField.class.isAssignableFrom(getTestClass())) { actions.add(createRequiredAction(false)); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java index 2eef498aff..27126a5117 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java @@ -8,10 +8,10 @@ import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.VaadinSession; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; @@ -70,15 +70,15 @@ public abstract class AbstractComponentDataBindingTest extends TestBase @Override protected void addComponent(Component c) { super.addComponent(c); - if (c instanceof AbstractField) { - configureField((AbstractField<?>) c); + if (c instanceof LegacyAbstractField) { + configureField((LegacyAbstractField<?>) c); if (c != localeSelect) { fields.add(c); } } } - protected void configureField(AbstractField<?> field) { + protected void configureField(LegacyAbstractField<?> field) { field.setImmediate(true); field.addListener(this); } @@ -95,7 +95,7 @@ public abstract class AbstractComponentDataBindingTest extends TestBase @Override public void valueChange(ValueChangeEvent event) { - AbstractField field = (AbstractField) event.getProperty(); + LegacyAbstractField field = (LegacyAbstractField) event.getProperty(); // if (field == localeSelect) { // return; // } diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java index 496a44a6c1..fb4913d71e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java @@ -13,12 +13,12 @@ import com.vaadin.data.Property; import com.vaadin.data.Property.ReadOnlyStatusChangeEvent; import com.vaadin.data.Property.ReadOnlyStatusChangeListener; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.tests.components.AbstractComponentTest; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.MenuBar; import com.vaadin.ui.MenuBar.MenuItem; -public abstract class AbstractFieldTest<T extends AbstractField> extends +public abstract class AbstractFieldTest<T extends LegacyAbstractField> extends AbstractComponentTest<T> implements ValueChangeListener, ReadOnlyStatusChangeListener { @@ -53,9 +53,9 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends protected void populateSettingsMenu(MenuItem settingsMenu) { super.populateSettingsMenu(settingsMenu); - if (AbstractField.class.isAssignableFrom(getTestClass())) { + if (LegacyAbstractField.class.isAssignableFrom(getTestClass())) { MenuItem abstractField = settingsMenu - .addItem("AbstractField", null); + .addItem("LegacyAbstractField", null); abstractField.addItem("Show value", new MenuBar.Command() { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java index 56e593ce0f..a669e70739 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java @@ -5,6 +5,7 @@ import java.util.Set; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbsoluteLayout; @@ -12,7 +13,6 @@ import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.CssLayout; -import com.vaadin.ui.Field; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; @@ -20,7 +20,7 @@ import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; public class RequiredIndicatorForFieldsWithoutCaption extends AbstractTestUI { - private Set<Field> fields = new HashSet<Field>(); + private Set<LegacyField> fields = new HashSet<LegacyField>(); @Override protected void setup(VaadinRequest request) { @@ -32,7 +32,7 @@ public class RequiredIndicatorForFieldsWithoutCaption extends AbstractTestUI { @Override public void valueChange(ValueChangeEvent event) { boolean required = (Boolean) event.getProperty().getValue(); - for (Field f : fields) { + for (LegacyField f : fields) { f.setRequired(required); } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonWithShortcutNotRendered.java b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonWithShortcutNotRendered.java index f866928054..8c57373057 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonWithShortcutNotRendered.java +++ b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonWithShortcutNotRendered.java @@ -5,6 +5,7 @@ import com.vaadin.data.Item; import com.vaadin.data.Property; import com.vaadin.data.util.HierarchicalContainer; import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.MarginInfo; import com.vaadin.tests.components.AbstractTestUI; @@ -13,7 +14,6 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; @@ -155,7 +155,7 @@ public class ButtonWithShortcutNotRendered extends AbstractTestUI { @Override @SuppressWarnings("rawtypes") - protected void attachField(Object propertyId, Field field) { + protected void attachField(Object propertyId, LegacyField field) { if (propertyId.equals("t1")) { layout.addComponent(field, 0, 0); } else if (propertyId.equals("t2")) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/customfield/BooleanFieldExample.java b/uitest/src/main/java/com/vaadin/tests/components/customfield/BooleanFieldExample.java index 66346287ba..29fffbbf16 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/customfield/BooleanFieldExample.java +++ b/uitest/src/main/java/com/vaadin/tests/components/customfield/BooleanFieldExample.java @@ -2,13 +2,13 @@ package com.vaadin.tests.components.customfield; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItem; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.Notification; import com.vaadin.ui.VerticalLayout; @@ -48,7 +48,7 @@ public class BooleanFieldExample extends TestBase { form.setFooter(null); form.setFormFieldFactory(new DefaultFieldFactory() { @Override - public Field createField(Item item, Object propertyId, + public LegacyField createField(Item item, Object propertyId, Component uiContext) { if ("custom".equals(propertyId)) { return new BooleanField(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/customfield/EmbeddedForm.java b/uitest/src/main/java/com/vaadin/tests/components/customfield/EmbeddedForm.java index 2703e01a27..764949b7a3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/customfield/EmbeddedForm.java +++ b/uitest/src/main/java/com/vaadin/tests/components/customfield/EmbeddedForm.java @@ -3,8 +3,8 @@ package com.vaadin.tests.components.customfield; import java.util.HashMap; import java.util.Map; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.Layout; @@ -21,7 +21,7 @@ import com.vaadin.ui.Layout; */ public class EmbeddedForm extends Form { private Form parentForm; - private Map<Object, Field> fields = new HashMap<Object, Field>(); + private Map<Object, LegacyField> fields = new HashMap<Object, LegacyField>(); /** * Create a form that places its fields in another {@link Form}. @@ -35,14 +35,14 @@ public class EmbeddedForm extends Form { } @Override - protected void attachField(Object propertyId, Field field) { + protected void attachField(Object propertyId, LegacyField field) { if (propertyId == null || field == null) { return; } Layout layout = parentForm.getLayout(); - Field oldField = fields.get(propertyId); + LegacyField oldField = fields.get(propertyId); if (oldField != null) { layout.removeComponent(oldField); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/customfield/NestedPersonForm.java b/uitest/src/main/java/com/vaadin/tests/components/customfield/NestedPersonForm.java index 9b40074433..5ecd75d34e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/customfield/NestedPersonForm.java +++ b/uitest/src/main/java/com/vaadin/tests/components/customfield/NestedPersonForm.java @@ -4,6 +4,7 @@ import java.util.Arrays; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItem; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.shared.ui.MarginInfo; import com.vaadin.tests.util.Person; import com.vaadin.ui.Alignment; @@ -11,7 +12,6 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout.MarginHandler; @@ -74,16 +74,16 @@ public class NestedPersonForm extends Form { } /** - * Field factory for person form + * LegacyField factory for person form */ private class PersonFieldFactory extends DefaultFieldFactory { // reuse the address field - required by EmbeddedForm private AddressField addressField; @Override - public Field createField(Item item, Object propertyId, + public LegacyField createField(Item item, Object propertyId, Component uiContext) { - Field f = super.createField(item, propertyId, uiContext); + LegacyField f = super.createField(item, propertyId, uiContext); if ("address".equals(propertyId)) { // create a custom field for the Address object if (addressField == null) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/CommitInvalid.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/CommitInvalid.java index 1553594867..c9d5ff425d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/CommitInvalid.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/CommitInvalid.java @@ -21,7 +21,7 @@ public class CommitInvalid extends TestBase { return "DateField with parsing error is committed regardless " + "of the invalidity. Parsing error should be handled" + " as a builtin validator, similar to isRequired()" - + " in AbstractField."; + + " in LegacyAbstractField."; } @Override @@ -46,7 +46,7 @@ public class CommitInvalid extends TestBase { // immediate) /* - * Create and configure Date Field, the actual component to be tested. + * Create and configure Date LegacyField, the actual component to be tested. */ dateProperty = new ObjectProperty<Date>(new Date(2009 - 1900, 4 - 1, 1)); @@ -62,7 +62,7 @@ public class CommitInvalid extends TestBase { * reference component. */ integerProperty = new ObjectProperty<Integer>(42); - integerField = new TextField("Another Field", integerProperty); + integerField = new TextField("Another LegacyField", integerProperty); integerField.setId("_IF"); form.addField("text", integerField); @@ -132,9 +132,9 @@ public class CommitInvalid extends TestBase { } private void printState() { - log.log("Date. Field: " + f(dateField.getValue()) + " Property: " + log.log("Date. LegacyField: " + f(dateField.getValue()) + " Property: " + f(dateProperty.getValue())); - log.log("Integer: Field: " + integerField.getValue() + " Property: " + log.log("Integer: LegacyField: " + integerField.getValue() + " Property: " + integerProperty.getValue()); } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java index fab97f46cb..1c13aec254 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java @@ -4,13 +4,13 @@ import java.util.Date; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItem; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; import com.vaadin.ui.DateField; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.LegacyWindow; @@ -60,9 +60,9 @@ public class DateFieldInSubWindow extends AbstractTestCase { public static final String COMMON_FIELD_WIDTH = "12em"; @Override - public Field<?> createField(Item item, Object propertyId, + public LegacyField<?> createField(Item item, Object propertyId, Component uiContext) { - Field<?> f = super.createField(item, propertyId, uiContext); + LegacyField<?> f = super.createField(item, propertyId, uiContext); if ("myDate".equals(propertyId)) { ((DateField) f).setResolution(DateField.RESOLUTION_MIN); diff --git a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropFocusObtain.java b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropFocusObtain.java index c7e16440bc..966427fb3d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropFocusObtain.java +++ b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropFocusObtain.java @@ -23,9 +23,9 @@ import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.acceptcriteria.AcceptAll; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.DragAndDropWrapper; import com.vaadin.ui.DragAndDropWrapper.DragStartMode; import com.vaadin.ui.HorizontalLayout; @@ -54,7 +54,7 @@ public class DragAndDropFocusObtain extends AbstractTestUIWithLog { @Override public void valueChange(ValueChangeEvent event) { - AbstractField f = (AbstractField) event.getProperty(); + LegacyAbstractField f = (LegacyAbstractField) event.getProperty(); log("Value of " + f.getCaption() + " changed to " + f.getValue()); } }; diff --git a/uitest/src/main/java/com/vaadin/tests/components/form/FormTest.java b/uitest/src/main/java/com/vaadin/tests/components/form/FormTest.java index 604beb5fcc..f1538ef15b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/form/FormTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/form/FormTest.java @@ -4,6 +4,7 @@ import java.util.LinkedHashMap; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItem; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.shared.ui.AlignmentInfo; import com.vaadin.tests.components.abstractfield.AbstractFieldTest; import com.vaadin.tests.components.select.AbstractSelectTestCase; @@ -15,7 +16,6 @@ import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.FormFieldFactory; import com.vaadin.ui.FormLayout; @@ -154,10 +154,10 @@ public class FormTest extends AbstractFieldTest<Form> { options.put("Custom FieldFactory", new FormFieldFactory() { @Override - public Field<?> createField(Item item, Object propertyId, + public LegacyField<?> createField(Item item, Object propertyId, Component uiContext) { Class<?> type = item.getItemProperty(propertyId).getType(); - Field<?> c = null; + LegacyField<?> c = null; if (Number.class.isAssignableFrom(type)) { TextField tf = new TextField(); tf.setCaption(DefaultFieldFactory diff --git a/uitest/src/main/java/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java b/uitest/src/main/java/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java index 24d207739e..4d858780c9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java +++ b/uitest/src/main/java/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java @@ -3,12 +3,12 @@ package com.vaadin.tests.components.form; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItem; import com.vaadin.data.util.PropertyFormatter; +import com.vaadin.legacy.ui.LegacyField; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Component; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.FormFieldFactory; @@ -19,9 +19,9 @@ public class FormWithPropertyFormatterConnected extends TestBase { form2.setFormFieldFactory(new FormFieldFactory() { @Override - public Field createField(Item item, Object propertyId, + public LegacyField createField(Item item, Object propertyId, Component uiContext) { - AbstractField f = (AbstractField) DefaultFieldFactory.get() + LegacyAbstractField f = (LegacyAbstractField) DefaultFieldFactory.get() .createField(item, propertyId, uiContext); if (propertyId.equals("age")) { f.setPropertyDataSource(new PropertyFormatter() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithLabelEditor.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithLabelEditor.java index 91c5a06c66..799d789a7f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithLabelEditor.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridWithLabelEditor.java @@ -19,15 +19,15 @@ import java.util.Collection; import com.vaadin.data.Validator; import com.vaadin.data.Validator.InvalidValueException; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Field; import com.vaadin.ui.Grid; import com.vaadin.ui.Label; public class GridWithLabelEditor extends AbstractTestUI { - public class LabelEditor extends Label implements Field<String> { + public class LabelEditor extends Label implements LegacyField<String> { @Override public void focus() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java index 777f5f6775..175396289a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java @@ -43,6 +43,7 @@ import com.vaadin.event.SelectionEvent; import com.vaadin.event.SelectionEvent.SelectionListener; import com.vaadin.event.SortEvent; import com.vaadin.event.SortEvent.SortListener; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.shared.data.sort.SortDirection; import com.vaadin.shared.ui.grid.GridStaticCellType; import com.vaadin.shared.ui.grid.HeightMode; @@ -52,7 +53,6 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; -import com.vaadin.ui.Field; import com.vaadin.ui.Grid; import com.vaadin.ui.Grid.CellDescriptionGenerator; import com.vaadin.ui.Grid.CellReference; @@ -746,7 +746,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { @Override public void execute(Grid c, Boolean value, Object data) { - Field<?> targetField = grid.getEditorFieldGroup() + LegacyField<?> targetField = grid.getEditorFieldGroup() .getField("Column 0"); if (targetField != null) { if (!value) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java index 4f7a939ee5..1b07cf8f81 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java @@ -9,13 +9,13 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.event.LayoutEvents.LayoutClickEvent; import com.vaadin.event.LayoutEvents.LayoutClickListener; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.ThemeResource; import com.vaadin.server.UserError; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; @@ -376,8 +376,8 @@ public class BoxLayoutTest extends AbstractTestUI { componentRequired.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { - if (target != null && target instanceof AbstractField) { - ((AbstractField<?>) target).setRequired(componentRequired + if (target != null && target instanceof LegacyAbstractField) { + ((LegacyAbstractField<?>) target).setRequired(componentRequired .getValue()); } } @@ -424,7 +424,7 @@ public class BoxLayoutTest extends AbstractTestUI { componentDescription.setEnabled(target != null); componentError.setEnabled(target != null); componentRequired.setEnabled(target != null - && target instanceof AbstractField); + && target instanceof LegacyAbstractField); align.setEnabled(target != null); expand.setEnabled(target != null); if (target != null) { @@ -455,8 +455,8 @@ public class BoxLayoutTest extends AbstractTestUI { } componentDescription.setValue(target.getDescription()); componentError.setValue(target.getComponentError() != null); - if (target instanceof AbstractField) { - componentRequired.setValue(((AbstractField<?>) target) + if (target instanceof LegacyAbstractField) { + componentRequired.setValue(((LegacyAbstractField<?>) target) .isRequired()); } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java index 8293d9919f..23cd36b248 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java +++ b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java @@ -2,10 +2,10 @@ package com.vaadin.tests.components.richtextarea; import com.vaadin.event.Action; import com.vaadin.event.Action.Handler; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.event.ShortcutAction; import com.vaadin.server.Page; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.Component; import com.vaadin.ui.Notification; import com.vaadin.ui.Panel; @@ -27,7 +27,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase { msg += " From : " + sender.getClass().getSimpleName() + " '" + ((Component) sender).getCaption() + "'"; - AbstractField<String> f = (AbstractField<String>) target; + LegacyAbstractField<String> f = (LegacyAbstractField<String>) target; msg += " Target:" + target.getClass().getSimpleName() + " '" + f.getCaption() + "'"; diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/EditableModeChange.java b/uitest/src/main/java/com/vaadin/tests/components/table/EditableModeChange.java index e792c90af1..390a026c6f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/EditableModeChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/EditableModeChange.java @@ -7,11 +7,11 @@ import java.util.Locale; import com.vaadin.data.Container; import com.vaadin.event.ItemClickEvent; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Component; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Table; import com.vaadin.ui.TableFieldFactory; @@ -77,7 +77,7 @@ public class EditableModeChange extends AbstractTestUI { private class ItemFieldFactory extends DefaultFieldFactory { @Override - public Field<?> createField(Container container, Object itemId, + public LegacyField<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) { if (selectionEvent != null) { if ((selectionEvent.getItemId().equals(itemId)) diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java b/uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java index b80da2a78c..84eb646fa6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java @@ -9,6 +9,7 @@ import java.util.HashMap; import com.vaadin.data.Container; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.TestUtils; @@ -18,7 +19,6 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Label; import com.vaadin.ui.Table; @@ -60,10 +60,10 @@ public class EditableTableLeak extends TestBase { } private static class CachingFieldFactory extends DefaultFieldFactory { - private final HashMap<Object, HashMap<Object, Field<?>>> cache = new HashMap<Object, HashMap<Object, Field<?>>>(); + private final HashMap<Object, HashMap<Object, LegacyField<?>>> cache = new HashMap<Object, HashMap<Object, LegacyField<?>>>(); @Override - public Field<?> createField(Container container, Object itemId, + public LegacyField<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) { if (cache.containsKey(itemId)) { if (cache.get(itemId) != null @@ -71,10 +71,10 @@ public class EditableTableLeak extends TestBase { return cache.get(itemId).get(propertyId); } } - Field<?> f = super.createField(container, itemId, propertyId, + LegacyField<?> f = super.createField(container, itemId, propertyId, uiContext); if (!cache.containsKey(itemId)) { - cache.put(itemId, new HashMap<Object, Field<?>>()); + cache.put(itemId, new HashMap<Object, LegacyField<?>>()); } cache.get(itemId).put(propertyId, f); return f; diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/PropertyValueChange.java b/uitest/src/main/java/com/vaadin/tests/components/table/PropertyValueChange.java index 1e3c058458..d418dbc1f4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/PropertyValueChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/PropertyValueChange.java @@ -5,13 +5,13 @@ import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.IndexedContainer; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractSelect.NewItemHandler; import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Label; import com.vaadin.ui.Table; import com.vaadin.ui.Table.ColumnGenerator; @@ -137,7 +137,7 @@ class MyFieldFactory extends DefaultFieldFactory { } @Override - public Field<?> createField(Container container, Object itemId, + public LegacyField<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) { if (propertyId.equals("text")) { // replace text fields with comboboxes diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java b/uitest/src/main/java/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java index 5e1c4cca66..2b989bdf71 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java @@ -104,7 +104,8 @@ public class SetCurrentPageFirstItemIndex extends AbstractTestUI { public class ImageGenerator implements ColumnGenerator { @Override - public Object generateCell(Table source, Object itemId, Object columnId) { + public Object generateCell(Table source, Object itemId, + Object columnId) { return "" + itemId; } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableUnregisterComponent.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableUnregisterComponent.java index 11f450baf2..c2bc930f66 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableUnregisterComponent.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableUnregisterComponent.java @@ -5,6 +5,7 @@ import com.vaadin.data.Item; import com.vaadin.data.Property; import com.vaadin.data.util.IndexedContainer; import com.vaadin.data.util.ObjectProperty; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; @@ -12,7 +13,6 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; @@ -49,10 +49,10 @@ public class TableUnregisterComponent extends TestBase { table.setColumnCollapsingAllowed(true); table.setTableFieldFactory(new DefaultFieldFactory() { @Override - public Field<?> createField(Container container, Object itemId, + public LegacyField<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) { if (COL_B.equals(propertyId)) { - Field<String> field = new TextField() { + LegacyField<String> field = new TextField() { @Override public void setPropertyDataSource(Property newDataSource) { super.setPropertyDataSource(newDataSource); diff --git a/uitest/src/main/java/com/vaadin/tests/components/textarea/TextAreaCursorPosition.java b/uitest/src/main/java/com/vaadin/tests/components/textarea/TextAreaCursorPosition.java index 756970898e..58aab16269 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/textarea/TextAreaCursorPosition.java +++ b/uitest/src/main/java/com/vaadin/tests/components/textarea/TextAreaCursorPosition.java @@ -2,8 +2,8 @@ package com.vaadin.tests.components.textarea; import com.vaadin.event.FieldEvents.TextChangeEvent; import com.vaadin.event.FieldEvents.TextChangeListener; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.AbstractTextField; import com.vaadin.ui.AbstractTextField.TextChangeEventMode; import com.vaadin.ui.Button; @@ -28,7 +28,7 @@ public class TextAreaCursorPosition extends TestBase { addComponent(new Button("Force position update")); } - public void addListener(AbstractField newField) { + public void addListener(LegacyAbstractField newField) { AbstractTextField newTextField = (AbstractTextField) newField; newTextField.setTextChangeEventMode(TextChangeEventMode.EAGER); diff --git a/uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeListenerLosesFocus.java b/uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeListenerLosesFocus.java index 25ca46333a..ed74c83616 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeListenerLosesFocus.java +++ b/uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeListenerLosesFocus.java @@ -18,10 +18,10 @@ package com.vaadin.tests.components.textfield; import com.vaadin.event.FieldEvents.TextChangeEvent; import com.vaadin.event.FieldEvents.TextChangeListener; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.TestUtils; import com.vaadin.ui.AbstractTextField; -import com.vaadin.ui.Field; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; @@ -31,7 +31,7 @@ public class TextChangeListenerLosesFocus extends TestBase { public void textChange(TextChangeEvent event) { final String value = event.getText(); if (value.length() > 2) { - ((Field) event.getComponent()) + ((LegacyField) event.getComponent()) .setValue("Updated by TextChangeListener"); } } diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java index 0405ea2e10..7d69de4f15 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java @@ -28,6 +28,7 @@ import com.vaadin.data.fieldgroup.PropertyId; import com.vaadin.data.util.BeanItem; import com.vaadin.data.util.BeanItemContainer; import com.vaadin.data.validator.IntegerRangeValidator; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.shared.util.SharedUtil; @@ -39,7 +40,6 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; -import com.vaadin.ui.Field; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; @@ -81,7 +81,7 @@ public abstract class AbstractBasicCrud extends AbstractTestUIWithLog { formType.addItem(form); formType.setValue(form); formType.addItem(new AutoGeneratedForm(TextField.class)); - formType.addItem(new AutoGeneratedForm(Field.class)); + formType.addItem(new AutoGeneratedForm(LegacyField.class)); Iterator<?> iterator = formType.getItemIds().iterator(); formType.setItemCaption(iterator.next(), "TextField based form"); formType.setItemCaption(iterator.next(), @@ -167,11 +167,11 @@ public abstract class AbstractBasicCrud extends AbstractTestUIWithLog { // Produce error message in the order in which the fields are in the // layout for (Component c : this) { - if (!(c instanceof Field)) { + if (!(c instanceof LegacyField)) { continue; } - Field<?> f = (Field<?>) c; - Map<Field<?>, InvalidValueException> exceptions = e + LegacyField<?> f = (LegacyField<?>) c; + Map<LegacyField<?>, InvalidValueException> exceptions = e .getInvalidFields(); if (exceptions.containsKey(f)) { message += f.getCaption() + ": " @@ -199,7 +199,7 @@ public abstract class AbstractBasicCrud extends AbstractTestUIWithLog { protected BeanFieldGroup<ComplexPerson> fieldGroup = new BeanFieldGroup<ComplexPerson>( ComplexPerson.class) { @Override - protected void configureField(com.vaadin.ui.Field<?> field) { + protected void configureField(com.vaadin.legacy.ui.LegacyField<?> field) { super.configureField(field); if (field.getCaption().equals("Postal code")) { // Last name editing is disabled through property. @@ -245,7 +245,7 @@ public abstract class AbstractBasicCrud extends AbstractTestUIWithLog { protected void handleCommitException(CommitException e) { String message = ""; for (Object propertyId : e.getInvalidFields().keySet()) { - Field<?> f = e.getFieldGroup().getField(propertyId); + LegacyField<?> f = e.getFieldGroup().getField(propertyId); message += f.getCaption() + ": " + e.getInvalidFields().get(propertyId); } @@ -262,9 +262,9 @@ public abstract class AbstractBasicCrud extends AbstractTestUIWithLog { public class AutoGeneratedForm extends AbstractForm { - public AutoGeneratedForm(Class<? extends Field> class1) { + public AutoGeneratedForm(Class<? extends LegacyField> class1) { for (String p : columns) { - Field f = fieldGroup.getFieldFactory().createField( + LegacyField f = fieldGroup.getFieldFactory().createField( container.getType(p), class1); f.setCaption(SharedUtil.propertyIdToHumanFriendly(p)); fieldGroup.bind(f, p); diff --git a/uitest/src/main/java/com/vaadin/tests/fields/TabIndexes.java b/uitest/src/main/java/com/vaadin/tests/fields/TabIndexes.java index 32fb36815b..f38a124800 100644 --- a/uitest/src/main/java/com/vaadin/tests/fields/TabIndexes.java +++ b/uitest/src/main/java/com/vaadin/tests/fields/TabIndexes.java @@ -3,15 +3,15 @@ package com.vaadin.tests.fields; import java.util.ArrayList; import java.util.List; +import com.vaadin.legacy.ui.LegacyField; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Field; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.InlineDateField; @@ -32,7 +32,7 @@ import com.vaadin.ui.TwinColSelect; @SuppressWarnings("rawtypes") public class TabIndexes extends AbstractTestUIWithLog { - private List<AbstractField> fields; + private List<LegacyAbstractField> fields; @Override protected void setup(VaadinRequest request) { @@ -44,7 +44,7 @@ public class TabIndexes extends AbstractTestUIWithLog { @Override public void buttonClick(ClickEvent event) { log("Setting tab indexes to 0"); - for (AbstractField f : fields) { + for (LegacyAbstractField f : fields) { f.setTabIndex(0); } updateCaptions(); @@ -56,7 +56,7 @@ public class TabIndexes extends AbstractTestUIWithLog { @Override public void buttonClick(ClickEvent event) { log("Setting tab indexes to 1"); - for (AbstractField f : fields) { + for (LegacyAbstractField f : fields) { f.setTabIndex(1); } updateCaptions(); @@ -69,7 +69,7 @@ public class TabIndexes extends AbstractTestUIWithLog { public void buttonClick(ClickEvent event) { int tabIndex = 1; log("Setting tab indexes to 1..N"); - for (AbstractField f : fields) { + for (LegacyAbstractField f : fields) { f.setTabIndex(tabIndex++); } updateCaptions(); @@ -83,13 +83,13 @@ public class TabIndexes extends AbstractTestUIWithLog { public void buttonClick(ClickEvent event) { int tabIndex = fields.size(); log("Setting tab indexes to N..1"); - for (AbstractField f : fields) { + for (LegacyAbstractField f : fields) { f.setTabIndex(tabIndex--); } updateCaptions(); } }); - fields = new ArrayList<AbstractField>(); + fields = new ArrayList<LegacyAbstractField>(); Table t = new Table(); t.setSelectable(true); t.addContainerProperty("foo", String.class, "bar"); @@ -129,7 +129,7 @@ public class TabIndexes extends AbstractTestUIWithLog { int fieldId = 1; GridLayout gl = new GridLayout(4, 4); - for (Field f : fields) { + for (LegacyField f : fields) { f.setId("field-" + fieldId++); gl.addComponent(f); } @@ -138,7 +138,7 @@ public class TabIndexes extends AbstractTestUIWithLog { } protected void updateCaptions() { - for (Field f : fields) { + for (LegacyField f : fields) { f.setCaption(f.getClass().getSimpleName() + " Tab index: " + f.getTabIndex()); } diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayouts.java b/uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayouts.java index 74cfe12ad7..e506c0ac29 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayouts.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayouts.java @@ -6,11 +6,11 @@ import java.util.List; import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.ThemeResource; import com.vaadin.server.UserError; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -38,7 +38,7 @@ public class CaptionsInLayouts extends AbstractTestUI { private HorizontalLayout horizontalLayout; private GridLayout gridLayout; private FormLayout formLayout; - private List<AbstractField<?>> components = new ArrayList<AbstractField<?>>(); + private List<LegacyAbstractField<?>> components = new ArrayList<LegacyAbstractField<?>>(); private CssLayout cssLayout; private HorizontalLayout layoutParent = new HorizontalLayout(); @@ -71,7 +71,7 @@ public class CaptionsInLayouts extends AbstractTestUI { } protected void prependCaptions(String prepend) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { c.setCaption(prepend + c.getCaption()); } @@ -106,14 +106,14 @@ public class CaptionsInLayouts extends AbstractTestUI { } protected void setRequired(boolean value) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { c.setRequired(value); } } protected void setIcon(boolean value) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { if (!value) { c.setIcon(null); } else { @@ -138,7 +138,7 @@ public class CaptionsInLayouts extends AbstractTestUI { } protected void setError(boolean value) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { if (value) { c.setComponentError(new UserError("error")); } else { diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java b/uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java index ec323f2db2..77ec82003e 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java @@ -6,10 +6,10 @@ import java.util.List; import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.ThemeResource; import com.vaadin.server.UserError; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -41,7 +41,7 @@ public class CaptionsInLayoutsWaiAria extends TestBase { private HorizontalLayout horizontalLayout; private GridLayout gridLayout; private FormLayout formLayout; - private List<AbstractField<?>> components = new ArrayList<AbstractField<?>>(); + private List<LegacyAbstractField<?>> components = new ArrayList<LegacyAbstractField<?>>(); private CssLayout cssLayout; private HorizontalLayout layoutParent = new HorizontalLayout(); @@ -78,7 +78,7 @@ public class CaptionsInLayoutsWaiAria extends TestBase { } protected void prependCaptions(String prepend) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { c.setCaption(prepend + c.getCaption()); } @@ -161,20 +161,20 @@ public class CaptionsInLayoutsWaiAria extends TestBase { "Der eingegebene Wert ist nicht zulässig!"); } - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { c.setComponentError(userError); } } protected void setRequired(boolean value) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { c.setRequired(value); } } protected void setIcon(boolean value) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { if (!value) { c.setIcon(null); } else { @@ -185,13 +185,13 @@ public class CaptionsInLayoutsWaiAria extends TestBase { } protected void setReadOnly(boolean value) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { c.setReadOnly(value); } } protected void setEnabled(boolean value) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { c.setEnabled(value); } } @@ -211,7 +211,7 @@ public class CaptionsInLayoutsWaiAria extends TestBase { } protected void setError(boolean value) { - for (AbstractField<?> c : components) { + for (LegacyAbstractField<?> c : components) { if (value) { c.setComponentError(new UserError("error")); } else { diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/GridLayoutCaptions.java b/uitest/src/main/java/com/vaadin/tests/layouts/GridLayoutCaptions.java index 923f91f246..a8c21f2aa0 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/GridLayoutCaptions.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/GridLayoutCaptions.java @@ -3,6 +3,7 @@ package com.vaadin.tests.layouts; import com.vaadin.data.Item; import com.vaadin.data.Validator; import com.vaadin.data.util.BeanItem; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.AbstractErrorMessage; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; @@ -10,7 +11,6 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.FormFieldFactory; import com.vaadin.ui.GridLayout; @@ -30,31 +30,31 @@ public class GridLayoutCaptions extends TestBase { private FormFieldFactory fff = new FormFieldFactory() { @Override - public Field<?> createField(Item item, Object propertyId, + public LegacyField<?> createField(Item item, Object propertyId, Component uiContext) { if (propertyId.equals(DataPOJO.Fields.name.name())) { - Field<?> f = DefaultFieldFactory.get().createField(item, + LegacyField<?> f = DefaultFieldFactory.get().createField(item, propertyId, uiContext); f.setCaption("This is a long caption for the name field"); return f; } else if (propertyId.equals(DataPOJO.Fields.hp.name())) { - Field<?> f = DefaultFieldFactory.get().createField(item, + LegacyField<?> f = DefaultFieldFactory.get().createField(item, propertyId, uiContext); f.setCaption("This is a long caption for the HP field, but it has a VL as a wrapper"); return f; } else if (propertyId.equals(DataPOJO.Fields.place.name())) { - Field<?> f = DefaultFieldFactory.get().createField(item, + LegacyField<?> f = DefaultFieldFactory.get().createField(item, propertyId, uiContext); f.setCaption("This is a long caption for the Place field, but it has a CSSLo as a wrapper"); return f; } else if (propertyId.equals(DataPOJO.Fields.price.name())) { - Field<?> f = DefaultFieldFactory.get().createField(item, + LegacyField<?> f = DefaultFieldFactory.get().createField(item, propertyId, uiContext); f.setCaption("With size undefined the caption behaves like this..."); f.setSizeFull(); @@ -114,7 +114,7 @@ public class GridLayoutCaptions extends TestBase { } @Override - protected void attachField(Object propertyId, Field field) { + protected void attachField(Object propertyId, LegacyField field) { if (propertyId.equals(DataPOJO.Fields.name.name())) { layout.addComponent(field, 0, 0); diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/TestAbsoluteLayout.java b/uitest/src/main/java/com/vaadin/tests/layouts/TestAbsoluteLayout.java index 5abe915307..d26002c290 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/TestAbsoluteLayout.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/TestAbsoluteLayout.java @@ -12,6 +12,7 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.BeanItem; import com.vaadin.data.util.IndexedContainer; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbsoluteLayout; import com.vaadin.ui.AbsoluteLayout.ComponentPosition; @@ -20,7 +21,6 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; @@ -34,7 +34,7 @@ public class TestAbsoluteLayout extends TestBase { private static class MFieldFactory extends DefaultFieldFactory { @Override - public Field<?> createField(Item item, Object propertyId, + public LegacyField<?> createField(Item item, Object propertyId, Component uiContext) { if (propertyId.equals("CSSString")) { TextArea f = new TextArea(); diff --git a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1804.java b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1804.java index bf648b0d92..306469e6f3 100644 --- a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1804.java +++ b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1804.java @@ -5,9 +5,9 @@ import java.util.LinkedList; import com.vaadin.data.Validator; import com.vaadin.data.util.MethodProperty; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.SystemError; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; @@ -96,7 +96,7 @@ public class Ticket1804 extends com.vaadin.server.LegacyApplication { StringBuffer msg = new StringBuffer(); for (Iterator<Select> i = listOfAllFields.iterator(); i .hasNext();) { - AbstractField<?> af = i.next(); + LegacyAbstractField<?> af = i.next(); msg.append("<h1>" + af.getCaption() + "</h1>\n"); msg.append("Value=" + af.getValue() + "<br/>\n"); if (af.isValid()) { diff --git a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1819.java b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1819.java index b9a0060ce0..1a73490de8 100644 --- a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1819.java +++ b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1819.java @@ -3,8 +3,8 @@ package com.vaadin.tests.tickets; import java.util.Iterator; import java.util.LinkedList; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; @@ -52,7 +52,7 @@ public class Ticket1819 extends com.vaadin.server.LegacyApplication { StringBuffer msg = new StringBuffer(); for (Iterator<Select> i = listOfAllFields.iterator(); i .hasNext();) { - AbstractField<?> af = i.next(); + LegacyAbstractField<?> af = i.next(); msg.append("<h1>" + af.getCaption() + "</h1>\n"); msg.append("Value=" + af.getValue() + "<br/>\n"); } diff --git a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1878.java b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1878.java index 6078320b61..7d04cf7df8 100644 --- a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1878.java +++ b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1878.java @@ -6,6 +6,7 @@ import java.util.Random; import com.vaadin.data.util.BeanItem; import com.vaadin.data.validator.StringLengthValidator; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.LegacyApplication; import com.vaadin.server.Resource; import com.vaadin.server.ThemeResource; @@ -15,7 +16,6 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.FormLayout; import com.vaadin.ui.GridLayout; @@ -187,7 +187,7 @@ public class Ticket1878 extends LegacyApplication { form.setItemDataSource(item); for (Iterator<?> i = item.getItemPropertyIds().iterator(); i.hasNext();) { Object property = i.next(); - Field<?> f = form.getField(property); + LegacyField<?> f = form.getField(property); f.setRequired(r.nextBoolean()); if (r.nextBoolean()) { diff --git a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1900.java b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1900.java index 35b7adc7b3..2109b1729a 100644 --- a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1900.java +++ b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket1900.java @@ -37,18 +37,22 @@ public class Ticket1900 extends LegacyApplication { f[0].setDescription("Field is empty, requiredError(null): *"); - f[1].setDescription("Field is empty, requiredError(\"foo\"): * (popup shows the validation error)"); + f[1].setDescription( + "Field is empty, requiredError(\"foo\"): * (popup shows the validation error)"); f[1].setRequiredError("The field must not be empty"); - f[2].setDescription("Field is non-empty, validators do not give validation error: *"); + f[2].setDescription( + "Field is non-empty, validators do not give validation error: *"); f[2].setValue("valid 12"); - f[3].setDescription("Field is non-empty, requiredError(null), validators " - + "give validation error: * ! (popup shows the validation error)"); + f[3].setDescription( + "Field is non-empty, requiredError(null), validators " + + "give validation error: * ! (popup shows the validation error)"); f[3].setValue("invalid"); - f[4].setDescription("Field is non-empty, requiredError(\"foo\"), validators " - + "give validation error: * ! (popup shows the validation error)"); + f[4].setDescription( + "Field is non-empty, requiredError(\"foo\"), validators " + + "give validation error: * ! (popup shows the validation error)"); f[4].setValue("invalid"); f[4].setRequiredError("The field must not be empty"); diff --git a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2107.java b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2107.java index 7de0e2da24..c5d212ec92 100644 --- a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2107.java +++ b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2107.java @@ -18,7 +18,8 @@ public class Ticket2107 extends LegacyApplication { final TextField tf = new TextField( "Required field that validated the input"); - tf.setDescription("Enter someting and click outside the field to activate"); + tf.setDescription( + "Enter someting and click outside the field to activate"); tf.setRequired(true); tf.setImmediate(true); tf.addListener(new Property.ValueChangeListener() { diff --git a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2151.java b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2151.java index b48a327523..d765bd3a01 100644 --- a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2151.java +++ b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2151.java @@ -1,9 +1,9 @@ package com.vaadin.tests.tickets; import com.vaadin.data.util.ObjectProperty; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.LegacyApplication; import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; @@ -83,9 +83,9 @@ public class Ticket2151 extends LegacyApplication { } - private void checkDataBinding(Class<? extends AbstractField> class1) { + private void checkDataBinding(Class<? extends LegacyAbstractField> class1) { boolean ok = false; - AbstractField b; + LegacyAbstractField b; try { b = class1.newInstance(); b.setCaption("Button of type " + class1.getSimpleName()); diff --git a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2204.java b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2204.java index e32b66ffc0..532bf9a1ba 100644 --- a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2204.java +++ b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2204.java @@ -7,6 +7,7 @@ import java.util.Map; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItem; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.LegacyApplication; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.AbstractSplitPanel; @@ -16,7 +17,6 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.FormFieldFactory; import com.vaadin.ui.GridLayout; @@ -130,7 +130,7 @@ public class Ticket2204 extends LegacyApplication { f.setFormFieldFactory(new FormFieldFactory() { @Override - public Field<?> createField(Item item, Object propertyId, + public LegacyField<?> createField(Item item, Object propertyId, Component uiContext) { formTextArea = new RichTextArea(); formTextArea.setVisible(false); diff --git a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2998.java b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2998.java index 818a70318e..0900213989 100644 --- a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2998.java +++ b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket2998.java @@ -11,12 +11,12 @@ import java.util.Set; import com.vaadin.data.Container; import com.vaadin.data.Validator; import com.vaadin.data.util.BeanItemContainer; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.LegacyApplication; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; import com.vaadin.ui.DateField; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.FormLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.MarginHandler; @@ -148,7 +148,7 @@ public class Ticket2998 extends LegacyApplication { } @Override - public Field<?> createField(Container container, Object itemId, + public LegacyField<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) { /* @@ -165,7 +165,7 @@ public class Ticket2998 extends LegacyApplication { return getSecondaryTypesList(itemId); } - final Field f = super.createField(container, itemId, propertyId, + final LegacyField f = super.createField(container, itemId, propertyId, uiContext); if (f != null) { if (f instanceof TextField) { @@ -200,7 +200,7 @@ public class Ticket2998 extends LegacyApplication { private Map<Object, ListSelect> workoutIdToList = new HashMap<Object, ListSelect>(); - private Field<?> getSecondaryTypesList(Object itemId) { + private LegacyField<?> getSecondaryTypesList(Object itemId) { ListSelect list = workoutIdToList.get(itemId); if (list == null) { list = new ListSelect(); @@ -219,7 +219,7 @@ public class Ticket2998 extends LegacyApplication { private Map<Object, ComboBox> workoutIdToCombobox = new HashMap<Object, ComboBox>(); - private Field<?> getTrainingTypeComboboxFor(Object itemId) { + private LegacyField<?> getTrainingTypeComboboxFor(Object itemId) { ComboBox cb = workoutIdToCombobox.get(itemId); if (cb == null) { final ComboBox cb2 = new ComboBox(); diff --git a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket677.java b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket677.java index 44ec3d10da..748a77d8f0 100644 --- a/uitest/src/main/java/com/vaadin/tests/tickets/Ticket677.java +++ b/uitest/src/main/java/com/vaadin/tests/tickets/Ticket677.java @@ -4,6 +4,7 @@ import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.Property; import com.vaadin.data.util.BeanItem; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.LegacyApplication; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Button; @@ -11,7 +12,6 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; @@ -127,9 +127,9 @@ public class Ticket677 extends LegacyApplication { form.setFormFieldFactory(new DefaultFieldFactory() { @Override - public Field<?> createField(Item item, Object propertyId, + public LegacyField<?> createField(Item item, Object propertyId, Component uiContext) { - Field<?> f = super.createField(item, propertyId, uiContext); + LegacyField<?> f = super.createField(item, propertyId, uiContext); f.setEnabled(!"disabled".equals(propertyId)); return f; } @@ -150,9 +150,9 @@ public class Ticket677 extends LegacyApplication { table.setTableFieldFactory(new DefaultFieldFactory() { @Override - public Field<?> createField(Container container, Object itemId, + public LegacyField<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) { - Field<?> f = super.createField(container, itemId, propertyId, + LegacyField<?> f = super.createField(container, itemId, propertyId, uiContext); Item item = container.getItem(itemId); Property<?> p = item.getItemProperty(propertyId); diff --git a/uitest/src/main/java/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java b/uitest/src/main/java/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java index 11f98eb888..5c31a72392 100644 --- a/uitest/src/main/java/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java +++ b/uitest/src/main/java/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java @@ -3,13 +3,13 @@ package com.vaadin.tests.validation; import java.util.Date; import com.vaadin.data.Validator.InvalidValueException; +import com.vaadin.legacy.ui.LegacyField; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.AlwaysFailValidator; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.DateField; -import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.NativeSelect; @@ -75,11 +75,12 @@ public class EmptyFieldErrorIndicators extends TestBase { return panel; } - private Form createForm(final boolean required, final boolean failValidator) { + private Form createForm(final boolean required, + final boolean failValidator) { // hand-crafted form, not using form field factory final Form form = new Form() { @Override - public void addField(Object propertyId, Field<?> field) { + public void addField(Object propertyId, LegacyField<?> field) { super.addField(propertyId, field); field.setRequired(required); field.setRequiredError("Missing required value!"); diff --git a/uitest/src/main/java/com/vaadin/tests/validation/FieldErrorIndication.java b/uitest/src/main/java/com/vaadin/tests/validation/FieldErrorIndication.java index 3135ce0592..0847a62b52 100644 --- a/uitest/src/main/java/com/vaadin/tests/validation/FieldErrorIndication.java +++ b/uitest/src/main/java/com/vaadin/tests/validation/FieldErrorIndication.java @@ -19,13 +19,13 @@ import java.util.Set; import com.vaadin.data.Validator; import com.vaadin.data.validator.StringLengthValidator; +import com.vaadin.legacy.ui.LegacyField; +import com.vaadin.legacy.ui.LegacyAbstractField; import com.vaadin.server.UserError; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.AbstractField; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; -import com.vaadin.ui.Field; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.ListSelect; import com.vaadin.ui.NativeSelect; @@ -84,12 +84,12 @@ public class FieldErrorIndication extends AbstractTestUI { vl.addComponents(comboBox, listSelect, nativeSelect, twinColSelect); - Class<? extends AbstractField>[] textFields = new Class[] { + Class<? extends LegacyAbstractField>[] textFields = new Class[] { TextField.class, TextArea.class, RichTextArea.class, PasswordField.class }; vl = new VerticalLayout(); hl.addComponent(vl); - for (Class<? extends Field> fieldClass : textFields) { + for (Class<? extends LegacyField> fieldClass : textFields) { vl.addComponent(getField(fieldClass)); } @@ -100,10 +100,10 @@ public class FieldErrorIndication extends AbstractTestUI { * @param fieldClass * @return */ - private Component getField(Class<? extends Field> fieldClass) { - AbstractField f; + private Component getField(Class<? extends LegacyField> fieldClass) { + LegacyAbstractField f; try { - f = (AbstractField) fieldClass.newInstance(); + f = (LegacyAbstractField) fieldClass.newInstance(); f.setCaption(fieldClass.getSimpleName()); f.setComponentError(new UserError("fail")); return f; |