diff options
29 files changed, 146 insertions, 120 deletions
diff --git a/all/src/main/templates/release-notes.html b/all/src/main/templates/release-notes.html index 20dd5d53c2..8368ef4484 100644 --- a/all/src/main/templates/release-notes.html +++ b/all/src/main/templates/release-notes.html @@ -83,6 +83,12 @@ enhancements. Below is a list of the most notable changes:</p> <ul> + <li><tt>ComboBox</tt> has a better new item handling implementation with <tt>NewItemProvider</tt>.</li> + <lli><tt>Binding</tt> APIs have been improved to allow more advanced use.</lli> + <li>New <tt>ReadOnlyHasValue</tt> wrapper class for easy implementation of new <tt>HasValue</tt>s for <tt>Binder</tt>.</li> + <li>Built-in <tt>StringTo</tt> converters now have option to use <tt>ErrorMessageProvider</tt>.</li> + <li><tt>Grid</tt> headers and footers now support tooltips.</li> + <li>Added <tt>Tree</tt> and <tt>TreeGrid</tt> recursive expand and collapse methods.</li> </ul> </p> @@ -97,8 +103,9 @@ <h2 id="incompatible">Incompatible or Behavior-altering Changes in @version-minor@</h2> - <li><tt>BindingBuilder</tt> will now automatically mark bound field <i>read-only</i> when bound to a read-only property or a <tt>null</tt> setter.</li> <li>Date range limits in <tt>AbstractDateFieldState</tt> are now <tt>String</tt>s instead of <tt>Date</tt>s, some client-side method signatures were changed</li> + <li><tt>BrowserResizeListener</tt> is only called once resizing ends.</li> + <li><tt>ItemClickEvent</tt> for <tt>Grid</tt> now takes and additional row index parameter.</li> <h2>For incompatible or behavior-altering changes in 8.3, please see <a href="https://vaadin.com/download/release/8.3/8.3.0/release-notes.html#incompatible">8.3 release notes</a></h2> diff --git a/client/src/main/java/com/vaadin/client/BrowserInfo.java b/client/src/main/java/com/vaadin/client/BrowserInfo.java index 055cf75c75..953cca0335 100644 --- a/client/src/main/java/com/vaadin/client/BrowserInfo.java +++ b/client/src/main/java/com/vaadin/client/BrowserInfo.java @@ -516,7 +516,7 @@ public class BrowserInfo { * other than dots and digits. * * @return the complete browser version or {@code null} if unknown - * @since + * @since 8.4 */ public String getBrowserVersion() { return browserDetails.getBrowserVersion(); diff --git a/client/src/main/java/com/vaadin/client/DateTimeService.java b/client/src/main/java/com/vaadin/client/DateTimeService.java index a6aa153f07..00606a25c1 100644 --- a/client/src/main/java/com/vaadin/client/DateTimeService.java +++ b/client/src/main/java/com/vaadin/client/DateTimeService.java @@ -61,11 +61,12 @@ public class DateTimeService { } /** - * Utility method to format positive int as zero-padded two-digits number + * Utility method to format positive int as zero-padded two-digits number. * - * @param i the value + * @param i + * the value * @return "00".."99" - * @since + * @since 8.4 */ public static String asTwoDigits(int i) { return (i < 10 ? "0" : "") + i; diff --git a/client/src/main/java/com/vaadin/client/WidgetUtil.java b/client/src/main/java/com/vaadin/client/WidgetUtil.java index 006e3d3648..58604fe005 100644 --- a/client/src/main/java/com/vaadin/client/WidgetUtil.java +++ b/client/src/main/java/com/vaadin/client/WidgetUtil.java @@ -56,7 +56,7 @@ public class WidgetUtil { * * @param <T> * the object type to store - * @since + * @since 8.4 */ public static class Reference<T> { diff --git a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java index bde58480de..67436339b5 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java @@ -2113,7 +2113,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * * @param label * the label to set - * @since + * @since 8.4 */ public void setAssistiveLabelPreviousYear(String label) { prevYearAssistiveLabel = label; @@ -2124,7 +2124,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * * @param label * the label to set - * @since + * @since 8.4 */ public void setAssistiveLabelNextYear(String label) { nextYearAssistiveLabel = label; @@ -2135,7 +2135,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * * @param label * the label to set - * @since + * @since 8.4 */ public void setAssistiveLabelPreviousMonth(String label) { prevMonthAssistiveLabel = label; @@ -2146,7 +2146,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * * @param label * the label to set - * @since + * @since 8.4 */ public void setAssistiveLabelNextMonth(String label) { nextMonthAssistiveLabel = label; @@ -2155,7 +2155,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> /** * Updates assistive labels of the navigation elements. * - * @since + * @since 8.4 */ public void updateAssistiveLabels() { if (prevMonth != null) { diff --git a/client/src/main/java/com/vaadin/client/ui/VDateField.java b/client/src/main/java/com/vaadin/client/ui/VDateField.java index e9eeecad73..0402875206 100644 --- a/client/src/main/java/com/vaadin/client/ui/VDateField.java +++ b/client/src/main/java/com/vaadin/client/ui/VDateField.java @@ -271,7 +271,7 @@ public abstract class VDateField<R extends Enum<R>> extends FlowPanel * This method can be implemented by subclasses to update buffered values * from component values. * - * @since + * @since 8.4 */ public abstract void updateBufferedValues(); diff --git a/client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java b/client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java index 974f5af3eb..0e2edf82f6 100644 --- a/client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java +++ b/client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java @@ -308,7 +308,7 @@ public class VRadioButtonGroup extends FocusableFlowPanelComposite * @param value * {@code true} if enabled; {@code false} if not * - * @since + * @since 8.4 */ protected void updateItemEnabled(RadioButton radioButton, boolean value) { boolean enabled = value && !isReadonly() && isEnabled(); diff --git a/client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java index 9997d38e99..02c0f85243 100644 --- a/client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java @@ -151,7 +151,7 @@ public abstract class AbstractDateFieldConnector<R extends Enum<R>> * * @param calendar * the calendar panel for which to set the assistive labels - * @since + * @since 8.4 */ protected void setAndUpdateAssistiveLabels( VAbstractCalendarPanel calendar) { diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java index ef1839c2aa..1f75801c27 100755 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -445,7 +445,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * The tooltip is shown in the mode returned by * {@link #getDescriptionContentMode()}. * - * @since + * @return the tooltip text for this cell + * @since 8.4 */ public String getDescription() { return description; @@ -460,7 +461,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * * @param description * the tooltip to show when hovering the cell - * @since + * @since 8.4 */ public void setDescription(String description) { this.description = description; @@ -476,7 +477,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * @param descriptionContentMode * the content mode to use for the tooltip (HTML or plain * text) - * @since + * @since 8.4 */ public void setDescription(String description, ContentMode descriptionContentMode) { @@ -491,7 +492,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * * @see ContentMode * @return the content mode for the tooltip - * @since + * @since 8.4 */ public ContentMode getDescriptionContentMode() { return descriptionContentMode; @@ -503,7 +504,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * @see ContentMode * @param descriptionContentMode * the content mode for the tooltip - * @since + * @since 8.4 */ public void setDescriptionContentMode( ContentMode descriptionContentMode) { @@ -7383,7 +7384,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * the desired scroll destination * @param callback * the callback command to execute when row is available - * @since + * @since 8.4 */ public void scrollToRow(int rowIndex, ScrollDestination destination, Runnable callback) { @@ -7406,7 +7407,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * the row to look for * @param whenRendered * the callback command to execute when row is available - * @since + * @since 8.4 */ public void scrollToRow(int rowIndex, Runnable whenRendered) { scrollToRow(rowIndex, ScrollDestination.ANY, whenRendered); diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java index 106590dd14..52c290a5ee 100644 --- a/server/src/main/java/com/vaadin/data/Binder.java +++ b/server/src/main/java/com/vaadin/data/Binder.java @@ -188,7 +188,7 @@ public class Binder<BEAN> implements Serializable { * @param readOnly * {@code true} to set binding read-only; {@code false} to * enable writes - * @since + * @since 8.4 * @throws IllegalStateException * if trying to make binding read-write and the setter is * {@code null} @@ -201,7 +201,7 @@ public class Binder<BEAN> implements Serializable { * @see #setReadOnly(boolean) * * @return {@code true} if read-only; {@code false} if not - * @since + * @since 8.4 */ public boolean isReadOnly(); @@ -209,7 +209,7 @@ public class Binder<BEAN> implements Serializable { * Gets the getter associated with this Binding. * * @return the getter - * @since + * @since 8.4 */ public ValueProvider<BEAN, TARGET> getGetter(); @@ -217,7 +217,7 @@ public class Binder<BEAN> implements Serializable { * Gets the setter associated with this Binding. * * @return the setter - * @since + * @since 8.4 */ public Setter<BEAN, TARGET> getSetter(); } @@ -730,21 +730,21 @@ public class Binder<BEAN> implements Serializable { ErrorMessageProvider errorMessageProvider); /** - * Sets the field to be required and delegates the required check to a custom validator. - * This means two things: + * Sets the field to be required and delegates the required check to a + * custom validator. This means two things: * <ol> * <li>the required indicator will be displayed for this field</li> - * <li>the field value is validated by customRequiredValidator</li> + * <li>the field value is validated by {@code requiredValidator}</li> * </ol> * * @see HasValue#setRequiredIndicatorVisible(boolean) - * @param customRequiredValidator + * @param requiredValidator * validator responsible for the required check * @return this binding, for chaining - * @since + * @since 8.4 */ public BindingBuilder<BEAN, TARGET> asRequired( - Validator<TARGET> customRequiredValidator); + Validator<TARGET> requiredValidator); } /** @@ -902,10 +902,9 @@ public class Binder<BEAN> implements Serializable { @Override public BindingBuilder<BEAN, TARGET> asRequired( ErrorMessageProvider errorMessageProvider) { - return asRequired( - Validator.from( - value -> !Objects.equals(value, field.getEmptyValue()), - errorMessageProvider)); + return asRequired(Validator.from( + value -> !Objects.equals(value, field.getEmptyValue()), + errorMessageProvider)); } @Override diff --git a/server/src/main/java/com/vaadin/data/ReadOnlyHasValue.java b/server/src/main/java/com/vaadin/data/ReadOnlyHasValue.java index ecc8b03d94..27dce5716f 100644 --- a/server/src/main/java/com/vaadin/data/ReadOnlyHasValue.java +++ b/server/src/main/java/com/vaadin/data/ReadOnlyHasValue.java @@ -24,17 +24,21 @@ import java.util.LinkedHashSet; import java.util.Objects; /** - * Generic {@link HasValue} to use any type of component with Vaadin data binding. + * Generic {@link HasValue} to use any type of component with Vaadin data + * binding. * <p> * Example: + * * <pre> * Label label = new Label(); - * ReadOnlyHasValue<String> hasValue = new ReadOnlyHasValue<>(label::setCaption); + * ReadOnlyHasValue<String> hasValue = new ReadOnlyHasValue<>( + * label::setCaption); * binder.forField(hasValue).bind(SomeBean::getName); * </pre> * - * @param <V> the value type - * @since + * @param <V> + * the value type + * @since 8.4 */ public class ReadOnlyHasValue<V> implements HasValue<V>, Serializable { private V value; @@ -43,12 +47,15 @@ public class ReadOnlyHasValue<V> implements HasValue<V>, Serializable { private LinkedHashSet<ValueChangeListener<V>> listenerList; /** - * Creates new {@code ReadOnlyHasValue} + * Creates new {@code ReadOnlyHasValue}. * - * @param valueProcessor the value valueProcessor, e.g. {@link Label#setValue} - * @param emptyValue the value to be used as empty, {@code null} by default + * @param valueProcessor + * the value valueProcessor, e.g. {@link Label#setValue} + * @param emptyValue + * the value to be used as empty, {@code null} by default */ - public ReadOnlyHasValue(SerializableConsumer<V> valueProcessor, V emptyValue) { + public ReadOnlyHasValue(SerializableConsumer<V> valueProcessor, + V emptyValue) { this.valueProcessor = valueProcessor; this.emptyValue = emptyValue; } @@ -56,10 +63,11 @@ public class ReadOnlyHasValue<V> implements HasValue<V>, Serializable { /** * Creates new {@code ReadOnlyHasValue} with {@code null} as an empty value. * - * @param valueProcessor the value valueProcessor, e.g. {@link Label#setValue} + * @param valueProcessor + * the value valueProcessor, e.g. {@link Label#setValue} */ public ReadOnlyHasValue(SerializableConsumer<V> valueProcessor) { - this(valueProcessor,null); + this(valueProcessor, null); } @Override @@ -67,7 +75,7 @@ public class ReadOnlyHasValue<V> implements HasValue<V>, Serializable { V oldValue = this.value; this.value = value; valueProcessor.accept(value); - if (listenerList != null && ! Objects.equals(oldValue, value)) { + if (listenerList != null && !Objects.equals(oldValue, value)) { for (ValueChangeListener<V> valueChangeListener : listenerList) { valueChangeListener.valueChange( new ValueChangeEvent<>(null, this, oldValue, false)); @@ -99,12 +107,14 @@ public class ReadOnlyHasValue<V> implements HasValue<V>, Serializable { @Override public void setRequiredIndicatorVisible(boolean requiredIndicatorVisible) { - if (requiredIndicatorVisible) throw new IllegalArgumentException("Not Writable"); + if (requiredIndicatorVisible) + throw new IllegalArgumentException("Not Writable"); } @Override public void setReadOnly(boolean readOnly) { - if (!readOnly) throw new IllegalArgumentException("Not Writable"); + if (!readOnly) + throw new IllegalArgumentException("Not Writable"); } @Override diff --git a/server/src/main/java/com/vaadin/data/converter/AbstractStringToNumberConverter.java b/server/src/main/java/com/vaadin/data/converter/AbstractStringToNumberConverter.java index 8488f7ea6d..3ff24f39cd 100644 --- a/server/src/main/java/com/vaadin/data/converter/AbstractStringToNumberConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/AbstractStringToNumberConverter.java @@ -53,7 +53,7 @@ public abstract class AbstractStringToNumberConverter<T extends Number> * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ protected AbstractStringToNumberConverter(T emptyValue, ErrorMessageProvider errorMessageProvider) { diff --git a/server/src/main/java/com/vaadin/data/converter/StringToBigDecimalConverter.java b/server/src/main/java/com/vaadin/data/converter/StringToBigDecimalConverter.java index ecab5367a9..e4a15bb632 100644 --- a/server/src/main/java/com/vaadin/data/converter/StringToBigDecimalConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/StringToBigDecimalConverter.java @@ -74,7 +74,7 @@ public class StringToBigDecimalConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToBigDecimalConverter( ErrorMessageProvider errorMessageProvider) { @@ -91,7 +91,7 @@ public class StringToBigDecimalConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToBigDecimalConverter(BigDecimal emptyValue, ErrorMessageProvider errorMessageProvider) { diff --git a/server/src/main/java/com/vaadin/data/converter/StringToBigIntegerConverter.java b/server/src/main/java/com/vaadin/data/converter/StringToBigIntegerConverter.java index 9bc8bb51c0..9320da095c 100644 --- a/server/src/main/java/com/vaadin/data/converter/StringToBigIntegerConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/StringToBigIntegerConverter.java @@ -75,7 +75,7 @@ public class StringToBigIntegerConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToBigIntegerConverter( ErrorMessageProvider errorMessageProvider) { @@ -92,7 +92,7 @@ public class StringToBigIntegerConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToBigIntegerConverter(BigInteger emptyValue, ErrorMessageProvider errorMessageProvider) { diff --git a/server/src/main/java/com/vaadin/data/converter/StringToBooleanConverter.java b/server/src/main/java/com/vaadin/data/converter/StringToBooleanConverter.java index 2ca779665b..13298f98ea 100644 --- a/server/src/main/java/com/vaadin/data/converter/StringToBooleanConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/StringToBooleanConverter.java @@ -65,7 +65,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> { * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToBooleanConverter(ErrorMessageProvider errorMessageProvider) { this(Boolean.TRUE.toString(), Boolean.FALSE.toString(), @@ -97,7 +97,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> { * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToBooleanConverter(String trueString, String falseString, ErrorMessageProvider errorMessageProvider) { diff --git a/server/src/main/java/com/vaadin/data/converter/StringToDoubleConverter.java b/server/src/main/java/com/vaadin/data/converter/StringToDoubleConverter.java index e658823f19..73716ed83b 100644 --- a/server/src/main/java/com/vaadin/data/converter/StringToDoubleConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/StringToDoubleConverter.java @@ -72,7 +72,7 @@ public class StringToDoubleConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToDoubleConverter(ErrorMessageProvider errorMessageProvider) { this(null, errorMessageProvider); @@ -88,7 +88,7 @@ public class StringToDoubleConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToDoubleConverter(Double emptyValue, ErrorMessageProvider errorMessageProvider) { diff --git a/server/src/main/java/com/vaadin/data/converter/StringToFloatConverter.java b/server/src/main/java/com/vaadin/data/converter/StringToFloatConverter.java index db9e7a3abf..85e3d3b380 100644 --- a/server/src/main/java/com/vaadin/data/converter/StringToFloatConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/StringToFloatConverter.java @@ -70,7 +70,7 @@ public class StringToFloatConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToFloatConverter(ErrorMessageProvider errorMessageProvider) { this(null, errorMessageProvider); @@ -86,7 +86,7 @@ public class StringToFloatConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToFloatConverter(Float emptyValue, ErrorMessageProvider errorMessageProvider) { diff --git a/server/src/main/java/com/vaadin/data/converter/StringToIntegerConverter.java b/server/src/main/java/com/vaadin/data/converter/StringToIntegerConverter.java index e10784292b..ac91d380f4 100644 --- a/server/src/main/java/com/vaadin/data/converter/StringToIntegerConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/StringToIntegerConverter.java @@ -69,7 +69,7 @@ public class StringToIntegerConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToIntegerConverter(ErrorMessageProvider errorMessageProvider) { this(null, errorMessageProvider); @@ -85,7 +85,7 @@ public class StringToIntegerConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToIntegerConverter(Integer emptyValue, ErrorMessageProvider errorMessageProvider) { diff --git a/server/src/main/java/com/vaadin/data/converter/StringToLongConverter.java b/server/src/main/java/com/vaadin/data/converter/StringToLongConverter.java index e87504abc4..9b02d2da26 100644 --- a/server/src/main/java/com/vaadin/data/converter/StringToLongConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/StringToLongConverter.java @@ -69,7 +69,7 @@ public class StringToLongConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToLongConverter(ErrorMessageProvider errorMessageProvider) { this(null, errorMessageProvider); @@ -85,7 +85,7 @@ public class StringToLongConverter * @param errorMessageProvider * the error message provider to use if conversion fails * - * @since + * @since 8.4 */ public StringToLongConverter(Long emptyValue, ErrorMessageProvider errorMessageProvider) { diff --git a/server/src/main/java/com/vaadin/server/WebBrowser.java b/server/src/main/java/com/vaadin/server/WebBrowser.java index cc186e231b..8000a6435f 100644 --- a/server/src/main/java/com/vaadin/server/WebBrowser.java +++ b/server/src/main/java/com/vaadin/server/WebBrowser.java @@ -253,7 +253,7 @@ public class WebBrowser implements Serializable { * than dots and digits. * * @return the complete browser version or {@code null} if unknown - * @since + * @since 8.4 */ public String getBrowserVersion() { return browserDetails != null ? browserDetails.getBrowserVersion() diff --git a/server/src/main/java/com/vaadin/ui/AbstractDateField.java b/server/src/main/java/com/vaadin/ui/AbstractDateField.java index fa386be156..19b628b1f2 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractDateField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractDateField.java @@ -79,7 +79,8 @@ import com.vaadin.util.TimeZoneUtil; public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & Serializable & Comparable<? super T>, R extends Enum<R>> extends AbstractField<T> implements FocusNotifier, BlurNotifier { - private static final DateTimeFormatter RANGE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd[ HH:mm:ss]", Locale.ENGLISH); + private static final DateTimeFormatter RANGE_FORMATTER = DateTimeFormatter + .ofPattern("yyyy-MM-dd[ HH:mm:ss]", Locale.ENGLISH); private AbstractDateFieldServerRpc rpc = new AbstractDateFieldServerRpc() { @Override @@ -272,7 +273,7 @@ public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & * - the allowed range's start date */ public void setRangeStart(T startDate) { - if (afterDate(startDate,convertFromDateString(getState().rangeEnd))) { + if (afterDate(startDate, convertFromDateString(getState().rangeEnd))) { throw new IllegalStateException( "startDate cannot be later than endDate"); } @@ -343,7 +344,6 @@ public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & getState().rangeEnd = date; } - /** * Returns the precise rangeStart used. * @@ -356,11 +356,12 @@ public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & /** * Parses string representaion of date range limit into date type * - * @param temporalStr the string representation + * @param temporalStr + * the string representation * @return parsed value * @see AbstractDateFieldState#rangeStart * @see AbstractDateFieldState#rangeEnd - * @since + * @since 8.4 */ protected T convertFromDateString(String temporalStr) { if (temporalStr == null) { @@ -371,20 +372,23 @@ public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & /** * Converts a temporal value into field-specific data type. - * @param temporalAccessor - source value + * + * @param temporalAccessor + * - source value * @return conversion result. - * @since + * @since 8.4 */ protected abstract T toType(TemporalAccessor temporalAccessor); /** - * Converts date range limit itno string representaion + * Converts date range limit into string representation. * - * @param temporal the value + * @param temporal + * the value * @return textual representation * @see AbstractDateFieldState#rangeStart * @see AbstractDateFieldState#rangeEnd - * @since + * @since 8.4 */ protected String convertToDateString(T temporal) { if (temporal == null) { @@ -394,10 +398,14 @@ public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & } /** - * Checks if {@code value} is after {@code base} or not - * @param value temporal value - * @param base temporal value to compare to - * @return {@code true} if {@code value} is after {@code base}, {@code false} otherwise + * Checks if {@code value} is after {@code base} or not. + * + * @param value + * temporal value + * @param base + * temporal value to compare to + * @return {@code true} if {@code value} is after {@code base}, + * {@code false} otherwise */ protected boolean afterDate(T value, T base) { if (value == null || base == null) { @@ -937,10 +945,10 @@ public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & * reading software. * * @param element - * the element for which to set the label. Not {@code null}. + * the element for which to set the label. Not {@code null}. * @param label - * the assistive label to set - * @since + * the assistive label to set + * @since 8.4 */ public void setAssistiveLabel(AccessibleElement element, String label) { Objects.requireNonNull(element, "Element cannot be null"); @@ -951,8 +959,8 @@ public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & * Gets the assistive label of a calendar navigation element. * * @param element - * the element of which to get the assistive label - * @since + * the element of which to get the assistive label + * @since 8.4 */ public void getAssistiveLabel(AccessibleElement element) { getState(false).assistiveLabels.get(element); diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 7f7ceeb4a7..0fe3709ec5 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -404,6 +404,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * Returns the clicked rowIndex. * * @return the clicked rowIndex + * @since 8.4 */ public int getRowIndex() { return rowIndex; @@ -639,7 +640,8 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, MouseEventDetails details, int rowIndex) { Column<T, ?> column = getColumnByInternalId(columnInternalId); T item = getDataCommunicator().getKeyMapper().get(rowKey); - fireEvent(new ItemClick<>(Grid.this, column, item, details, rowIndex)); + fireEvent(new ItemClick<>(Grid.this, column, item, details, + rowIndex)); } @Override @@ -2531,9 +2533,8 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, /** * Returns the property set used by this grid. * - * @return propertySet - * the property set to return - * @since + * @return propertySet the property set to return + * @since 8.4 */ protected PropertySet<T> getPropertySet() { return propertySet; diff --git a/server/src/main/java/com/vaadin/ui/Notification.java b/server/src/main/java/com/vaadin/ui/Notification.java index 58bb2af5a5..2204ea0b60 100644 --- a/server/src/main/java/com/vaadin/ui/Notification.java +++ b/server/src/main/java/com/vaadin/ui/Notification.java @@ -398,7 +398,7 @@ public class Notification extends AbstractExtension { * <p> * If the notification is not shown, does nothing. * - * @since + * @since 8.4 */ public void close() { close(false); @@ -413,7 +413,7 @@ public class Notification extends AbstractExtension { * <code>true</code> if the notification was closed because the * user clicked on it, <code>false</code> if the notification was * closed from the server - * @since + * @since 8.4 */ protected void close(boolean userOriginated) { if (!isAttached()) { diff --git a/server/src/main/java/com/vaadin/ui/Tree.java b/server/src/main/java/com/vaadin/ui/Tree.java index b1808391ec..2f5ca28ebd 100644 --- a/server/src/main/java/com/vaadin/ui/Tree.java +++ b/server/src/main/java/com/vaadin/ui/Tree.java @@ -454,7 +454,7 @@ public class Tree<T> extends Composite * the items to expand recursively * @param depth * the maximum depth of recursion - * @since + * @since 8.4 */ public void expandRecursively(Collection<T> items, int depth) { treeGrid.expandRecursively(items, depth); @@ -497,7 +497,7 @@ public class Tree<T> extends Composite * the items to expand recursively * @param depth * the maximum depth of recursion - * @since + * @since 8.4 */ public void collapseRecursively(Collection<T> items, int depth) { treeGrid.collapseRecursively(items, depth); @@ -682,7 +682,7 @@ public class Tree<T> extends Composite * @param contentMode * how client should interpret textual values * - * @since + * @since 8.4 */ public void setItemDescriptionGenerator( DescriptionGenerator<T> descriptionGenerator, diff --git a/server/src/main/java/com/vaadin/ui/TreeGrid.java b/server/src/main/java/com/vaadin/ui/TreeGrid.java index bb4c5ec0cd..b9e9508e24 100644 --- a/server/src/main/java/com/vaadin/ui/TreeGrid.java +++ b/server/src/main/java/com/vaadin/ui/TreeGrid.java @@ -359,7 +359,7 @@ public class TreeGrid<T> extends Grid<T> * the items to expand recursively * @param depth * the maximum depth of recursion - * @since + * @since 8.4 */ public void expandRecursively(Collection<T> items, int depth) { expandRecursively(items.stream(), depth); @@ -380,7 +380,7 @@ public class TreeGrid<T> extends Grid<T> * the items to expand recursively * @param depth * the maximum depth of recursion - * @since + * @since 8.4 */ public void expandRecursively(Stream<T> items, int depth) { if (depth < 0) { @@ -447,7 +447,7 @@ public class TreeGrid<T> extends Grid<T> * the items to collapse recursively * @param depth * the maximum depth of recursion - * @since + * @since 8.4 */ public void collapseRecursively(Collection<T> items, int depth) { collapseRecursively(items.stream(), depth); @@ -468,7 +468,7 @@ public class TreeGrid<T> extends Grid<T> * the items to collapse recursively * @param depth * the maximum depth of recursion - * @since + * @since 8.4 */ public void collapseRecursively(Stream<T> items, int depth) { if (depth < 0) { diff --git a/server/src/main/java/com/vaadin/ui/components/grid/FooterCell.java b/server/src/main/java/com/vaadin/ui/components/grid/FooterCell.java index d68e8edaa1..5296cf1401 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/FooterCell.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/FooterCell.java @@ -110,7 +110,8 @@ public interface FooterCell extends Serializable { * The tooltip is shown in the mode returned by * {@link #getDescriptionContentMode()}. * - * @since + * @return the tooltip text for this cell + * @since 8.4 */ public String getDescription(); @@ -123,7 +124,7 @@ public interface FooterCell extends Serializable { * * @param description * the tooltip to show when hovering the cell - * @since + * @since 8.4 */ public void setDescription(String description); @@ -135,17 +136,17 @@ public interface FooterCell extends Serializable { * the tooltip to show when hovering the cell * @param descriptionContentMode * the content mode to use for the tooltip (HTML or plain text) - * @since + * @since 8.4 */ public void setDescription(String description, ContentMode descriptionContentMode); /** * Gets the content mode for the tooltip. - + * * @see ContentMode * @return the content mode for the tooltip - * @since + * @since 8.4 */ public ContentMode getDescriptionContentMode(); @@ -155,7 +156,7 @@ public interface FooterCell extends Serializable { * @see ContentMode * @param descriptionContentMode * the content mode for the tooltip - * @since + * @since 8.4 */ public void setDescriptionContentMode(ContentMode descriptionContentMode); diff --git a/server/src/main/java/com/vaadin/ui/components/grid/HeaderCell.java b/server/src/main/java/com/vaadin/ui/components/grid/HeaderCell.java index 63af4c87fe..b19c80e83b 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/HeaderCell.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/HeaderCell.java @@ -110,7 +110,8 @@ public interface HeaderCell extends Serializable { * The tooltip is shown in the mode returned by * {@link #getDescriptionContentMode()}. * - * @since + * @return the tooltip text for this cell + * @since 8.4 */ public String getDescription(); @@ -123,7 +124,7 @@ public interface HeaderCell extends Serializable { * * @param description * the tooltip to show when hovering the cell - * @since + * @since 8.4 */ public void setDescription(String description); @@ -135,7 +136,7 @@ public interface HeaderCell extends Serializable { * the tooltip to show when hovering the cell * @param descriptionContentMode * the content mode to use for the tooltip (HTML or plain text) - * @since + * @since 8.4 */ public void setDescription(String description, ContentMode descriptionContentMode); @@ -146,7 +147,7 @@ public interface HeaderCell extends Serializable { * * @see ContentMode * @return the content mode for the tooltip - * @since + * @since 8.4 */ public ContentMode getDescriptionContentMode(); @@ -156,7 +157,7 @@ public interface HeaderCell extends Serializable { * @see ContentMode * @param descriptionContentMode * the content mode for the tooltip - * @since + * @since 8.4 */ public void setDescriptionContentMode(ContentMode descriptionContentMode); } diff --git a/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java b/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java index f78f4b07f1..29af8bfc6c 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java @@ -623,7 +623,7 @@ public abstract class StaticSection<ROW extends StaticSection.StaticRow<?>> * The tooltip is shown in the mode returned by * {@link #getDescriptionContentMode()}. * - * @since + * @since 8.4 */ public String getDescription() { return cellState.description; @@ -638,7 +638,7 @@ public abstract class StaticSection<ROW extends StaticSection.StaticRow<?>> * * @param description * the tooltip to show when hovering the cell - * @since + * @since 8.4 */ public void setDescription(String description) { cellState.description = description; @@ -654,7 +654,7 @@ public abstract class StaticSection<ROW extends StaticSection.StaticRow<?>> * @param descriptionContentMode * the content mode to use for the tooltip (HTML or plain * text) - * @since + * @since 8.4 */ public void setDescription(String description, ContentMode descriptionContentMode) { @@ -667,7 +667,7 @@ public abstract class StaticSection<ROW extends StaticSection.StaticRow<?>> * * @see ContentMode * @return the content mode for the tooltip - * @since + * @since 8.4 */ public ContentMode getDescriptionContentMode() { return cellState.descriptionContentMode; @@ -679,7 +679,7 @@ public abstract class StaticSection<ROW extends StaticSection.StaticRow<?>> * @see ContentMode * @param descriptionContentMode * the content mode for the tooltip - * @since + * @since 8.4 */ public void setDescriptionContentMode( ContentMode descriptionContentMode) { diff --git a/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java b/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java index b458b26ae3..9437785f53 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldState.java @@ -34,13 +34,10 @@ public class AbstractDateFieldState extends AbstractFieldState { /** * Navigation elements that have assistive label. * - * @since + * @since 8.4 */ public enum AccessibleElement { - PREVIOUS_YEAR, - NEXT_YEAR, - PREVIOUS_MONTH, - NEXT_MONTH + PREVIOUS_YEAR, NEXT_YEAR, PREVIOUS_MONTH, NEXT_MONTH } { @@ -57,8 +54,8 @@ public class AbstractDateFieldState extends AbstractFieldState { public String rangeStart; /** - * End range that has been cleared, depending on the resolution of the - * date field. The format is "2018-05-27" or "2018-05-27 14:38:39" + * End range that has been cleared, depending on the resolution of the date + * field. The format is "2018-05-27" or "2018-05-27 14:38:39" * * @see com.vaadin.ui.AbstractDateField#RANGE_FORMATTER */ @@ -133,7 +130,7 @@ public class AbstractDateFieldState extends AbstractFieldState { /** * Map of elements and their corresponding assistive labels. * - * @since + * @since 8.4 */ public Map<AccessibleElement, String> assistiveLabels = new HashMap<>(); |