Class FPasswordField

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.textfield.PasswordField,String>
com.vaadin.flow.component.AbstractSinglePropertyField<com.vaadin.flow.component.textfield.PasswordField,String>
com.vaadin.flow.component.textfield.TextFieldBase<com.vaadin.flow.component.textfield.PasswordField,String>
com.vaadin.flow.component.textfield.PasswordField
com.vaadin.featurepack.ui.FPasswordField
All Implemented Interfaces:
Buffered, BufferedValidatable, Property<String>, Property.Editor, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Field<String>, Validatable, FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, ClientConnector, FAbstractClientConnector, FSizeable, HasSizeable, FAbstractComponent, FAbstractTextField, HasInputColumns, InputSelectionCapable<String>, NullValueCapable<String>, com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.textfield.PasswordField>, com.vaadin.flow.component.CompositionNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.textfield.PasswordField>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.textfield.PasswordField>, com.vaadin.flow.component.HasAriaDescription, com.vaadin.flow.component.HasAriaLabel, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasPlaceholder, 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.textfield.PasswordField,String>,String>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>, com.vaadin.flow.component.InputNotifier, com.vaadin.flow.component.KeyNotifier, com.vaadin.flow.component.shared.HasAllowedCharPattern, com.vaadin.flow.component.shared.HasClearButton, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.shared.HasTextSelection, com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.textfield.TextFieldVariant>, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>, com.vaadin.flow.component.textfield.HasAutocapitalize, com.vaadin.flow.component.textfield.HasAutocomplete, com.vaadin.flow.component.textfield.HasAutocorrect, com.vaadin.flow.data.binder.HasValidator<String>, com.vaadin.flow.data.value.HasValueChangeMode, Serializable

