com.holonplatform.vaadin.flow.components

## Interface HasComponent

- All Superinterfaces:
    com.vaadin.flow.component.HasElement, Serializable
  All Known Subinterfaces:
    BeanListing<T>, Input<T>, ItemListing<T,P>, MultiSelect<T>, NavigationLink, PropertyInputForm, PropertyListing, PropertyViewForm, SingleSelect<T>, ValidatableInput<T>, ValidatableMultiSelect<T>, ValidatableSingleSelect<T>, ValueComponent<V>, ViewComponent<V>
  All Known Implementing Classes:
    DefaultNavigationLink
  Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

      @FunctionalInterface
      public interface HasComponent
      extends com.vaadin.flow.component.HasElement

  Represents and object which can be represented by a UI `Component`, which can be obtained using the `getComponent()` method.
  Since:
    5.2.0

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static HasComponent` | `create(com.vaadin.flow.component.Component component)` Create a `HasComponent` using given `component`.
    `com.vaadin.flow.component.Component` | `getComponent()` Get the UI `Component` which represents this object.
    `default com.vaadin.flow.dom.Element` | `getElement()`
    `default Optional<com.vaadin.flow.component.HasEnabled>` | `hasEnabled()` Checks whether the `Component` may be enabled or disabled, using the `HasEnabled` interface.
    `default Optional<HasLabel>` | `hasLabel()` Checks whether this component supports a label, which text can be handled using the `HasLabel` interface.
    `default Optional<com.vaadin.flow.component.HasSize>` | `hasSize()` Checks whether the `Component` supports size setting, using the `HasSize` interface.
    `default Optional<com.vaadin.flow.component.HasStyle>` | `hasStyle()` Checks whether the `Component` supports css style classes, using the `HasStyle` interface.
    `default Optional<com.vaadin.flow.component.HasValidation>` | `hasValidation()` Checks whether the `Component` supports input validation, using the `HasValidation` interface.
    `default boolean` | `isVisible()` Gets the component visibility value.
    `default void` | `setVisible(boolean visible)` Sets the component visibility value.

- - ### Method Detail

    - #### getComponent

          com.vaadin.flow.component.Component getComponent()

      Get the UI `Component` which represents this object.
      Returns:
        the UI component (not null)

    - #### getElement

          default com.vaadin.flow.dom.Element getElement()

      Specified by:
        `getElement` in interface `com.vaadin.flow.component.HasElement`

    - #### setVisible

          default void setVisible(boolean visible)

      Sets the component visibility value.

      When a component is set as invisible, all the updates of the component from the server to the client are blocked until the component is set as visible again.

      Invisible components don't receive any updates from the client-side. Unlike the server-side updates, client-side updates, if any, are discarded while the component is invisible, and are not transmitted to the server when the component is made visible.

      Parameters:
        `visible` - the component visibility value

    - #### isVisible

          default boolean isVisible()

      Gets the component visibility value.
      Returns:
        `true` if the component is visible, `false` otherwise

    - #### hasEnabled

          default Optional<com.vaadin.flow.component.HasEnabled> hasEnabled()

      Checks whether the `Component` may be enabled or disabled, using the `HasEnabled` interface.
      Returns:
        If the component may be enabled or disabled, return the `HasEnabled` reference. An empty Optional otherwise.

    - #### hasStyle

          default Optional<com.vaadin.flow.component.HasStyle> hasStyle()

      Checks whether the `Component` supports css style classes, using the `HasStyle` interface.
      Returns:
        If the component supports css style classes, return the `HasStyle` reference. An empty Optional otherwise.

    - #### hasSize

          default Optional<com.vaadin.flow.component.HasSize> hasSize()

      Checks whether the `Component` supports size setting, using the `HasSize` interface.
      Returns:
        If the component supports size setting, return the `HasSize` reference. An empty Optional otherwise.

    - #### hasLabel

          default Optional<HasLabel> hasLabel()

      Checks whether this component supports a label, which text can be handled using the `HasLabel` interface.
      Returns:
        If this component supports a label, return the `HasLabel` reference. An empty Optional is returned otherwise.

    - #### hasValidation

          default Optional<com.vaadin.flow.component.HasValidation> hasValidation()

      Checks whether the `Component` supports input validation, using the `HasValidation` interface.
      Returns:
        If the component supports input validation, return the `HasValidation` reference. An empty Optional otherwise.

    - #### create

          static HasComponent create(com.vaadin.flow.component.Component component)

      Create a `HasComponent` using given `component`.
      Parameters:
        `component` - The component to provide from the `getComponent()` method (not null)
      Returns:
        A new `HasComponent` bound to given `component`

Copyright © 2019 The Holon Platform. All rights reserved.