Package io.jmix.ui

Interface UiComponents

All Known Implementing Classes:
UiComponentsImpl

public interface UiComponents
Factory to create UI components in client independent manner.
An instance of the factory can be injected into screen controllers or obtained through ApplicationContext.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends Component>
    T
    create(Class<T> type)
    Create a component instance by its type.
    <T extends Component>
    T
    create(String name)
    Create a component instance by its name.
    <T extends Component>
    T
    create(org.springframework.core.ParameterizedTypeReference<T> type)
    Create a component instance by its type.
    boolean
    Checks that a component with given type is registered.
    boolean
    Checks that a component with given name is registered.
  • Method Details

    • create

      <T extends Component> T create(String name)
      Create a component instance by its name.
      Parameters:
      name - component name. It is usually defined in NAME constant inside the component interface, e.g. Label.NAME. It is also usually equal to component's XML name.
      Returns:
      component instance
    • create

      <T extends Component> T create(Class<T> type)
      Create a component instance by its type.
      Parameters:
      type - component type
      Returns:
      component instance
    • create

      <T extends Component> T create(org.springframework.core.ParameterizedTypeReference<T> type)
      Create a component instance by its type.
      Parameters:
      type - component type reference
      Returns:
      component instance
      See Also:
    • isComponentRegistered

      boolean isComponentRegistered(String name)
      Checks that a component with given name is registered.
      Parameters:
      name - component name. It is usually defined in NAME constant inside the component interface, e.g. Label.NAME. It is also usually equal to component's XML name.
      Returns:
      true if the component is registered
    • isComponentRegistered

      boolean isComponentRegistered(Class<?> type)
      Checks that a component with given type is registered.
      Parameters:
      type - component type reference
      Returns:
      true if the component is registered