Class SuperDoubleField
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<T>,T>
-
- com.vaadin.flow.component.customfield.CustomField<T>
-
- org.vaadin.miki.superfields.numbers.AbstractSuperNumberField<T,SELF>
-
- org.vaadin.miki.superfields.numbers.AbstractSuperFloatingPointField<Double,SuperDoubleField>
-
- org.vaadin.miki.superfields.numbers.SuperDoubleField
-
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Double>,Double>,Double>,com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Double>,Double>,Double>,com.vaadin.flow.component.shared.HasClearButton,com.vaadin.flow.component.shared.HasTooltip,com.vaadin.flow.component.textfield.HasPrefixAndSuffix,com.vaadin.flow.data.value.HasValueChangeMode,Serializable,TextSelectionNotifier<SuperDoubleField>,CanReceiveSelectionEventsFromClient,CanSelectText,HasHelperPositionable,HasId,HasLabelPositionable,HasLocale,HasNullValueOptionallyAllowed<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Double>,Double>,Double>,HasPlaceholder,HasRequired,WithClearButtonMixin<SuperDoubleField>,WithHelperMixin<SuperDoubleField>,WithHelperPositionableMixin<SuperDoubleField>,WithIdMixin<SuperDoubleField>,WithLabelMixin<SuperDoubleField>,WithLabelPositionableMixin<SuperDoubleField>,WithLocaleMixin<SuperDoubleField>,WithNullValueOptionallyAllowedMixin<SuperDoubleField,com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Double>,Double>,Double>,WithPlaceholderMixin<SuperDoubleField>,WithReceivingSelectionEventsFromClientMixin<SuperDoubleField>,WithRequiredMixin<SuperDoubleField>,WithTooltipMixin<SuperDoubleField>,WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Double>,Double>,Double,SuperDoubleField>
@JsModule("./super-double-field.ts") @Tag("super-double-field") public class SuperDoubleField extends AbstractSuperFloatingPointField<Double,SuperDoubleField>A field forDoublevalues that are properly formatted.- Since:
- 2020-04-07
- Author:
- miki
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V extends Object>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
-
-
Field Summary
-
Fields inherited from interface org.vaadin.miki.markers.HasHelperPositionable
HELPER_ABOVE_THEME_VARIANT
-
Fields inherited from interface org.vaadin.miki.markers.HasLabelPositionable
LABEL_POSITION_ATTRIBUTE, LABEL_POSITION_DETAILS_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description SuperDoubleField()Constructs the field with an empty label, zero as default value and with defaultLocale.SuperDoubleField(Double defaultValue, String label)Constructs the field with given default value and label, and with defaultLocale.SuperDoubleField(Double defaultValue, String label, Locale locale, int maxFractionDigits)Constructs the field.SuperDoubleField(String label)Constructs the field with defaultLocaleand zero as default value.SuperDoubleField(String label, Locale locale)Constructs the field with zero as the default value.SuperDoubleField(String label, Locale locale, int maxFractionDigits)Constructs the field with zero as the default value..SuperDoubleField(Locale locale)Constructs the field with an empty label and zero as default value.SuperDoubleField(Locale locale, int maxFractionDigits)Constructs the field with an empty label and zero as default value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DoubleparseRawValue(String rawValue, DecimalFormat format)Parses (somewhat) raw value from the text field into a proper typed value.-
Methods inherited from class org.vaadin.miki.superfields.numbers.AbstractSuperFloatingPointField
isIntegerPartOptional, setIntegerPartOptional, setMaximumFractionDigits, setMinimumFractionDigits, withIntegerPartOptional, withIntegerPartOptional, withIntegerPartRequired, withMaximumFractionDigits, withMinimumFractionDigits
-
Methods inherited from class org.vaadin.miki.superfields.numbers.AbstractSuperNumberField
addTextSelectionListener, addThemeVariants, blur, buildRegularExpression, escapeDot, focus, generateModelValue, getErrorMessage, getHelperComponent, getHelperText, getLabel, getLabelPosition, getLocale, getPlaceholder, getPrefixComponent, getRawValue, getRegexp, getSuffixComponent, getTooltip, getValueChangeMode, getValueChangeTimeout, isAutoselect, isClearButtonVisible, isFocused, isGroupingSeparatorHiddenOnFocus, isHelperAbove, isInvalid, isNegativeValueAllowed, isNullValueAllowed, isReadOnly, isReceivingSelectionEventsFromClient, isRequired, isRequiredIndicatorVisible, removeThemeVariants, select, selectAll, selectNone, setAutoselect, setClearButtonVisible, setDecimalFormat, setErrorMessage, setGroupingSeparatorHiddenOnFocus, setHelperAbove, setHelperAbove, setHelperBelow, setHelperComponent, setHelperText, setId, setInvalid, setLabel, setLabelPosition, setLocale, setMaximumIntegerDigits, setNegativeValueAllowed, setNullValueAllowed, setPlaceholder, setPrefixComponent, setPresentationValue, setReadOnly, setReceivingSelectionEventsFromClient, setRequired, setRequiredIndicatorVisible, setSuffixComponent, setTooltipText, setValueChangeMode, setValueChangeTimeout, updateFieldValue, updateRegularExpression, updateRegularExpression, withAutoselect, withGroupingSeparatorHiddenOnFocus, withMaximumIntegerDigits, withNegativeValueAllowed, withReceivingSelectionEventsFromClient
-
Methods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, onAttach, remove, removeThemeVariants, updateValue
-
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, getTabIndex, setTabIndex
-
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
-
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Methods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, setValue
-
Methods inherited from interface org.vaadin.miki.markers.WithClearButtonMixin
withClearButtonVisible
-
Methods inherited from interface org.vaadin.miki.markers.WithHelperMixin
withHelperComponent, withHelperText
-
Methods inherited from interface org.vaadin.miki.markers.WithHelperPositionableMixin
withHelperAbove, withHelperAbove, withHelperBelow
-
Methods inherited from interface org.vaadin.miki.markers.WithIdMixin
withId
-
Methods inherited from interface org.vaadin.miki.markers.WithLabelMixin
withLabel
-
Methods inherited from interface org.vaadin.miki.markers.WithLabelPositionableMixin
withLabelPosition
-
Methods inherited from interface org.vaadin.miki.markers.WithLocaleMixin
withLocale
-
Methods inherited from interface org.vaadin.miki.markers.WithNullValueOptionallyAllowedMixin
withNullValueAllowed
-
Methods inherited from interface org.vaadin.miki.markers.WithPlaceholderMixin
withPlaceholder
-
Methods inherited from interface org.vaadin.miki.markers.WithRequiredMixin
withoutRequired, withRequired, withRequired
-
Methods inherited from interface org.vaadin.miki.markers.WithTooltipMixin
withTooltipText
-
Methods inherited from interface org.vaadin.miki.markers.WithValueMixin
withValue
-
-
-
-
Constructor Detail
-
SuperDoubleField
public SuperDoubleField()
Constructs the field with an empty label, zero as default value and with defaultLocale.
-
SuperDoubleField
public SuperDoubleField(Locale locale)
Constructs the field with an empty label and zero as default value.- Parameters:
locale- Locale to use for formatting.
-
SuperDoubleField
public SuperDoubleField(Locale locale, int maxFractionDigits)
Constructs the field with an empty label and zero as default value.- Parameters:
locale- Locale to use for formatting.maxFractionDigits- Maximum number of fraction digits allowed (overwrites setting found inlocale.
-
SuperDoubleField
public SuperDoubleField(String label)
Constructs the field with defaultLocaleand zero as default value.- Parameters:
label- Label accompanying the field.
-
SuperDoubleField
public SuperDoubleField(String label, Locale locale)
Constructs the field with zero as the default value.- Parameters:
label- Label accompanying the field.locale- Locale to use for formatting.
-
SuperDoubleField
public SuperDoubleField(Double defaultValue, String label)
Constructs the field with given default value and label, and with defaultLocale.- Parameters:
defaultValue- Default value.label- Label that accompanies the field.
-
SuperDoubleField
public SuperDoubleField(String label, Locale locale, int maxFractionDigits)
Constructs the field with zero as the default value..- Parameters:
label- Label accompanying the field.locale- Locale to use for formatting.maxFractionDigits- Maximum number of fraction digits allowed (overwrites setting found inlocale.
-
SuperDoubleField
public SuperDoubleField(Double defaultValue, String label, Locale locale, int maxFractionDigits)
Constructs the field.- Parameters:
defaultValue- Default value.label- Label accompanying the field.locale- Locale to use for formatting.maxFractionDigits- Maximum number of fraction digits allowed (overwrites setting found inlocale.
-
-
Method Detail
-
parseRawValue
protected Double parseRawValue(String rawValue, DecimalFormat format) throws ParseException
Description copied from class:AbstractSuperNumberFieldParses (somewhat) raw value from the text field into a proper typed value.- Specified by:
parseRawValuein classAbstractSuperNumberField<Double,SuperDoubleField>- Parameters:
rawValue- Value from text field.format- Format to use.- Returns:
- Parsed value.
- Throws:
ParseException- When parsing goes wrong.
-
-