Parcourir la source

Changed Property.setValue(Object) to setValue(T) (#8791)

Change-Id: I9f0e6bd62102c5adc461884b1f3b2cbe69f19259
tags/7.0.0.beta6
Artur Signell il y a 11 ans
Parent
révision
0121af0c28
42 fichiers modifiés avec 64 ajouts et 148 suppressions
  1. 1
    1
      server/src/com/vaadin/data/Container.java
  2. 1
    1
      server/src/com/vaadin/data/Item.java
  3. 1
    1
      server/src/com/vaadin/data/Property.java
  4. 1
    2
      server/src/com/vaadin/data/fieldgroup/FieldGroup.java
  5. 1
    1
      server/src/com/vaadin/data/util/AbstractBeanContainer.java
  6. 1
    1
      server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java
  7. 1
    1
      server/src/com/vaadin/data/util/ContainerOrderedWrapper.java
  8. 2
    2
      server/src/com/vaadin/data/util/FilesystemContainer.java
  9. 7
    7
      server/src/com/vaadin/data/util/IndexedContainer.java
  10. 2
    9
      server/src/com/vaadin/data/util/MethodProperty.java
  11. 2
    8
      server/src/com/vaadin/data/util/NestedMethodProperty.java
  12. 2
    11
      server/src/com/vaadin/data/util/ObjectProperty.java
  13. 1
    1
      server/src/com/vaadin/data/util/PropertyFormatter.java
  14. 1
    1
      server/src/com/vaadin/data/util/PropertysetItem.java
  15. 1
    1
      server/src/com/vaadin/data/util/TextFileProperty.java
  16. 1
    1
      server/src/com/vaadin/data/util/TransactionalPropertyWrapper.java
  17. 1
    1
      server/src/com/vaadin/data/util/sqlcontainer/RowItem.java
  18. 1
    1
      server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
  19. 3
    11
      server/src/com/vaadin/ui/AbstractField.java
  20. 1
    1
      server/src/com/vaadin/ui/AbstractSelect.java
  21. 1
    1
      server/src/com/vaadin/ui/AbstractTextField.java
  22. 2
    2
      server/src/com/vaadin/ui/DefaultFieldFactory.java
  23. 2
    2
      server/src/com/vaadin/ui/Form.java
  24. 2
    7
      server/src/com/vaadin/ui/Label.java
  25. 1
    1
      server/src/com/vaadin/ui/ProgressIndicator.java
  26. 2
    7
      server/src/com/vaadin/ui/Slider.java
  27. 1
    1
      server/tests/src/com/vaadin/data/util/filter/AbstractFilterTest.java
  28. 0
    34
      server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java
  29. 4
    4
      server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java
  30. 3
    3
      server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java
  31. 1
    1
      server/tests/src/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java
  32. 1
    1
      uitest/src/com/vaadin/tests/TestMethodProperty.java
  33. 1
    1
      uitest/src/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
  34. 1
    1
      uitest/src/com/vaadin/tests/components/table/TableWithManyColumns.java
  35. 2
    9
      uitest/src/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java
  36. 1
    1
      uitest/src/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java
  37. 2
    2
      uitest/src/com/vaadin/tests/integration/LiferayThemeDemo.java
  38. 1
    1
      uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
  39. 1
    1
      uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
  40. 1
    3
      uitest/src/com/vaadin/tests/tickets/Ticket1245.java
  41. 1
    1
      uitest/src/com/vaadin/tests/tickets/Ticket2998.java
  42. 1
    1
      uitest/src/com/vaadin/tests/tickets/Ticket677.java

+ 1
- 1
server/src/com/vaadin/data/Container.java Voir le fichier

@@ -132,7 +132,7 @@ public interface Container extends Serializable {
* ID of the Property to retrieve
* @return Property with the given ID or <code>null</code>
*/
public Property<?> getContainerProperty(Object itemId, Object propertyId);
public Property getContainerProperty(Object itemId, Object propertyId);

/**
* Gets the data type of all Properties identified by the given Property ID.

+ 1
- 1
server/src/com/vaadin/data/Item.java Voir le fichier

@@ -40,7 +40,7 @@ public interface Item extends Serializable {
* identifier of the Property to get
* @return the Property with the given ID or <code>null</code>
*/
public Property<?> getItemProperty(Object id);
public Property getItemProperty(Object id);

/**
* Gets the collection of IDs of all Properties stored in the Item.

+ 1
- 1
server/src/com/vaadin/data/Property.java Voir le fichier

@@ -76,7 +76,7 @@ public interface Property<T> extends Serializable {
* @throws Property.ReadOnlyException
* if the object is in read-only mode
*/
public void setValue(Object newValue) throws Property.ReadOnlyException;
public void setValue(T newValue) throws Property.ReadOnlyException;

/**
* Returns the type of the Property. The methods <code>getValue</code> and

+ 1
- 2
server/src/com/vaadin/data/fieldgroup/FieldGroup.java Voir le fichier

@@ -274,8 +274,7 @@ public class FieldGroup implements Serializable {
* If the property was not found in the item or no item has been
* set
*/
protected Property<?> getItemProperty(Object propertyId)
throws BindException {
protected Property getItemProperty(Object propertyId) throws BindException {
Item item = getItemDataSource();
if (item == null) {
throw new BindException("Could not lookup property with id "

+ 1
- 1
server/src/com/vaadin/data/util/AbstractBeanContainer.java Voir le fichier

@@ -274,7 +274,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
* java.lang.Object)
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
public Property getContainerProperty(Object itemId, Object propertyId) {
Item item = getItem(itemId);
if (item == null) {
return null;

+ 1
- 1
server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java Voir le fichier

@@ -671,7 +671,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* documentation from implemented interface.
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
public Property getContainerProperty(Object itemId, Object propertyId) {
return container.getContainerProperty(itemId, propertyId);
}


+ 1
- 1
server/src/com/vaadin/data/util/ContainerOrderedWrapper.java Voir le fichier

@@ -463,7 +463,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* documentation from implemented interface.
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
public Property getContainerProperty(Object itemId, Object propertyId) {
return container.getContainerProperty(itemId, propertyId);
}


+ 2
- 2
server/src/com/vaadin/data/util/FilesystemContainer.java Voir le fichier

@@ -481,7 +481,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* @return the requested property's value, or <code>null</code>
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
public Property getContainerProperty(Object itemId, Object propertyId) {

if (!(itemId instanceof File)) {
return null;
@@ -633,7 +633,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* here, we use the default documentation from implemented interface.
*/
@Override
public Property<?> getItemProperty(Object id) {
public Property getItemProperty(Object id) {
return getContainerProperty(file, id);
}


+ 7
- 7
server/src/com/vaadin/data/util/IndexedContainer.java Voir le fichier

@@ -163,7 +163,7 @@ public class IndexedContainer extends
* java.lang.Object)
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
public Property getContainerProperty(Object itemId, Object propertyId) {
if (!containsId(itemId)) {
return null;
}
@@ -734,7 +734,7 @@ public class IndexedContainer extends
* @see com.vaadin.data.Item#getItemProperty(java.lang.Object)
*/
@Override
public Property<?> getItemProperty(Object id) {
public Property getItemProperty(Object id) {
return new IndexedContainerProperty(itemId, id);
}

@@ -841,7 +841,7 @@ public class IndexedContainer extends
*
* @since 3.0
*/
private class IndexedContainerProperty implements Property<Object>,
private class IndexedContainerProperty<T> implements Property<T>,
Property.ValueChangeNotifier {

/**
@@ -881,8 +881,8 @@ public class IndexedContainer extends
* @see com.vaadin.data.Property#getType()
*/
@Override
public Class<?> getType() {
return types.get(propertyId);
public Class<T> getType() {
return (Class<T>) types.get(propertyId);
}

/*
@@ -891,8 +891,8 @@ public class IndexedContainer extends
* @see com.vaadin.data.Property#getValue()
*/
@Override
public Object getValue() {
return items.get(itemId).get(propertyId);
public T getValue() {
return (T) items.get(itemId).get(propertyId);
}

/*

+ 2
- 9
server/src/com/vaadin/data/util/MethodProperty.java Voir le fichier

@@ -651,21 +651,14 @@ public class MethodProperty<T> extends AbstractProperty<T> {
* @see #invokeSetMethod(Object)
*/
@Override
@SuppressWarnings("unchecked")
public void setValue(Object newValue) throws Property.ReadOnlyException {
public void setValue(T newValue) throws Property.ReadOnlyException {

// Checks the mode
if (isReadOnly()) {
throw new Property.ReadOnlyException();
}

// Checks the type of the value
if (newValue != null && !type.isAssignableFrom(newValue.getClass())) {
throw new IllegalArgumentException(
"Invalid value type for ObjectProperty.");
}

invokeSetMethod((T) newValue);
invokeSetMethod(newValue);
fireValueChange();
}


+ 2
- 8
server/src/com/vaadin/data/util/NestedMethodProperty.java Voir le fichier

@@ -217,19 +217,13 @@ public class NestedMethodProperty<T> extends AbstractProperty<T> {
* @see #invokeSetMethod(Object)
*/
@Override
public void setValue(Object newValue) throws ReadOnlyException {
public void setValue(T newValue) throws ReadOnlyException {
// Checks the mode
if (isReadOnly()) {
throw new Property.ReadOnlyException();
}

// Checks the type of the value
if (newValue != null && !type.isAssignableFrom(newValue.getClass())) {
throw new IllegalArgumentException(
"Invalid value type for NestedMethodProperty.");
}

invokeSetMethod((T) newValue);
invokeSetMethod(newValue);
fireValueChange();
}


+ 2
- 11
server/src/com/vaadin/data/util/ObjectProperty.java Voir le fichier

@@ -128,23 +128,14 @@ public class ObjectProperty<T> extends AbstractProperty<T> {
* read-only mode
*/
@Override
@SuppressWarnings("unchecked")
public void setValue(Object newValue) throws Property.ReadOnlyException {
public void setValue(T newValue) throws Property.ReadOnlyException {

// Checks the mode
if (isReadOnly()) {
throw new Property.ReadOnlyException();
}

// Checks the type of the value
if (newValue != null && !type.isAssignableFrom(newValue.getClass())) {
throw new IllegalArgumentException("Invalid value type "
+ newValue.getClass().getName()
+ " for ObjectProperty of type " + type.getName() + ".");
}

// the cast is safe after an isAssignableFrom check
this.value = (T) newValue;
this.value = newValue;

fireValueChange();
}

+ 1
- 1
server/src/com/vaadin/data/util/PropertyFormatter.java Voir le fichier

@@ -212,7 +212,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String>
}

@Override
public void setValue(Object newValue) throws ReadOnlyException {
public void setValue(String newValue) throws ReadOnlyException {
if (dataSource == null) {
return;
}

+ 1
- 1
server/src/com/vaadin/data/util/PropertysetItem.java Voir le fichier

@@ -68,7 +68,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
* @return the Property with the given ID or <code>null</code>
*/
@Override
public Property<?> getItemProperty(Object id) {
public Property getItemProperty(Object id) {
return map.get(id);
}


+ 1
- 1
server/src/com/vaadin/data/util/TextFileProperty.java Voir le fichier

@@ -129,7 +129,7 @@ public class TextFileProperty extends AbstractProperty<String> {
* @see com.vaadin.data.Property#setValue(java.lang.Object)
*/
@Override
public void setValue(Object newValue) throws ReadOnlyException {
public void setValue(String newValue) throws ReadOnlyException {
if (isReadOnly()) {
throw new ReadOnlyException();
}

+ 1
- 1
server/src/com/vaadin/data/util/TransactionalPropertyWrapper.java Voir le fichier

@@ -74,7 +74,7 @@ public class TransactionalPropertyWrapper<T> extends AbstractProperty<T>
}

@Override
public void setValue(Object newValue) throws ReadOnlyException {
public void setValue(T newValue) throws ReadOnlyException {
// Causes a value change to be sent to this listener which in turn fires
// a new value change event for this property
wrappedProperty.setValue(newValue);

+ 1
- 1
server/src/com/vaadin/data/util/sqlcontainer/RowItem.java Voir le fichier

@@ -61,7 +61,7 @@ public final class RowItem implements Item {
}

@Override
public Property<?> getItemProperty(Object id) {
public Property getItemProperty(Object id) {
if (id instanceof String && id != null) {
for (ColumnProperty cp : properties) {
if (id.equals(cp.getPropertyId())) {

+ 1
- 1
server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java Voir le fichier

@@ -248,7 +248,7 @@ public class SQLContainer implements Container, Container.Filterable,
*/

@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
public Property getContainerProperty(Object itemId, Object propertyId) {
Item item = getItem(itemId);
if (item == null) {
return null;

+ 3
- 11
server/src/com/vaadin/ui/AbstractField.java Voir le fichier

@@ -427,17 +427,9 @@ public abstract class AbstractField<T> extends AbstractComponent implements
* @throws Property.ReadOnlyException
*/
@Override
public void setValue(Object newFieldValue)
throws Property.ReadOnlyException, Converter.ConversionException {
// This check is needed as long as setValue accepts Object instead of T
if (newFieldValue != null) {
if (!getType().isAssignableFrom(newFieldValue.getClass())) {
throw new Converter.ConversionException("Value of type "
+ newFieldValue.getClass() + " cannot be assigned to "
+ getType().getName());
}
}
setValue((T) newFieldValue, false);
public void setValue(T newFieldValue) throws Property.ReadOnlyException,
Converter.ConversionException {
setValue(newFieldValue, false);
}

/**

+ 1
- 1
server/src/com/vaadin/ui/AbstractSelect.java Voir le fichier

@@ -784,7 +784,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements
* @see com.vaadin.data.Container#getContainerProperty(Object, Object)
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
public Property getContainerProperty(Object itemId, Object propertyId) {
return items.getContainerProperty(itemId, propertyId);
}


+ 1
- 1
server/src/com/vaadin/ui/AbstractTextField.java Voir le fichier

@@ -429,7 +429,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements
}

@Override
public void setValue(Object newValue) throws ReadOnlyException {
public void setValue(String newValue) throws ReadOnlyException {
super.setValue(newValue);
/*
* Make sure w reset lastKnownTextContent field on value change. The

+ 2
- 2
server/src/com/vaadin/ui/DefaultFieldFactory.java Voir le fichier

@@ -57,9 +57,9 @@ public class DefaultFieldFactory implements FormFieldFactory, TableFieldFactory
}

@Override
public Field<?> createField(Container container, Object itemId,
public Field createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
Property<?> containerProperty = container.getContainerProperty(itemId,
Property containerProperty = container.getContainerProperty(itemId,
propertyId);
Class<?> type = containerProperty.getType();
Field<?> field = createFieldByPropertyType(type);

+ 2
- 2
server/src/com/vaadin/ui/Form.java Voir le fichier

@@ -572,7 +572,7 @@ public class Form extends AbstractField<Object> implements Item.Editor,
* @see com.vaadin.data.Item#getItemProperty(Object)
*/
@Override
public Property<?> getItemProperty(Object id) {
public Property getItemProperty(Object id) {
final Field<?> field = fields.get(id);
if (field == null) {
// field does not exist or it is not (yet) created for this property
@@ -593,7 +593,7 @@ public class Form extends AbstractField<Object> implements Item.Editor,
* @param propertyId
* the id of the property.
*/
public Field<?> getField(Object propertyId) {
public Field getField(Object propertyId) {
return fields.get(propertyId);
}


+ 2
- 7
server/src/com/vaadin/ui/Label.java Voir le fichier

@@ -192,14 +192,9 @@ public class Label extends AbstractComponent implements Property<String>,
* the New value of the label.
*/
@Override
public void setValue(Object newStringValue) {
if (newStringValue != null && newStringValue.getClass() != String.class) {
throw new Converter.ConversionException("Value of type "
+ newStringValue.getClass() + " cannot be assigned to "
+ String.class.getName());
}
public void setValue(String newStringValue) {
if (getPropertyDataSource() == null) {
getState().text = (String) newStringValue;
getState().text = newStringValue;
} else {
throw new IllegalStateException(
"Label is only a Property.Viewer and cannot update its data source");

+ 1
- 1
server/src/com/vaadin/ui/ProgressIndicator.java Voir le fichier

@@ -153,7 +153,7 @@ public class ProgressIndicator extends AbstractField<Number> implements
* @see com.vaadin.ui.AbstractField#setValue()
*/
@Override
public void setValue(Object newValue) {
public void setValue(Number newValue) {
if (dataSource == null) {
throw new IllegalStateException("Datasource must be set");
}

+ 2
- 7
server/src/com/vaadin/ui/Slider.java Voir le fichier

@@ -289,14 +289,9 @@ public class Slider extends AbstractField<Double> {
}

@Override
public void setValue(Object newFieldValue) {
if (newFieldValue instanceof Number) {
// Support setting all types of Numbers
newFieldValue = ((Number) newFieldValue).doubleValue();
}
public void setValue(Double newFieldValue) {
super.setValue(newFieldValue);
// The cast is safe if the above call returned without throwing
getState().value = (Double) newFieldValue;
getState().value = newFieldValue;
}

/**

+ 1
- 1
server/tests/src/com/vaadin/data/util/filter/AbstractFilterTest.java Voir le fichier

@@ -30,7 +30,7 @@ public abstract class AbstractFilterTest<FILTERTYPE extends Filter> extends
}

@Override
public void setValue(Object newValue) throws ReadOnlyException {
public void setValue(String newValue) throws ReadOnlyException {
throw new ReadOnlyException();
}


+ 0
- 34
server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java Voir le fichier

@@ -67,40 +67,6 @@ public class AbstractFieldValueConversions extends TestCase {
assertEquals("abc", paulaBean.getFirstName());
}

public void testFailingConversion() {
TextField tf = new TextField();
tf.setConverter(new Converter<String, Integer>() {

@Override
public Integer convertToModel(String value, Locale locale) {
throw new ConversionException("Failed");
}

@Override
public String convertToPresentation(Integer value, Locale locale) {
throw new ConversionException("Failed");
}

@Override
public Class<Integer> getModelType() {
// TODO Auto-generated method stub
return null;
}

@Override
public Class<String> getPresentationType() {
// TODO Auto-generated method stub
return null;
}
});
try {
tf.setValue(1);
fail("setValue(Integer) should throw an exception");
} catch (Converter.ConversionException e) {
// OK, expected
}
}

public void testIntegerStringConversion() {
TextField tf = new TextField();


+ 4
- 4
server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java Voir le fichier

@@ -63,20 +63,20 @@ public class RemoveListenersOnDetach {
};
};

Property property = new AbstractProperty() {
Property<String> property = new AbstractProperty<String>() {
@Override
public Object getValue() {
public String getValue() {
return null;
}

@Override
public void setValue(Object newValue) throws ReadOnlyException,
public void setValue(String newValue) throws ReadOnlyException,
ConversionException {
fireValueChange();
}

@Override
public Class<?> getType() {
public Class<String> getType() {
return String.class;
}
};

+ 3
- 3
server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java Voir le fichier

@@ -10,12 +10,12 @@ public class SliderTest extends TestCase {

public void testOutOfBounds() {
Slider s = new Slider(0, 10);
s.setValue(0);
s.setValue(0.0);
Assert.assertEquals(0.0, s.getValue());
s.setValue(10);
s.setValue(10.0);
Assert.assertEquals(10.0, s.getValue());
try {
s.setValue(20);
s.setValue(20.0);
fail("Should throw out of bounds exception");
} catch (ValueOutOfBoundsException e) {
// TODO: handle exception

+ 1
- 1
server/tests/src/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java Voir le fichier

@@ -123,7 +123,7 @@ public abstract class AbstractTestFieldValueChange<T> extends TestCase {
* Override in subclasses to set value with changeVariables().
*/
protected void setValue(AbstractField<T> field) {
field.setValue("newValue");
field.setValue((T) "newValue");
}

}

+ 1
- 1
uitest/src/com/vaadin/tests/TestMethodProperty.java Voir le fichier

@@ -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");


+ 1
- 1
uitest/src/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java Voir le fichier

@@ -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 {


+ 1
- 1
uitest/src/com/vaadin/tests/components/table/TableWithManyColumns.java Voir le fichier

@@ -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);
}
}

+ 2
- 9
uitest/src/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java Voir le fichier

@@ -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

+ 1
- 1
uitest/src/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java Voir le fichier

@@ -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());

+ 2
- 2
uitest/src/com/vaadin/tests/integration/LiferayThemeDemo.java Voir le fichier

@@ -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();

+ 1
- 1
uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java Voir le fichier

@@ -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"));


+ 1
- 1
uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java Voir le fichier

@@ -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"));


+ 1
- 3
uitest/src/com/vaadin/tests/tickets/Ticket1245.java Voir le fichier

@@ -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);

+ 1
- 1
uitest/src/com/vaadin/tests/tickets/Ticket2998.java Voir le fichier

@@ -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) {

+ 1
- 1
uitest/src/com/vaadin/tests/tickets/Ticket677.java Voir le fichier

@@ -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");
}


Chargement…
Annuler
Enregistrer