I wonder if it would be possible in Vaadin 8 to adopt Java 8 constructs as inputs to widgets, so as to avoid the kind of little adapter classes like the following?
// This class allows the direct use of ZonedDateTime with PopupDateFields
public class SpecialPopupDateField extends PopupDateField{
// constructor = make a PopupDateField
public SpecialPopupDateField(String inputString, float width) {
super(inputString);
// ... more setup stuff
}
// it is convenient to be able to put zoned date times directly in and out of PopupDateFields without
// having to convert to the legacy java.util.Date class every time.
// get the date, pre-formatted as a zoned date time
public ZonedDateTime getValueZDT() {
return super.getValue() == null ? null :
ZonedDateTime.ofInstant(super.getValue().toInstant(), Constants.getZoneid());
}
// set the date from a zoned date time
public void setValueZDT(ZonedDateTime zdt) {
super.setValue(zdt == null ? null : Date.from(zdt.toInstant()));
}