public class FPasswordField extends com.vaadin.flow.component.textfield.PasswordField implements FAbstractTextField
See Also:
  • Constructor Details

    • FPasswordField

      public FPasswordField()
      Constructs an empty PasswordField.
    • FPasswordField

      public FPasswordField(Property dataSource)
      Constructs a PasswordField with given property data source.
      Parameters:
      dataSource - the property data source for the field
    • FPasswordField

      public FPasswordField(String caption, Property dataSource)
      Constructs a PasswordField with given caption and property data source.
      Parameters:
      caption - the caption for the field
      dataSource - the property data source for the field
    • FPasswordField

      public FPasswordField(String caption, String value)
      Constructs a PasswordField with given value and caption.
      Parameters:
      caption - the caption for the field
      value - the value for the field
    • FPasswordField

      public FPasswordField(String caption)
      Constructs a PasswordField with given caption.
      Parameters:
      caption - the caption for the field
  • Method Details

    • setValue

      public void setValue(String value)
      Sets the value of the field. If the value matches the null representation, the logical value will be null but the null representation will be displayed.
      Specified by:
      setValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>
      Specified by:
      setValue in interface Property<String>
      Overrides:
      setValue in class com.vaadin.flow.component.textfield.PasswordField
      Parameters:
      value - the value to set
    • getValue

      public String getValue()
      Returns the logical value of the field. If the stored logical value is null, this method returns null, otherwise it returns the displayed text.
      Specified by:
      getValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>
      Specified by:
      getValue in interface Property<String>
      Overrides:
      getValue in class com.vaadin.flow.component.textfield.PasswordField
      Returns:
      the logical value of this field, potentially null
    • isEmpty

      public boolean isEmpty()
      Checks whether the field is logically empty. Returns true if the value is an empty string or null.
      Specified by:
      isEmpty in interface Field<String>
      Specified by:
      isEmpty in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>
      Overrides:
      isEmpty in class com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.textfield.PasswordField,String>
      Returns:
      true if the value is an empty string or null, false otherwise
    • setLabel

      public void setLabel(String label)
      Specified by:
      setLabel in interface com.vaadin.flow.component.HasLabel
      Overrides:
      setLabel in class com.vaadin.flow.component.textfield.TextFieldBase<com.vaadin.flow.component.textfield.PasswordField,String>
    • setLabelComponent

      public void setLabelComponent(com.vaadin.flow.component.Component labelComponent)
      Description copied from interface: FAbstractComponent
      Sets the component's label component. Flow components that support caption component usually overrides this.
      Specified by:
      setLabelComponent in interface FAbstractComponent
      Parameters:
      labelComponent - the new label component for the component.
    • getInputColumnController

      public InputColumnController getInputColumnController()
      Description copied from interface: HasInputColumns
      Returns the controller that provides logic for input column handling. Implementations should provide their own controller instance.
      Specified by:
      getInputColumnController in interface HasInputColumns
      Returns:
      the InputColumnController instance
    • getInputSelectionController

      public InputSelectionController<String> getInputSelectionController()
      Description copied from interface: InputSelectionCapable
      Returns the controller that manages input selection logic for this component.
      Specified by:
      getInputSelectionController in interface InputSelectionCapable<String>
      Returns:
      the InputSelectionController instance
    • setCursorPosition

      public void setCursorPosition(int pos)
      Description copied from interface: InputSelectionCapable
      Sets the cursor position in the field. This also focuses the field on the client side. The actual cursor position on the client may differ due to asynchronous updates.
      Specified by:
      setCursorPosition in interface com.vaadin.flow.component.shared.HasTextSelection
      Specified by:
      setCursorPosition in interface InputSelectionCapable<String>
      Parameters:
      pos - the position to move the cursor to
    • selectAll

      public void selectAll()
      Description copied from interface: InputSelectionCapable
      Selects all text in the field. Focuses the field and attempts to set the selection range from start to end of the current value.
      Specified by:
      selectAll in interface com.vaadin.flow.component.shared.HasTextSelection
      Specified by:
      selectAll in interface InputSelectionCapable<String>
    • setSelectionRange

      public void setSelectionRange(int pos, int length)
      Description copied from interface: InputSelectionCapable
      Sets the range of text to be selected and focuses the field on the client side. The component will attempt to select the specified text range. If the provided indices are out of range, the actual client-side behavior may differ.
      Specified by:
      setSelectionRange in interface com.vaadin.flow.component.shared.HasTextSelection
      Specified by:
      setSelectionRange in interface InputSelectionCapable<String>
      Parameters:
      pos - the starting position of the selection
      length - the number of characters to select
    • getNullValueController

      public NullValueController<String> getNullValueController()
      Description copied from interface: NullValueCapable
      Returns the controller that provides logic for handling null-value behavior.
      Specified by:
      getNullValueController in interface NullValueCapable<String>
      Returns:
      the NullValueController instance
    • validate

      public void validate()
      Description copied from interface: Validatable

      Checks the validity of the validatable. If the validatable is valid this method should do nothing, and if it's not valid, it should throw Validator.InvalidValueException

      Specified by:
      validate in interface Validatable
      Overrides:
      validate in class com.vaadin.flow.component.textfield.PasswordField
    • getType

      public Class<? extends String> getType()
      Description copied from interface: Property
      Returns the type of the Property. The methods getValue and setValue must be compatible with this type: one must be able to safely cast the value returned from getValue to the given type and pass any variable assignable to this type as an argument to setValue.
      Specified by:
      getType in interface Field<String>
      Specified by:
      getType in interface Property<String>
      Returns:
      type of the Property
    • clear

      public void clear()
      Description copied from interface: FAbstractTextField
      Resets the value to the empty one.
      Specified by:
      clear in interface FAbstractTextField
      Specified by:
      clear in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>
    • isReadOnly

      public boolean isReadOnly()
      Specified by:
      isReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>
      Specified by:
      isReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.PasswordField,String>,String>
    • setRequired

      public void setRequired(boolean required)
      Description copied from interface: Field
      Sets the field required. Required fields must filled by the user.
      Specified by:
      setRequired in interface Field<String>
      Overrides:
      setRequired in class com.vaadin.flow.component.textfield.TextFieldBase<com.vaadin.flow.component.textfield.PasswordField,String>
      Parameters:
      required - Is the field required.
    • isRequired

      public boolean isRequired()
      Description copied from interface: Field
      Is this field required. Required fields must filled by the user.
      Specified by:
      isRequired in interface Field<String>
      Overrides:
      isRequired in class com.vaadin.flow.component.textfield.TextFieldBase<com.vaadin.flow.component.textfield.PasswordField,String>
      Returns:
      true if the field is required,otherwise false.
    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component
    • onDetach

      protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
      Overrides:
      onDetach in class com.vaadin.flow.component.Component
    • fireEvent

      protected void fireEvent(com.vaadin.flow.component.ComponentEvent<?> componentEvent)
      Overrides:
      fireEvent in class com.vaadin.flow.component.Component