com.vaadin.flow.component.

Interface HasText

    • Method Summary

      All Methods
      Modifier and Type Method and Description
      default String getText()

      Gets the text content of this component.

      default void setText(String text)

      Sets the given string as the content of this component.

    • Method Detail

      • setText

        default void setText(String text)

        Sets the given string as the content of this component. This removes any existing child components and child elements. To mix text and child components in a component that also supports child components, use HasComponents.add(Component...) with the Text component for the textual parts.

        Parameters:

        text - the text content to set

      • getText

        default String getText()

        Gets the text content of this component. This method only considers the text of the actual component. The text contents of any child components or elements are not considered.

        Returns:

        the text content of this component, not null