@@ -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> | |||
@@ -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(); |
@@ -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; |
@@ -56,7 +56,7 @@ public class WidgetUtil { | |||
* | |||
* @param <T> | |||
* the object type to store | |||
* @since | |||
* @since 8.4 | |||
*/ | |||
public static class Reference<T> { | |||
@@ -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) { |
@@ -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(); | |||
@@ -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(); |
@@ -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) { |
@@ -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); |
@@ -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 |
@@ -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 |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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) { |
@@ -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() |
@@ -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); |
@@ -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; |
@@ -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()) { |
@@ -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, |
@@ -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) { |
@@ -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); | |||
@@ -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); | |||
} |
@@ -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) { |
@@ -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<>(); | |||