Class ComponentRegistrationBuilder

java.lang.Object
io.jmix.flowui.sys.registration.ComponentRegistrationBuilder

public class ComponentRegistrationBuilder extends Object
Builds registration object that is used for adding new component loader or overriding UI components in the framework.

For instance:

 @Configuration
 public class ComponentConfiguration {

     @Bean
     public ComponentRegistration extJmixButton() {
         return ComponentRegistrationBuilder.create(ExtJmixButton.class)
                 .replaceComponent(JmixButton.class)
                 .withComponentLoader("button", ExtButtonLoader.class)
                 .build();
     }
 }
 
See Also:
  • Field Details

    • component

      protected Class<? extends com.vaadin.flow.component.Component> component
    • tag

      protected String tag
    • replacedComponent

      protected Class<? extends com.vaadin.flow.component.Component> replacedComponent
    • componentLoader

      protected Class<? extends ComponentLoader> componentLoader
  • Constructor Details

    • ComponentRegistrationBuilder

      public ComponentRegistrationBuilder(Class<? extends com.vaadin.flow.component.Component> component)
      Parameters:
      component - component name
  • Method Details

    • create

      public static ComponentRegistrationBuilder create(Class<? extends com.vaadin.flow.component.Component> component)
      Parameters:
      component - component class
      Returns:
      builder instance
    • replaceComponent

      public ComponentRegistrationBuilder replaceComponent(Class<? extends com.vaadin.flow.component.Component> component)
      Sets the component class that should be replaced.
      Parameters:
      component - component class to replace
      Returns:
      builder instance
    • withComponentLoader

      public ComponentRegistrationBuilder withComponentLoader(String tag, Class<? extends ComponentLoader> componentLoader)
      Sets component loader class.
      Parameters:
      tag - component name in the view descriptor
      componentLoader - component loader class
      Returns:
      builder instance
    • build

      public ComponentRegistration build()
      Returns:
      instance of registration object