* com.vaadin.data.util.converter.Converter#convertFromTargetToSource(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public Boolean convertFromTargetToSource(String value, Locale locale)\r
+ public Boolean convertToModel(String value, Locale locale)\r
throws ConversionException {\r
if (value == null) {\r
return null;\r
* com.vaadin.data.util.converter.Converter#convertFromSourceToTarget(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public String convertFromSourceToTarget(Boolean value, Locale locale)\r
+ public String convertToPresentation(Boolean value, Locale locale)\r
throws ConversionException {\r
if (value == null) {\r
return null;\r
* \r
* @see com.vaadin.data.util.converter.Converter#getSourceType()\r
*/\r
- public Class<Boolean> getSourceType() {\r
+ public Class<Boolean> getModelType() {\r
return Boolean.class;\r
}\r
\r
* \r
* @see com.vaadin.data.util.converter.Converter#getTargetType()\r
*/\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
\r
import java.util.Locale;\r
\r
/**\r
- * Interface that implements conversion between objects of one type to another\r
- * and back.\r
+ * Interface that implements conversion between objects between model and\r
+ * presentation types.\r
* <p>\r
- * Typically {@link #convertFromSourceToTarget(Object, Locale)} and\r
- * {@link #convertFromTargetToSource(Object, Locale)} should be symmetric so\r
- * that chaining these together returns the original result for all input but\r
- * this is not a requirement.\r
+ * Typically {@link #convertToPresentation(Object, Locale)} and\r
+ * {@link #convertToModel(Object, Locale)} should be symmetric so that chaining\r
+ * these together returns the original result for all input but this is not a\r
+ * requirement.\r
* </p>\r
* <p>\r
* Converters must not have any side effects (never update UI from inside a\r
* If conversion of a value fails, a {@link ConversionException} is thrown.\r
* </p>\r
* \r
- * @param <SOURCE>\r
- * The source type. Must be compatible with what\r
- * {@link #getSourceType()} returns.\r
- * @param <TARGET>\r
- * The target type. Must be compatible with what\r
- * {@link #getTargetType()} returns.\r
+ * @param <MODEL>\r
+ * The model type. Must be compatible with what\r
+ * {@link #getModelType()} returns.\r
+ * @param <PRESENTATION>\r
+ * The presentation type. Must be compatible with what\r
+ * {@link #getPresentationType()} returns.\r
* @author Vaadin Ltd.\r
* @version\r
* @VERSION@\r
* @since 7.0\r
*/\r
-public interface Converter<SOURCE, TARGET> extends Serializable {\r
+public interface Converter<MODEL, PRESENTATION> extends Serializable {\r
\r
/**\r
* Converts the given value from target type to source type.\r
* A converter can optionally use locale to do the conversion.\r
* </p>\r
* A converter should in most cases be symmetric so chaining\r
- * {@link #convertFromSourceToTarget(Object, Locale)} and\r
- * {@link #convertFromTargetToSource(Object, Locale)} should return the\r
- * original value.\r
+ * {@link #convertToPresentation(Object, Locale)} and\r
+ * {@link #convertToModel(Object, Locale)} should return the original value.\r
* \r
* @param value\r
* The value to convert, compatible with the target type. Can be\r
* @throws ConversionException\r
* If the value could not be converted\r
*/\r
- public SOURCE convertFromTargetToSource(TARGET value, Locale locale)\r
+ public MODEL convertToModel(PRESENTATION value, Locale locale)\r
throws ConversionException;\r
\r
/**\r
* A converter can optionally use locale to do the conversion.\r
* </p>\r
* A converter should in most cases be symmetric so chaining\r
- * {@link #convertFromSourceToTarget(Object, Locale)} and\r
- * {@link #convertFromTargetToSource(Object, Locale)} should return the\r
- * original value.\r
+ * {@link #convertToPresentation(Object, Locale)} and\r
+ * {@link #convertToModel(Object, Locale)} should return the original value.\r
* \r
* @param value\r
* The value to convert, compatible with the target type. Can be\r
* @throws ConversionException\r
* If the value could not be converted\r
*/\r
- public TARGET convertFromSourceToTarget(SOURCE value, Locale locale)\r
+ public PRESENTATION convertToPresentation(MODEL value, Locale locale)\r
throws ConversionException;\r
\r
/**\r
* The source type of the converter.\r
* \r
* Values of this type can be passed to\r
- * {@link #convertFromSourceToTarget(Object, Locale)}.\r
+ * {@link #convertToPresentation(Object, Locale)}.\r
* \r
* @return The source type\r
*/\r
- public Class<SOURCE> getSourceType();\r
+ public Class<MODEL> getModelType();\r
\r
/**\r
* The target type of the converter.\r
* \r
* Values of this type can be passed to\r
- * {@link #convertFromTargetToSource(Object, Locale)}.\r
+ * {@link #convertToModel(Object, Locale)}.\r
* \r
* @return The target type\r
*/\r
- public Class<TARGET> getTargetType();\r
+ public Class<PRESENTATION> getPresentationType();\r
\r
/**\r
* An exception that signals that the value passed to\r
- * {@link Converter#convertFromSourceToTarget(Object, Locale)} or\r
- * {@link Converter#convertFromTargetToSource(Object, Locale)} could not be\r
- * converted.\r
+ * {@link Converter#convertToPresentation(Object, Locale)} or\r
+ * {@link Converter#convertToModel(Object, Locale)} could not be converted.\r
* \r
* @author Vaadin Ltd\r
* @version\r
\r
/**\r
* Returns the format used by\r
- * {@link #convertFromSourceToTarget(Date, Locale)} and\r
- * {@link #convertFromTargetToSource(String, Locale)}.\r
+ * {@link #convertToPresentation(Date, Locale)} and\r
+ * {@link #convertToModel(String, Locale)}.\r
* \r
* @param locale\r
* The locale to use\r
* com.vaadin.data.util.converter.Converter#convertFromTargetToSource(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public Date convertFromTargetToSource(String value, Locale locale)\r
+ public Date convertToModel(String value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
if (value == null) {\r
return null;\r
Date parsedValue = getFormat(locale).parse(value, parsePosition);\r
if (parsePosition.getIndex() != value.length()) {\r
throw new ConversionException("Could not convert '" + value\r
- + "' to " + getTargetType().getName());\r
+ + "' to " + getPresentationType().getName());\r
}\r
\r
return parsedValue;\r
* com.vaadin.data.util.converter.Converter#convertFromSourceToTarget(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public String convertFromSourceToTarget(Date value, Locale locale)\r
+ public String convertToPresentation(Date value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
if (value == null) {\r
return null;\r
* \r
* @see com.vaadin.data.util.converter.Converter#getSourceType()\r
*/\r
- public Class<Date> getSourceType() {\r
+ public Class<Date> getModelType() {\r
return Date.class;\r
}\r
\r
* \r
* @see com.vaadin.data.util.converter.Converter#getTargetType()\r
*/\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
\r
\r
/**\r
* Returns the format used by\r
- * {@link #convertFromSourceToTarget(Double, Locale)} and\r
- * {@link #convertFromTargetToSource(String, Locale)}.\r
+ * {@link #convertToPresentation(Double, Locale)} and\r
+ * {@link #convertToModel(String, Locale)}.\r
* \r
* @param locale\r
* The locale to use\r
* com.vaadin.data.util.converter.Converter#convertFromTargetToSource(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public Double convertFromTargetToSource(String value, Locale locale)\r
+ public Double convertToModel(String value, Locale locale)\r
throws ConversionException {\r
if (value == null) {\r
return null;\r
Number parsedValue = getFormat(locale).parse(value, parsePosition);\r
if (parsePosition.getIndex() != value.length()) {\r
throw new ConversionException("Could not convert '" + value\r
- + "' to " + getTargetType().getName());\r
+ + "' to " + getPresentationType().getName());\r
}\r
return parsedValue.doubleValue();\r
}\r
* com.vaadin.data.util.converter.Converter#convertFromSourceToTarget(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public String convertFromSourceToTarget(Double value, Locale locale)\r
+ public String convertToPresentation(Double value, Locale locale)\r
throws ConversionException {\r
if (value == null) {\r
return null;\r
* \r
* @see com.vaadin.data.util.converter.Converter#getSourceType()\r
*/\r
- public Class<Double> getSourceType() {\r
+ public Class<Double> getModelType() {\r
return Double.class;\r
}\r
\r
* \r
* @see com.vaadin.data.util.converter.Converter#getTargetType()\r
*/\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
}\r
\r
/**\r
* Returns the format used by\r
- * {@link #convertFromSourceToTarget(Integer, Locale)} and\r
- * {@link #convertFromTargetToSource(String, Locale)}.\r
+ * {@link #convertToPresentation(Integer, Locale)} and\r
+ * {@link #convertToModel(String, Locale)}.\r
* \r
* @param locale\r
* The locale to use\r
return NumberFormat.getIntegerInstance(locale);\r
}\r
\r
- public Integer convertFromTargetToSource(String value, Locale locale)\r
+ public Integer convertToModel(String value, Locale locale)\r
throws ConversionException {\r
if (value == null) {\r
return null;\r
Number parsedValue = getFormat(locale).parse(value, parsePosition);\r
if (parsePosition.getIndex() != value.length()) {\r
throw new ConversionException("Could not convert '" + value\r
- + "' to " + getSourceType().getName());\r
+ + "' to " + getModelType().getName());\r
}\r
\r
if (parsedValue == null) {\r
return parsedValue.intValue();\r
}\r
\r
- public String convertFromSourceToTarget(Integer value, Locale locale)\r
+ public String convertToPresentation(Integer value, Locale locale)\r
throws ConversionException {\r
if (value == null) {\r
return null;\r
return getFormat(locale).format(value);\r
}\r
\r
- public Class<Integer> getSourceType() {\r
+ public Class<Integer> getModelType() {\r
return Integer.class;\r
}\r
\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
\r
* com.vaadin.data.util.converter.Converter#convertFromTargetToSource(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public Long convertFromTargetToSource(Date value, Locale locale) {\r
+ public Long convertToModel(Date value, Locale locale) {\r
if (value == null) {\r
return null;\r
}\r
* com.vaadin.data.util.converter.Converter#convertFromSourceToTarget(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public Date convertFromSourceToTarget(Long value, Locale locale) {\r
+ public Date convertToPresentation(Long value, Locale locale) {\r
if (value == null) {\r
return null;\r
}\r
* \r
* @see com.vaadin.data.util.converter.Converter#getSourceType()\r
*/\r
- public Class<Long> getSourceType() {\r
+ public Class<Long> getModelType() {\r
return Long.class;\r
}\r
\r
* \r
* @see com.vaadin.data.util.converter.Converter#getTargetType()\r
*/\r
- public Class<Date> getTargetType() {\r
+ public Class<Date> getPresentationType() {\r
return Date.class;\r
}\r
\r
\r
/**\r
* Returns the format used by\r
- * {@link #convertFromSourceToTarget(Number, Locale)} and\r
- * {@link #convertFromTargetToSource(String, Locale)}.\r
+ * {@link #convertToPresentation(Number, Locale)} and\r
+ * {@link #convertToModel(String, Locale)}.\r
* \r
* @param locale\r
* The locale to use\r
* com.vaadin.data.util.converter.Converter#convertFromTargetToSource(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public Number convertFromTargetToSource(String value, Locale locale)\r
+ public Number convertToModel(String value, Locale locale)\r
throws ConversionException {\r
if (value == null) {\r
return null;\r
Number parsedValue = getFormat(locale).parse(value, parsePosition);\r
if (parsePosition.getIndex() != value.length()) {\r
throw new ConversionException("Could not convert '" + value\r
- + "' to " + getTargetType().getName());\r
+ + "' to " + getPresentationType().getName());\r
}\r
\r
if (parsedValue == null) {\r
* com.vaadin.data.util.converter.Converter#convertFromSourceToTarget(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public String convertFromSourceToTarget(Number value, Locale locale)\r
+ public String convertToPresentation(Number value, Locale locale)\r
throws ConversionException {\r
if (value == null) {\r
return null;\r
* \r
* @see com.vaadin.data.util.converter.Converter#getSourceType()\r
*/\r
- public Class<Number> getSourceType() {\r
+ public Class<Number> getModelType() {\r
return Number.class;\r
}\r
\r
* \r
* @see com.vaadin.data.util.converter.Converter#getTargetType()\r
*/\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
\r
* A converter that wraps another {@link Converter} and reverses source and\r
* target types.\r
* \r
- * @param <SOURCE>\r
+ * @param <MODEL>\r
* The source type\r
- * @param <TARGET>\r
+ * @param <PRESENTATION>\r
* The target type\r
* \r
* @author Vaadin Ltd\r
* @VERSION@\r
* @since 7.0\r
*/\r
-public class ReverseConverter<SOURCE, TARGET> implements\r
- Converter<SOURCE, TARGET> {\r
+public class ReverseConverter<MODEL, PRESENTATION> implements\r
+ Converter<MODEL, PRESENTATION> {\r
\r
- private Converter<TARGET, SOURCE> realConverter;\r
+ private Converter<PRESENTATION, MODEL> realConverter;\r
\r
/**\r
* Creates a converter from source to target based on a converter that\r
* @param converter\r
* The converter to use in a reverse fashion\r
*/\r
- public ReverseConverter(Converter<TARGET, SOURCE> converter) {\r
+ public ReverseConverter(Converter<PRESENTATION, MODEL> converter) {\r
this.realConverter = converter;\r
}\r
\r
* com.vaadin.data.util.converter.Converter#convertFromTargetToSource(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public SOURCE convertFromTargetToSource(TARGET value, Locale locale)\r
+ public MODEL convertToModel(PRESENTATION value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
- return realConverter.convertFromSourceToTarget(value, locale);\r
+ return realConverter.convertToPresentation(value, locale);\r
}\r
\r
/*\r
* com.vaadin.data.util.converter.Converter#convertFromSourceToTarget(java\r
* .lang.Object, java.util.Locale)\r
*/\r
- public TARGET convertFromSourceToTarget(SOURCE value, Locale locale)\r
+ public PRESENTATION convertToPresentation(MODEL value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
- return realConverter.convertFromTargetToSource(value, locale);\r
+ return realConverter.convertToModel(value, locale);\r
}\r
\r
/*\r
* \r
* @see com.vaadin.data.util.converter.Converter#getSourceType()\r
*/\r
- public Class<SOURCE> getSourceType() {\r
- return realConverter.getTargetType();\r
+ public Class<MODEL> getModelType() {\r
+ return realConverter.getPresentationType();\r
}\r
\r
/*\r
* \r
* @see com.vaadin.data.util.converter.Converter#getTargetType()\r
*/\r
- public Class<TARGET> getTargetType() {\r
- return realConverter.getSourceType();\r
+ public Class<PRESENTATION> getPresentationType() {\r
+ return realConverter.getModelType();\r
}\r
\r
}\r
// Check if the current converter is compatible.
if (newDataSource != null
- && (getConverter() == null || !getConverter().getSourceType()
+ && (getConverter() == null || !getConverter().getModelType()
.isAssignableFrom(newDataSource.getType()))) {
// Set a new converter if there is a new data source and the
// there is no old converter or the old is incompatible.
private T convertFromDataSource(Object newValue)
throws Converter.ConversionException {
if (converter != null) {
- return converter.convertFromSourceToTarget(newValue, getLocale());
+ return converter.convertToPresentation(newValue, getLocale());
}
if (newValue == null) {
return null;
* an exception.
*/
try {
- return converter.convertFromTargetToSource(fieldValue,
+ return converter.convertToModel(fieldValue,
getLocale());
} catch (com.vaadin.data.util.converter.Converter.ConversionException e) {
throw new Converter.ConversionException(
- getValueConversionError(converter.getSourceType()), e);
+ getValueConversionError(converter.getModelType()), e);
}
}
// to validate the converted value
if (getConverter() != null) {
try {
- valueToValidate = getConverter().convertFromTargetToSource(
+ valueToValidate = getConverter().convertToModel(
fieldValue, getLocale());
} catch (Exception e) {
throw new InvalidValueException(
- getValueConversionError(getConverter().getSourceType()));
+ getValueConversionError(getConverter().getModelType()));
}
}
}
Object value = property.getValue();
if (converter != null) {
- return converter.convertFromSourceToTarget(value, getLocale());
+ return converter.convertToPresentation(value, getLocale());
}
return (null != value) ? value.toString() : "";
}
return rowGenerator;
}
- // FIXME: Javadoc
+ /**
+ * Sets a converter for a property id.
+ * <p>
+ * The converter is used to format the the data for the given property id
+ * before displaying it in the table.
+ * </p>
+ *
+ * @param propertyId
+ * The propertyId to format using the converter
+ * @param converter
+ * The converter to use for the property id
+ */
public void setConverter(Object propertyId, Converter<?, String> converter) {
if (!getContainerPropertyIds().contains(propertyId)) {
throw new IllegalArgumentException("PropertyId " + propertyId
refreshRowCache();
}
- // FIXME: Javadoc
+ /**
+ * Checks if there is a converter set explicitly for the given property id.
+ *
+ * @param propertyId
+ * The propertyId to check
+ * @return true if a converter has been set for the property id, false
+ * otherwise
+ */
protected boolean hasConverter(Object propertyId) {
return propertyValueConverters.containsKey(propertyId);
}
- // FIXME: Javadoc
+ /**
+ * Returns the converter used to format the given propertyId.
+ *
+ * @param propertyId
+ * The propertyId to check
+ * @return The converter used to format the propertyId or null if no
+ * converter has been set
+ */
public Converter<Object, String> getConverter(Object propertyId) {
return propertyValueConverters.get(propertyId);
}
TextField tf = new TextField();\r
tf.setConverter(new Converter<String, String>() {\r
\r
- public String convertFromTargetToSource(String value, Locale locale) {\r
+ public String convertToModel(String value, Locale locale) {\r
return value;\r
}\r
\r
- public String convertFromSourceToTarget(String value, Locale locale) {\r
+ public String convertToPresentation(String value, Locale locale) {\r
return value;\r
}\r
\r
- public Class<String> getSourceType() {\r
+ public Class<String> getModelType() {\r
return String.class;\r
}\r
\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
});\r
TextField tf = new TextField();\r
tf.setConverter(new Converter<Integer, String>() {\r
\r
- public Integer convertFromTargetToSource(String value, Locale locale) {\r
+ public Integer convertToModel(String value, Locale locale) {\r
throw new ConversionException("Failed");\r
}\r
\r
- public String convertFromSourceToTarget(Integer value, Locale locale) {\r
+ public String convertToPresentation(Integer value, Locale locale) {\r
throw new ConversionException("Failed");\r
}\r
\r
- public Class<Integer> getSourceType() {\r
+ public Class<Integer> getModelType() {\r
// TODO Auto-generated method stub\r
return null;\r
}\r
\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
// TODO Auto-generated method stub\r
return null;\r
}\r
CheckBox cb = new CheckBox();\r
cb.setConverter(new Converter<Boolean, Boolean>() {\r
\r
- public Boolean convertFromTargetToSource(Boolean value,\r
+ public Boolean convertToModel(Boolean value,\r
Locale locale) {\r
// value from a CheckBox should never be null as long as it is\r
// not set to null (handled by conversion below).\r
return value;\r
}\r
\r
- public Boolean convertFromSourceToTarget(Boolean value,\r
+ public Boolean convertToPresentation(Boolean value,\r
Locale locale) {\r
// Datamodel -> field\r
if (value == null) {\r
return value;\r
}\r
\r
- public Class<Boolean> getSourceType() {\r
+ public Class<Boolean> getModelType() {\r
return Boolean.class;\r
}\r
\r
- public Class<Boolean> getTargetType() {\r
+ public Class<Boolean> getPresentationType() {\r
return Boolean.class;\r
}\r
\r
cb.setPropertyDataSource(property);\r
assertEquals(Boolean.FALSE, property.getValue());\r
assertEquals(Boolean.FALSE, cb.getValue());\r
- Boolean newDmValue = cb.getConverter().convertFromSourceToTarget(\r
+ Boolean newDmValue = cb.getConverter().convertToPresentation(\r
cb.getValue(), new Locale("fi", "FI"));\r
assertEquals(Boolean.FALSE, newDmValue);\r
\r
public class Vaadin6ImplicitDoubleConverter implements\r
Converter<Double, String> {\r
\r
- public Double convertFromTargetToSource(String value, Locale locale)\r
+ public Double convertToModel(String value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
if (null == value) {\r
return null;\r
return new Double(value.toString());\r
}\r
\r
- public String convertFromSourceToTarget(Double value, Locale locale)\r
+ public String convertToPresentation(Double value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
if (value == null) {\r
return null;\r
\r
}\r
\r
- public Class<Double> getSourceType() {\r
+ public Class<Double> getModelType() {\r
return Double.class;\r
}\r
\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
\r
private void addConverters(Table t) {\r
t.setConverter("sex", new Converter<Sex, String>() {\r
\r
- public Sex convertFromTargetToSource(String value, Locale locale)\r
+ public Sex convertToModel(String value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
// not used in this test - Table only converts from source to\r
// target\r
return null;\r
}\r
\r
- public String convertFromSourceToTarget(Sex value, Locale locale)\r
+ public String convertToPresentation(Sex value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
if (value == null) {\r
value = Sex.UNKNOWN;\r
return value.getStringRepresentation();\r
}\r
\r
- public Class<Sex> getSourceType() {\r
+ public Class<Sex> getModelType() {\r
return Sex.class;\r
}\r
\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
});\r
t.setConverter("deceased", new Converter<Boolean, String>() {\r
\r
- public Boolean convertFromTargetToSource(String value, Locale locale) {\r
+ public Boolean convertToModel(String value, Locale locale) {\r
// not used in this test - Table only converts from source to\r
// target\r
return null;\r
}\r
\r
- public String convertFromSourceToTarget(Boolean value, Locale locale) {\r
+ public String convertToPresentation(Boolean value, Locale locale) {\r
if (value == null || value) {\r
return "YES, DEAD!";\r
} else {\r
}\r
}\r
\r
- public Class<Boolean> getSourceType() {\r
+ public Class<Boolean> getModelType() {\r
return Boolean.class;\r
}\r
\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
});\r
t.setConverter("age", new Converter<Integer, String>() {\r
\r
- public Integer convertFromTargetToSource(String value, Locale locale)\r
+ public Integer convertToModel(String value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
// not used in this test - Table only converts from source to\r
// target\r
return null;\r
}\r
\r
- public String convertFromSourceToTarget(Integer value, Locale locale)\r
+ public String convertToPresentation(Integer value, Locale locale)\r
throws com.vaadin.data.util.converter.Converter.ConversionException {\r
if (value == null) {\r
return null;\r
}\r
}\r
\r
- public Class<Integer> getSourceType() {\r
+ public Class<Integer> getModelType() {\r
return Integer.class;\r
}\r
\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
});\r
t.setConverter("address", new Converter<Address, String>() {\r
\r
- public Address convertFromTargetToSource(String value, Locale locale)\r
+ public Address convertToModel(String value, Locale locale)\r
throws ConversionException {\r
// not used in this test - Table only converts from source to\r
// target\r
return null;\r
}\r
\r
- public String convertFromSourceToTarget(Address value, Locale locale)\r
+ public String convertToPresentation(Address value, Locale locale)\r
throws ConversionException {\r
return value.getStreetAddress() + ", " + value.getCity() + " ("\r
+ value.getCountry() + ")";\r
}\r
\r
- public Class<Address> getSourceType() {\r
+ public Class<Address> getModelType() {\r
return Address.class;\r
}\r
\r
- public Class<String> getTargetType() {\r
+ public Class<String> getPresentationType() {\r
return String.class;\r
}\r
\r