Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 3 weeks ago
Vaadin 8, Java 8 modernization
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()));
}
Last updated on
You cannot reply to this thread.