Class ComponentRegistrationBuilder

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

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

For instance:

 @Configuration
 public class ComponentConfiguration {

     @Bean
     public ComponentRegistration extButton() {
         return ComponentRegistrationBuilder.create(ExtButton.NAME)
                 .withComponentClass(ExtWebButton.class)
                 .withComponentLoaderClass(ExtButtonLoader.class)
                 .build();
     }
 }
 
See Also:
  • Field Details

  • Constructor Details

    • ComponentRegistrationBuilder

      public ComponentRegistrationBuilder(String name)
      Parameters:
      name - component name
  • Method Details

    • create

      public static ComponentRegistrationBuilder create(String name)
      Parameters:
      name - component name
      Returns:
      builder instance
    • withTag

      public ComponentRegistrationBuilder withTag(String tag)
      Sets component name in the screen descriptor. If tag is null or empty registration object will set tag = name.
      Parameters:
      tag - element name
      Returns:
      builder instance
    • withComponentClass

      public ComponentRegistrationBuilder withComponentClass(Class<? extends Component> componentClass)
      Sets component class.
      Parameters:
      componentClass - component class
      Returns:
      builder instance
    • withComponentLoaderClass

      public ComponentRegistrationBuilder withComponentLoaderClass(Class<? extends ComponentLoader> componentClassLoader)
      Sets component loader class.
      Parameters:
      componentClassLoader - component loader class
      Returns:
      builder instance
    • build

      public ComponentRegistration build()
      Returns:
      instance of registration object