C
- the value change source typeT
- the value typepublic class AbstractFieldSupport<C extends Component & HasValue<AbstractField.ComponentValueChangeEvent<C,T>,T>,T> extends Object implements Serializable
AbstractField
but
not in AbstractCompositeField
, or vice versa.Constructor and Description |
---|
AbstractFieldSupport(C component,
T defaultValue,
SerializableBiPredicate<T,T> valueEquals,
SerializableConsumer<T> setPresentationValue)
Creates a new field support.
|
Modifier and Type | Method and Description |
---|---|
Registration |
addValueChangeListener(HasValue.ValueChangeListener<? super AbstractField.ComponentValueChangeEvent<C,T>> listener)
|
T |
getEmptyValue()
Delegate method for
HasValue.getEmptyValue() . |
T |
getValue()
Delegate method for
HasValue.getValue() . |
void |
setModelValue(T newModelValue,
boolean fromClient)
Delegate method corresponding to
AbstractField.setModelValue(Object, boolean) . |
void |
setValue(T value)
Delegate method for
HasValue.setValue(Object) . |
boolean |
valueEquals(T value1,
T value2)
Delegate method corresponding to
AbstractField.valueEquals(Object, Object) . |
public AbstractFieldSupport(C component, T defaultValue, SerializableBiPredicate<T,T> valueEquals, SerializableConsumer<T> setPresentationValue)
component
- the owning field componentdefaultValue
- the default field valuevalueEquals
- a callback for comparing valuessetPresentationValue
- a callback for setting presentation valuespublic Registration addValueChangeListener(HasValue.ValueChangeListener<? super AbstractField.ComponentValueChangeEvent<C,T>> listener)
HasValue.addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener)
listener
- the listener to addpublic T getValue()
HasValue.getValue()
.public T getEmptyValue()
HasValue.getEmptyValue()
.public void setValue(T value)
HasValue.setValue(Object)
.value
- the value to setpublic boolean valueEquals(T value1, T value2)
AbstractField.valueEquals(Object, Object)
.value1
- the first instancevalue2
- the second instancetrue
if the instances are equal; otherwise
false
public void setModelValue(T newModelValue, boolean fromClient)
AbstractField.setModelValue(Object, boolean)
.newModelValue
- the new internal value to usefromClient
- true
if the new value originates from the client;
otherwise false
Copyright © 2019. All rights reserved.