diff options
author | Artur Signell <artur@vaadin.com> | 2011-12-21 19:35:25 +0200 |
---|---|---|
committer | Jens Jansson <peppe@vaadin.com> | 2011-12-22 09:53:12 +0200 |
commit | 9bbdbfdac99314db972c83e3105184f7b9989410 (patch) | |
tree | 804d40e7307b8f069587de045e7671e4f4b31907 | |
parent | a0accae9a71eec508811cab18f1e2959cb320b19 (diff) | |
download | vaadin-framework-9bbdbfdac99314db972c83e3105184f7b9989410.tar.gz vaadin-framework-9bbdbfdac99314db972c83e3105184f7b9989410.zip |
#8101 Swapped generics parameter order for Converter based on API review
meeting
16 files changed, 84 insertions, 93 deletions
diff --git a/src/com/vaadin/data/util/converter/Converter.java b/src/com/vaadin/data/util/converter/Converter.java index 2a2c3025d9..f48246ff4c 100644 --- a/src/com/vaadin/data/util/converter/Converter.java +++ b/src/com/vaadin/data/util/converter/Converter.java @@ -38,7 +38,7 @@ import java.util.Locale; * @VERSION@
* @since 7.0
*/
-public interface Converter<MODEL, PRESENTATION> extends Serializable {
+public interface Converter<PRESENTATION, MODEL> extends Serializable {
/**
* Converts the given value from target type to source type.
diff --git a/src/com/vaadin/data/util/converter/ConverterFactory.java b/src/com/vaadin/data/util/converter/ConverterFactory.java index 1770bf85ac..451f84185d 100644 --- a/src/com/vaadin/data/util/converter/ConverterFactory.java +++ b/src/com/vaadin/data/util/converter/ConverterFactory.java @@ -7,7 +7,8 @@ package com.vaadin.data.util.converter; import java.io.Serializable;
/**
- * Factory interface for providing Converters based on a source and target type.
+ * Factory interface for providing Converters based on a presentation type and a
+ * model type.
*
* @author Vaadin Ltd.
* @version
@@ -16,7 +17,7 @@ import java.io.Serializable; *
*/
public interface ConverterFactory extends Serializable {
- <SOURCE, TARGET> Converter<SOURCE, TARGET> createConverter(
- Class<SOURCE> sourceType, Class<TARGET> targetType);
+ public <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> createConverter(
+ Class<PRESENTATION> presentationType, Class<MODEL> modelType);
}
diff --git a/src/com/vaadin/data/util/converter/LongToDateConverter.java b/src/com/vaadin/data/util/converter/DateToLongConverter.java index c22e8af16e..c9a76ec39b 100644 --- a/src/com/vaadin/data/util/converter/LongToDateConverter.java +++ b/src/com/vaadin/data/util/converter/DateToLongConverter.java @@ -15,7 +15,7 @@ import java.util.Locale; * @VERSION@
* @since 7.0
*/
-public class LongToDateConverter implements Converter<Long, Date> {
+public class DateToLongConverter implements Converter<Date, Long> {
/*
* (non-Javadoc)
diff --git a/src/com/vaadin/data/util/converter/DefaultConverterFactory.java b/src/com/vaadin/data/util/converter/DefaultConverterFactory.java index 073eb10d55..9233624819 100644 --- a/src/com/vaadin/data/util/converter/DefaultConverterFactory.java +++ b/src/com/vaadin/data/util/converter/DefaultConverterFactory.java @@ -27,10 +27,10 @@ public class DefaultConverterFactory implements ConverterFactory { private final static Logger log = Logger
.getLogger(DefaultConverterFactory.class.getName());
- public <SOURCE, TARGET> Converter<SOURCE, TARGET> createConverter(
- Class<SOURCE> sourceType, Class<TARGET> targetType) {
- Converter<SOURCE, TARGET> converter = findConverter(sourceType,
- targetType);
+ public <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> createConverter(
+ Class<PRESENTATION> presentationType, Class<MODEL> modelType) {
+ Converter<PRESENTATION, MODEL> converter = findConverter(
+ presentationType, modelType);
if (converter != null) {
log.finest(getClass().getName() + " created a "
+ converter.getClass());
@@ -38,32 +38,32 @@ public class DefaultConverterFactory implements ConverterFactory { }
// Try to find a reverse converter
- Converter<TARGET, SOURCE> reverseConverter = findConverter(targetType,
- sourceType);
+ Converter<MODEL, PRESENTATION> reverseConverter = findConverter(
+ modelType, presentationType);
if (reverseConverter != null) {
log.finest(getClass().getName() + " created a reverse "
+ reverseConverter.getClass());
- return new ReverseConverter<SOURCE, TARGET>(reverseConverter);
+ return new ReverseConverter<PRESENTATION, MODEL>(reverseConverter);
}
log.finest(getClass().getName() + " could not find a converter for "
- + sourceType.getName() + " to " + targetType.getName()
+ + presentationType.getName() + " to " + modelType.getName()
+ " conversion");
return null;
}
- protected <SOURCE, TARGET> Converter<SOURCE, TARGET> findConverter(
- Class<SOURCE> sourceType, Class<TARGET> targetType) {
- if (targetType == String.class) {
+ protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter(
+ Class<PRESENTATION> presentationType, Class<MODEL> modelType) {
+ if (presentationType == String.class) {
// TextField converters and more
- Converter<SOURCE, TARGET> converter = (Converter<SOURCE, TARGET>) createStringConverter(sourceType);
+ Converter<PRESENTATION, MODEL> converter = (Converter<PRESENTATION, MODEL>) createStringConverter(modelType);
if (converter != null) {
return converter;
}
- } else if (targetType == Date.class) {
+ } else if (presentationType == Date.class) {
// DateField converters and more
- Converter<SOURCE, TARGET> converter = (Converter<SOURCE, TARGET>) createDateConverter(sourceType);
+ Converter<PRESENTATION, MODEL> converter = (Converter<PRESENTATION, MODEL>) createDateConverter(modelType);
if (converter != null) {
return converter;
}
@@ -73,25 +73,25 @@ public class DefaultConverterFactory implements ConverterFactory { }
- protected Converter<?, Date> createDateConverter(Class<?> sourceType) {
+ protected Converter<Date, ?> createDateConverter(Class<?> sourceType) {
if (Long.class.isAssignableFrom(sourceType)) {
- return new LongToDateConverter();
+ return new DateToLongConverter();
} else {
return null;
}
}
- protected Converter<?, String> createStringConverter(Class<?> sourceType) {
+ protected Converter<String, ?> createStringConverter(Class<?> sourceType) {
if (Double.class.isAssignableFrom(sourceType)) {
- return new DoubleToStringConverter();
+ return new StringToDoubleConverter();
} else if (Integer.class.isAssignableFrom(sourceType)) {
- return new IntegerToStringConverter();
+ return new StringToIntegerConverter();
} else if (Boolean.class.isAssignableFrom(sourceType)) {
- return new BooleanToStringConverter();
+ return new StringToBooleanConverter();
} else if (Number.class.isAssignableFrom(sourceType)) {
- return new NumberToStringConverter();
+ return new StringToNumberConverter();
} else if (Date.class.isAssignableFrom(sourceType)) {
- return new DateToStringConverter();
+ return new StringToDateConverter();
} else {
return null;
}
diff --git a/src/com/vaadin/data/util/converter/ReverseConverter.java b/src/com/vaadin/data/util/converter/ReverseConverter.java index c86ba72395..45f5abda65 100644 --- a/src/com/vaadin/data/util/converter/ReverseConverter.java +++ b/src/com/vaadin/data/util/converter/ReverseConverter.java @@ -20,10 +20,10 @@ import java.util.Locale; * @VERSION@
* @since 7.0
*/
-public class ReverseConverter<MODEL, PRESENTATION> implements
- Converter<MODEL, PRESENTATION> {
+public class ReverseConverter<PRESENTATION, MODEL> implements
+ Converter<PRESENTATION, MODEL> {
- private Converter<PRESENTATION, MODEL> realConverter;
+ private Converter<MODEL, PRESENTATION> realConverter;
/**
* Creates a converter from source to target based on a converter that
@@ -32,7 +32,7 @@ public class ReverseConverter<MODEL, PRESENTATION> implements * @param converter
* The converter to use in a reverse fashion
*/
- public ReverseConverter(Converter<PRESENTATION, MODEL> converter) {
+ public ReverseConverter(Converter<MODEL, PRESENTATION> converter) {
this.realConverter = converter;
}
diff --git a/src/com/vaadin/data/util/converter/BooleanToStringConverter.java b/src/com/vaadin/data/util/converter/StringToBooleanConverter.java index 9c6add7c99..5dfcf87e40 100644 --- a/src/com/vaadin/data/util/converter/BooleanToStringConverter.java +++ b/src/com/vaadin/data/util/converter/StringToBooleanConverter.java @@ -7,7 +7,7 @@ package com.vaadin.data.util.converter; import java.util.Locale;
/**
- * A converter that converts from {@link Boolean} to {@link String} and back.
+ * A converter that converts from {@link String} to {@link Boolean} and back.
* The String representation is given by Boolean.toString().
* <p>
* Leading and trailing white spaces are ignored when converting from a String.
@@ -18,7 +18,7 @@ import java.util.Locale; * @VERSION@
* @since 7.0
*/
-public class BooleanToStringConverter implements Converter<Boolean, String> {
+public class StringToBooleanConverter implements Converter<String, Boolean> {
/*
* (non-Javadoc)
diff --git a/src/com/vaadin/data/util/converter/DateToStringConverter.java b/src/com/vaadin/data/util/converter/StringToDateConverter.java index 947a426db6..c97090334d 100644 --- a/src/com/vaadin/data/util/converter/DateToStringConverter.java +++ b/src/com/vaadin/data/util/converter/StringToDateConverter.java @@ -24,12 +24,11 @@ import java.util.Locale; * @VERSION@
* @since 7.0
*/
-public class DateToStringConverter implements Converter<Date, String> {
+public class StringToDateConverter implements Converter<String, Date> {
/**
- * Returns the format used by
- * {@link #convertToPresentation(Date, Locale)} and
- * {@link #convertToModel(String, Locale)}.
+ * Returns the format used by {@link #convertToPresentation(Date, Locale)}
+ * and {@link #convertToModel(String, Locale)}.
*
* @param locale
* The locale to use
diff --git a/src/com/vaadin/data/util/converter/DoubleToStringConverter.java b/src/com/vaadin/data/util/converter/StringToDoubleConverter.java index a6bebaddd3..0c60aea5cb 100644 --- a/src/com/vaadin/data/util/converter/DoubleToStringConverter.java +++ b/src/com/vaadin/data/util/converter/StringToDoubleConverter.java @@ -9,7 +9,7 @@ import java.text.ParsePosition; import java.util.Locale;
/**
- * A converter that converts from {@link Double} to {@link String} and back.
+ * A converter that converts from {@link String} to {@link Double} and back.
* Uses the given locale and a {@link NumberFormat} instance for formatting and
* parsing.
* <p>
@@ -24,12 +24,11 @@ import java.util.Locale; * @VERSION@
* @since 7.0
*/
-public class DoubleToStringConverter implements Converter<Double, String> {
+public class StringToDoubleConverter implements Converter<String, Double> {
/**
- * Returns the format used by
- * {@link #convertToPresentation(Double, Locale)} and
- * {@link #convertToModel(String, Locale)}.
+ * Returns the format used by {@link #convertToPresentation(Double, Locale)}
+ * and {@link #convertToModel(String, Locale)}.
*
* @param locale
* The locale to use
diff --git a/src/com/vaadin/data/util/converter/IntegerToStringConverter.java b/src/com/vaadin/data/util/converter/StringToIntegerConverter.java index 5c0d6761c0..7fa4458c51 100644 --- a/src/com/vaadin/data/util/converter/IntegerToStringConverter.java +++ b/src/com/vaadin/data/util/converter/StringToIntegerConverter.java @@ -9,7 +9,7 @@ import java.text.ParsePosition; import java.util.Locale;
/**
- * A converter that converts from {@link Integer} to {@link String} and back.
+ * A converter that converts from {@link String} to {@link Integer} and back.
* Uses the given locale and a {@link NumberFormat} instance for formatting and
* parsing.
* <p>
@@ -21,7 +21,7 @@ import java.util.Locale; * @VERSION@
* @since 7.0
*/
-public class IntegerToStringConverter implements Converter<Integer, String> {
+public class StringToIntegerConverter implements Converter<String, Integer> {
/**
* Returns the format used by
diff --git a/src/com/vaadin/data/util/converter/NumberToStringConverter.java b/src/com/vaadin/data/util/converter/StringToNumberConverter.java index cd4c1363b7..8975dad9f3 100644 --- a/src/com/vaadin/data/util/converter/NumberToStringConverter.java +++ b/src/com/vaadin/data/util/converter/StringToNumberConverter.java @@ -20,12 +20,11 @@ import java.util.Locale; * @VERSION@
* @since 7.0
*/
-public class NumberToStringConverter implements Converter<Number, String> {
+public class StringToNumberConverter implements Converter<String, Number> {
/**
- * Returns the format used by
- * {@link #convertToPresentation(Number, Locale)} and
- * {@link #convertToModel(String, Locale)}.
+ * Returns the format used by {@link #convertToPresentation(Number, Locale)}
+ * and {@link #convertToModel(String, Locale)}.
*
* @param locale
* The locale to use
diff --git a/src/com/vaadin/ui/AbstractField.java b/src/com/vaadin/ui/AbstractField.java index 9e4bdde064..cbdee0eae1 100644 --- a/src/com/vaadin/ui/AbstractField.java +++ b/src/com/vaadin/ui/AbstractField.java @@ -72,7 +72,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements * A converter used to convert from the data model type to the field type * and vice versa. */ - private Converter<Object, T> converter = null; + private Converter<T, Object> converter = null; /** * Connected data-source. */ @@ -787,13 +787,13 @@ public abstract class AbstractField<T> extends AbstractComponent implements * from */ public void setConverter(Class<?> datamodelType) { - Converter<?, T> converter = null; + Converter<T, ?> converter = null; Application app = Application.getCurrentApplication(); if (app != null) { ConverterFactory factory = app.getConverterFactory(); - converter = (Converter<?, T>) factory.createConverter( - datamodelType, getType()); + converter = (Converter<T, ?>) factory.createConverter(getType(), + datamodelType); } setConverter(converter); } @@ -850,8 +850,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements * an exception. */ try { - return converter.convertToModel(fieldValue, - getLocale()); + return converter.convertToModel(fieldValue, getLocale()); } catch (com.vaadin.data.util.converter.Converter.ConversionException e) { throw new Converter.ConversionException( getValueConversionError(converter.getModelType()), e); @@ -1030,8 +1029,8 @@ public abstract class AbstractField<T> extends AbstractComponent implements // to validate the converted value if (getConverter() != null) { try { - valueToValidate = getConverter().convertToModel( - fieldValue, getLocale()); + valueToValidate = getConverter().convertToModel(fieldValue, + getLocale()); } catch (Exception e) { throw new InvalidValueException( getValueConversionError(getConverter().getModelType())); @@ -1586,23 +1585,20 @@ public abstract class AbstractField<T> extends AbstractComponent implements * * @return The converter or null if none is set. */ - public Converter<Object, T> getConverter() { + public Converter<T, Object> getConverter() { return converter; } /** - * Sets the converter used to convert the property data source value to the - * field value. The converter must have a target type that matches the field - * type. - * - * The source for the converter is the data model and the target is the - * field. + * Sets the converter used to convert the field value to property data + * source type. The converter must have a presentation type that matches the + * field type. * * @param converter * The new converter to use. */ - public void setConverter(Converter<?, T> converter) { - this.converter = (Converter<Object, T>) converter; + public void setConverter(Converter<T, ?> converter) { + this.converter = (Converter<T, Object>) converter; requestRepaint(); } diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 5ab0fb9029..8b9dc3ef81 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -410,7 +410,7 @@ public class Table extends AbstractSelect implements Action.Container, private boolean painted = false; - private HashMap<Object, Converter> propertyValueConverters = new HashMap<Object, Converter>(); + private HashMap<Object, Converter<String, Object>> propertyValueConverters = new HashMap<Object, Converter<String, Object>>(); /* Table constructors */ @@ -3462,16 +3462,16 @@ public class Table extends AbstractSelect implements Action.Container, if (property == null) { return ""; } - Converter<Object, String> converter = null; + Converter<String, Object> converter = null; if (hasConverter(colId)) { converter = getConverter(colId); } else { Application app = Application.getCurrentApplication(); if (app != null) { - converter = (Converter<Object, String>) app - .getConverterFactory().createConverter( - property.getType(), String.class); + converter = (Converter<String, Object>) app + .getConverterFactory().createConverter(String.class, + property.getType()); } } Object value = property.getValue(); @@ -5143,7 +5143,7 @@ public class Table extends AbstractSelect implements Action.Container, * @param converter * The converter to use for the property id */ - public void setConverter(Object propertyId, Converter<?, String> converter) { + public void setConverter(Object propertyId, Converter<String, ?> converter) { if (!getContainerPropertyIds().contains(propertyId)) { throw new IllegalArgumentException("PropertyId " + propertyId + " must be in the container"); @@ -5158,7 +5158,8 @@ public class Table extends AbstractSelect implements Action.Container, // + ") must match converter source type (" // + converter.getSourceType() + ")"); // } - propertyValueConverters.put(propertyId, converter); + propertyValueConverters.put(propertyId, + (Converter<String, Object>) converter); refreshRowCache(); } @@ -5182,7 +5183,7 @@ public class Table extends AbstractSelect implements Action.Container, * @return The converter used to format the propertyId or null if no * converter has been set */ - public Converter<Object, String> getConverter(Object propertyId) { + public Converter<String, Object> getConverter(Object propertyId) { return propertyValueConverters.get(propertyId); } diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java index 9de7425423..753afbdd06 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java @@ -6,7 +6,7 @@ import junit.framework.TestCase; import com.vaadin.data.util.MethodProperty;
import com.vaadin.data.util.converter.Converter;
-import com.vaadin.data.util.converter.IntegerToStringConverter;
+import com.vaadin.data.util.converter.StringToIntegerConverter;
import com.vaadin.tests.data.bean.Address;
import com.vaadin.tests.data.bean.Country;
import com.vaadin.tests.data.bean.Person;
@@ -64,7 +64,7 @@ public class AbstractFieldValueConversions extends TestCase { public void testFailingConversion() {
TextField tf = new TextField();
- tf.setConverter(new Converter<Integer, String>() {
+ tf.setConverter(new Converter<String, Integer>() {
public Integer convertToModel(String value, Locale locale) {
throw new ConversionException("Failed");
@@ -95,7 +95,7 @@ public class AbstractFieldValueConversions extends TestCase { public void testIntegerStringConversion() {
TextField tf = new TextField();
- tf.setConverter(new IntegerToStringConverter());
+ tf.setConverter(new StringToIntegerConverter());
tf.setPropertyDataSource(new MethodProperty<Integer>(paulaBean, "age"));
assertEquals(34, tf.getPropertyDataSource().getValue());
assertEquals("34", tf.getValue());
@@ -111,16 +111,14 @@ public class AbstractFieldValueConversions extends TestCase { CheckBox cb = new CheckBox();
cb.setConverter(new Converter<Boolean, Boolean>() {
- public Boolean convertToModel(Boolean value,
- Locale locale) {
+ public Boolean convertToModel(Boolean value, Locale locale) {
// value from a CheckBox should never be null as long as it is
// not set to null (handled by conversion below).
assertNotNull(value);
return value;
}
- public Boolean convertToPresentation(Boolean value,
- Locale locale) {
+ public Boolean convertToPresentation(Boolean value, Locale locale) {
// Datamodel -> field
if (value == null) {
return false;
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java b/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java index 9ef42cf4b0..274ac64b44 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java @@ -5,7 +5,7 @@ import java.util.Locale; import com.vaadin.data.util.converter.Converter;
public class Vaadin6ImplicitDoubleConverter implements
- Converter<Double, String> {
+ Converter<String, Double> {
public Double convertToModel(String value, Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
diff --git a/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java b/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java index e92c1ab17a..2380b12933 100644 --- a/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java +++ b/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java @@ -9,7 +9,7 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.data.util.converter.Converter;
-import com.vaadin.data.util.converter.NumberToStringConverter;
+import com.vaadin.data.util.converter.StringToNumberConverter;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.data.bean.Address;
import com.vaadin.tests.data.bean.Country;
@@ -143,12 +143,11 @@ public class DoublesInTable extends TestBase { }
private void addConverters(Table t) {
- t.setConverter("sex", new Converter<Sex, String>() {
+ t.setConverter("sex", new Converter<String, Sex>() {
public Sex convertToModel(String value, Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
- // not used in this test - Table only converts from source to
- // target
+ // not used in this test - Table only converts to presentation
return null;
}
@@ -168,7 +167,7 @@ public class DoublesInTable extends TestBase { return String.class;
}
});
- t.setConverter("deceased", new Converter<Boolean, String>() {
+ t.setConverter("deceased", new Converter<String, Boolean>() {
public Boolean convertToModel(String value, Locale locale) {
// not used in this test - Table only converts from source to
@@ -192,7 +191,7 @@ public class DoublesInTable extends TestBase { return String.class;
}
});
- t.setConverter("age", new Converter<Integer, String>() {
+ t.setConverter("age", new Converter<String, Integer>() {
public Integer convertToModel(String value, Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
@@ -225,12 +224,11 @@ public class DoublesInTable extends TestBase { return String.class;
}
});
- t.setConverter("address", new Converter<Address, String>() {
+ t.setConverter("address", new Converter<String, Address>() {
public Address convertToModel(String value, Locale locale)
throws ConversionException {
- // not used in this test - Table only converts from source to
- // target
+ // not used in this test - Table only converts to presentation
return null;
}
@@ -250,7 +248,7 @@ public class DoublesInTable extends TestBase { });
- t.setConverter("rent", new NumberToStringConverter() {
+ t.setConverter("rent", new StringToNumberConverter() {
@Override
protected NumberFormat getFormat(Locale locale) {
return NumberFormat.getCurrencyInstance(locale);
diff --git a/tests/testbench/com/vaadin/tests/fieldbinder/BasicPersonForm.java b/tests/testbench/com/vaadin/tests/fieldbinder/BasicPersonForm.java index 1e7d90ec18..de7193d849 100644 --- a/tests/testbench/com/vaadin/tests/fieldbinder/BasicPersonForm.java +++ b/tests/testbench/com/vaadin/tests/fieldbinder/BasicPersonForm.java @@ -7,7 +7,7 @@ import com.vaadin.data.fieldbinder.FieldBinder.CommitException; import com.vaadin.data.fieldbinder.FieldBinder.CommitHandler;
import com.vaadin.data.fieldbinder.FormBuilder;
import com.vaadin.data.util.BeanItem;
-import com.vaadin.data.util.converter.BooleanToStringConverter;
+import com.vaadin.data.util.converter.StringToBooleanConverter;
import com.vaadin.data.validator.EmailValidator;
import com.vaadin.data.validator.IntegerRangeValidator;
import com.vaadin.data.validator.StringLengthValidator;
@@ -160,7 +160,7 @@ public class BasicPersonForm extends TestBase { age.addValidator(new IntegerRangeValidator(
"Must be between 0 and 150, {0} is not", 0, 150));
sex.setPageLength(0);
- deceased.setConverter(new BooleanToStringConverter() {
+ deceased.setConverter(new StringToBooleanConverter() {
@Override
protected String getTrueString() {
return "YAY!";
|