diff options
author | Artur Signell <artur@vaadin.com> | 2012-09-24 16:19:41 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-10-23 14:42:57 +0300 |
commit | 0121af0c28d92db37dea94050f3453ecf46556b9 (patch) | |
tree | ba8397bcfbf5747708f040fee76a6dd5cb8bc515 /uitest/src/com | |
parent | ce0640100a3892a1e36d25df1b85de73b6e2d1d0 (diff) | |
download | vaadin-framework-0121af0c28d92db37dea94050f3453ecf46556b9.tar.gz vaadin-framework-0121af0c28d92db37dea94050f3453ecf46556b9.zip |
Changed Property.setValue(Object) to setValue(T) (#8791)
Change-Id: I9f0e6bd62102c5adc461884b1f3b2cbe69f19259
Diffstat (limited to 'uitest/src/com')
11 files changed, 13 insertions, 22 deletions
diff --git a/uitest/src/com/vaadin/tests/TestMethodProperty.java b/uitest/src/com/vaadin/tests/TestMethodProperty.java index 49a3c110fa..ab9c416a5c 100644 --- a/uitest/src/com/vaadin/tests/TestMethodProperty.java +++ b/uitest/src/com/vaadin/tests/TestMethodProperty.java @@ -15,7 +15,7 @@ public class TestMethodProperty { Integer.TYPE, myTest, "getInt", "setInt", new Object[0], new Object[] { null }, 0); - methodProperty2.setValue("3"); + methodProperty2.setValue(3); System.out.println("Succeeded"); diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java index efba67199d..7b2b945f23 100644 --- a/uitest/src/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java +++ b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java @@ -20,7 +20,7 @@ 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 AbstractField> extends AbstractComponentTest<T> implements ValueChangeListener, ReadOnlyStatusChangeListener { diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithManyColumns.java b/uitest/src/com/vaadin/tests/components/table/TableWithManyColumns.java index e0ae38a8b9..c73409838a 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableWithManyColumns.java +++ b/uitest/src/com/vaadin/tests/components/table/TableWithManyColumns.java @@ -20,7 +20,7 @@ public class TableWithManyColumns extends TestBase { for (int row = 0; row < ROWS; row++) { Item i = t.addItem(String.valueOf(row)); for (int col = 0; col < COLS; col++) { - Property<?> p = i.getItemProperty("COLUMN_" + col); + Property<String> p = i.getItemProperty("COLUMN_" + col); p.setValue("item " + row + "/" + col); } } diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java b/uitest/src/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java index 4184892545..6960fed2fe 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java +++ b/uitest/src/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java @@ -34,15 +34,8 @@ public class TextFieldWithPropertyFormatter extends TestBase { } @Override - public void setValue(Object newValue) throws ReadOnlyException { - if (newValue == null) { - value = null; - } else if (newValue instanceof BigDecimal) { - value = (BigDecimal) newValue; - } else { - throw new IllegalArgumentException( - "Value must be of type BigDecimal"); - } + public void setValue(BigDecimal newValue) throws ReadOnlyException { + value = newValue; } @Override diff --git a/uitest/src/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java b/uitest/src/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java index eba8ded705..b1e080fc16 100644 --- a/uitest/src/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java +++ b/uitest/src/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java @@ -99,7 +99,7 @@ public class HierarchicalWrapperOrdering extends TestBase { // Get first item Object itemId = indexedContainer.getIdByIndex(0); Item item = indexedContainer.getItem(itemId); - Property<String> property = (Property<String>) item + Property<String> property = item .getItemProperty("name"); // Prepend with Z so item should get sorted later property.setValue("Z " + property.getValue()); diff --git a/uitest/src/com/vaadin/tests/integration/LiferayThemeDemo.java b/uitest/src/com/vaadin/tests/integration/LiferayThemeDemo.java index df36ca4e58..5b0195f202 100644 --- a/uitest/src/com/vaadin/tests/integration/LiferayThemeDemo.java +++ b/uitest/src/com/vaadin/tests/integration/LiferayThemeDemo.java @@ -526,7 +526,7 @@ public class LiferayThemeDemo extends LegacyApplication { Slider s = new Slider(); s.setWidth("200px"); try { - s.setValue(50); + s.setValue(50.0); } catch (ValueOutOfBoundsException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -538,7 +538,7 @@ public class LiferayThemeDemo extends LegacyApplication { s.setOrientation(SliderOrientation.VERTICAL); s.setHeight("200px"); try { - s.setValue(50); + s.setValue(50.0); } catch (ValueOutOfBoundsException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java index 0d5f187136..9ad7c46b90 100644 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java +++ b/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java @@ -514,7 +514,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests { fields[0].setRequiredError("required error"); fields[1] = new TextField(); - fields[1].setValue("TEXTFIELD2"); + ((TextField) fields[1]).setValue("TEXTFIELD2"); fields[1] .setComponentError(new UserError("component error, user error")); diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java index bd3f2b2543..5eb11aea0d 100644 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java +++ b/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java @@ -542,7 +542,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests { fields[0].setRequiredError("required error"); fields[1] = new TextField(); - fields[1].setValue("TEXTFIELD2"); + ((TextField) fields[1]).setValue("TEXTFIELD2"); fields[1] .setComponentError(new UserError("component error, user error")); diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1245.java b/uitest/src/com/vaadin/tests/tickets/Ticket1245.java index eba9514241..4b7c5705ac 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1245.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1245.java @@ -80,9 +80,7 @@ class TreeExample extends CustomComponent { // get the created item final Item item = tree.getItem(id); // set our "caption" property - @SuppressWarnings("unchecked") - final Property<String> p = (Property<String>) item - .getItemProperty(CAPTION_PROPERTY); + final Property<String> p = item.getItemProperty(CAPTION_PROPERTY); p.setValue(caption); if (parent != null) { tree.setChildrenAllowed(parent, true); diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2998.java b/uitest/src/com/vaadin/tests/tickets/Ticket2998.java index ca1929cf1c..ab263e54ea 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2998.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2998.java @@ -165,7 +165,7 @@ public class Ticket2998 extends LegacyApplication { return getSecondaryTypesList(itemId); } - final Field<?> f = super.createField(container, itemId, propertyId, + final Field f = super.createField(container, itemId, propertyId, uiContext); if (f != null) { if (f instanceof TextField) { diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket677.java b/uitest/src/com/vaadin/tests/tickets/Ticket677.java index 588d16daec..1f72291c4a 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket677.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket677.java @@ -133,7 +133,7 @@ public class Ticket677 extends LegacyApplication { table.addContainerProperty("Text", String.class, null); for (int i = 0; i < 150; i++) { Item item = table.addItem("Item" + i); - Property<?> p = item.getItemProperty("Text"); + Property<String> p = item.getItemProperty("Text"); p.setValue(i % 5 == 0 ? "enabled" : "disabled"); } |