com.holonplatform.vaadin7.components

## Interface Input<V>

- Type Parameters:
    `V` - Value type
  All Superinterfaces:
    Serializable, ValueComponent<V>, ValueHolder<V>
  All Known Subinterfaces:
    MultiSelect<T>, SingleSelect<T>, ValidatableInput<V>

      public interface Input<V>
      extends ValueHolder<V>, ValueComponent<V>

  Input component representation, i.e. a UI component that has a user-editable value.

  Extends `ValueHolder` since handles a value, supporting `ValueChangeListener`s registration.

  The actual UI `Component` which represents the input component can be obtained through `ValueComponent.getComponent()`.

  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `Input.InputFieldPropertyRenderer<T>` A convenience interface to render a `Property` as a `Input` using a `Field`.
    `static interface` | `Input.InputPropertyRenderer<T>` A convenience interface with a fixed `Input` rendering type to use a `Input` `PropertyRenderer` as a functional interface.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin7.components.ValueHolder

      `ValueHolder.ValueChangeEvent<V>, ValueHolder.ValueChangeListener<V>`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `focus()` Sets the focus for this input component, if supported by concrete component implementation.
    `static <T> Input<T>` | `from(com.vaadin.ui.Field<T> field)` Create a `Input` component type from given `Field` instance.
    `boolean` | `isReadOnly()` Returns whether this input component is in read-only mode or not.
    `boolean` | `isRequired()` Gets whether the field is required.
    `void` | `setReadOnly(boolean readOnly)` Sets the read-only mode of this input component.
    `void` | `setRequired(boolean required)` Sets the field as required.

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.ValueHolder

      `addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, setValue`

    - ### Methods inherited from interface com.holonplatform.vaadin7.components.ValueComponent

      `getComponent, getValue`

- - ### Method Detail

    - #### setReadOnly

          void setReadOnly(boolean readOnly)

      Sets the read-only mode of this input component. The user can't change the value when in read-only mode.
      Parameters:
        `readOnly` - the read-only mode of this input component

    - #### isReadOnly

          boolean isReadOnly()

      Returns whether this input component is in read-only mode or not.
      Returns:
        `false` if the user can modify the value, `true` if not

    - #### isRequired

          boolean isRequired()

      Gets whether the field is required.
      Returns:
        `true` if the field as required, `false` otherwise

    - #### setRequired

          void setRequired(boolean required)

      Sets the field as required.

      Required fields should show a required indicator symbol in UI and the default non-empty validator is setted up.

      Parameters:
        `required` - `true` to set the field as required, `false` otherwise

    - #### focus

          void focus()

      Sets the focus for this input component, if supported by concrete component implementation.

    - #### from

          static <T> Input<T> from(com.vaadin.ui.Field<T> field)

      Create a `Input` component type from given `Field` instance.
      Type Parameters:
        `T` - Value type
      Parameters:
        `field` - The field instance (not null)
      Returns:
        A new `Input` component which wraps the given `field`

Copyright © 2019 The Holon Platform. All rights reserved.