diff options
author | caalador <mikael.grankvist@gmail.com> | 2017-01-30 08:16:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-30 08:16:44 +0200 |
commit | 07814a2b556eff6bd14959cee81a9b3dcd105bb7 (patch) | |
tree | 1d7a49df4f32c301a0d41fc8598abf4a17ede846 /server/src/main/java/com/vaadin/ui/InlineDateField.java | |
parent | e7b49b4893607904bac69ca79e5ef583abfbe679 (diff) | |
download | vaadin-framework-07814a2b556eff6bd14959cee81a9b3dcd105bb7.tar.gz vaadin-framework-07814a2b556eff6bd14959cee81a9b3dcd105bb7.zip |
Add convenience constructors to new components (#598) (#8351)
Add convenience constructors (#598)
Added convenience constructors to ui components that have
been reimplemented for Vaadin 8
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/InlineDateField.java')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/InlineDateField.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/InlineDateField.java b/server/src/main/java/com/vaadin/ui/InlineDateField.java index 2db9d7f1db..3b63545710 100644 --- a/server/src/main/java/com/vaadin/ui/InlineDateField.java +++ b/server/src/main/java/com/vaadin/ui/InlineDateField.java @@ -59,6 +59,58 @@ public class InlineDateField extends AbstractLocalDateField { super(caption); } + /** + * Constructs a new {@code InlineDateField} with a value change listener. + * <p> + * The listener is called when the value of this {@code InlineDateField} is + * changed either by the user or programmatically. + * + * @param valueChangeListener + * the value change listener, not {@code null} + */ + public InlineDateField(ValueChangeListener valueChangeListener) { + super(); + addValueChangeListener(valueChangeListener); + } + + /** + * Constructs a new {@code InlineDateField} with the given caption and a value + * change listener. + * <p> + * The listener is called when the value of this {@code InlineDateField} is + * changed either by the user or programmatically. + * + * @param caption + * the caption for the field + * @param valueChangeListener + * the value change listener, not {@code null} + */ + public InlineDateField(String caption, + ValueChangeListener valueChangeListener) { + this(valueChangeListener); + setCaption(caption); + } + + /** + * Constructs a new {@code InlineDateField} with the given caption, initial + * text contents and a value change listener. + * <p> + * The listener is called when the value of this {@code InlineDateField} is + * changed either by the user or programmatically. + * + * @param caption + * the caption for the field + * @param value + * the value for the field, not {@code null} + * @param valueChangeListener + * the value change listener, not {@code null} + */ + public InlineDateField(String caption, LocalDate value, + ValueChangeListener valueChangeListener) { + this(caption, value); + addValueChangeListener(valueChangeListener); + } + @Override protected InlineDateFieldState getState() { return (InlineDateFieldState) super.getState(); |