|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.Serializable; |
|
|
import java.io.Serializable; |
|
|
import java.util.Locale; |
|
|
import java.util.Locale; |
|
|
import java.util.Objects; |
|
|
|
|
|
import java.util.Optional; |
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
|
import com.vaadin.ui.Component; |
|
|
import com.vaadin.ui.Component; |
|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
@SuppressWarnings("unchecked") |
|
|
@SuppressWarnings("unchecked") |
|
|
public ValueContext(Component component) { |
|
|
public ValueContext(Component component) { |
|
|
Objects.requireNonNull(component, |
|
|
|
|
|
"Component can't be null in ValueContext construction"); |
|
|
|
|
|
this.component = component; |
|
|
this.component = component; |
|
|
if (component instanceof HasValue) { |
|
|
if (component instanceof HasValue) { |
|
|
hasValue = (HasValue<?>) component; |
|
|
hasValue = (HasValue<?>) component; |
|
|
|
|
|
|
|
|
* @since 8.1 |
|
|
* @since 8.1 |
|
|
*/ |
|
|
*/ |
|
|
public ValueContext(Component component, HasValue<?> hasValue) { |
|
|
public ValueContext(Component component, HasValue<?> hasValue) { |
|
|
Objects.requireNonNull(component, |
|
|
|
|
|
"Component can't be null in ValueContext construction"); |
|
|
|
|
|
this.component = component; |
|
|
this.component = component; |
|
|
this.hasValue = hasValue; |
|
|
this.hasValue = hasValue; |
|
|
locale = findLocale(); |
|
|
locale = findLocale(); |