Class ComponentGenerationContext

java.lang.Object
io.jmix.flowui.component.ComponentGenerationContext
Direct Known Subclasses:
InputDialogGenerationContext, JpqlFilterComponentGenerationContext, MessageTemplateParameterGenerationContext, MultiValueSelectView.MultiValueSelectContext, PropertyFilterComponentGenerationContext

public class ComponentGenerationContext extends Object
Contains information for ComponentGenerationStrategy when creating components using UiComponentsGenerator.
  • Field Details

    • metaClass

      protected final MetaClass metaClass
    • property

      protected final String property
    • valueSource

      protected ValueSource valueSource
    • xmlDescriptor

      protected org.dom4j.Element xmlDescriptor
    • targetClass

      protected Class<?> targetClass
    • items

      protected com.vaadin.flow.data.provider.DataProvider items
    • enumItems

      protected Class<?> enumItems
    • collectionItems

      protected CollectionContainer<?> collectionItems
  • Constructor Details

    • ComponentGenerationContext

      public ComponentGenerationContext(@Nullable MetaClass metaClass, @Nullable String property)
      Creates an instance of ComponentGenerationContext.
      Parameters:
      metaClass - the entity for which the component is created
      property - the entity attribute for which the component is created
  • Method Details

    • getMetaClass

      @Nullable public MetaClass getMetaClass()
      Returns:
      the entity for which the component is created
    • getProperty

      @Nullable public String getProperty()
      Returns:
      the entity attribute for which the component is created
    • getValueSource

      @Nullable public ValueSource getValueSource()
      Returns:
      a value source that can be used to create the component
    • setValueSource

      public ComponentGenerationContext setValueSource(@Nullable ValueSource valueSource)
      Sets a value source, using fluent API method.
      Parameters:
      valueSource - a value source to set
      Returns:
      this object
    • getItems

      @Nullable public com.vaadin.flow.data.provider.DataProvider getItems()
      Returns the DataProvider instance to use as a component's items
      Returns:
      the DataProvider instance to use as a component's items
    • setItems

      public ComponentGenerationContext setItems(@Nullable com.vaadin.flow.data.provider.DataProvider items)
      Sets the DataProvider instance to be used as the component's items.
      Parameters:
      items - the DataProvider instance to be set as items; can be null
      Returns:
      this object
    • getEnumItems

      @Nullable public Class<?> getEnumItems()
      Returns the enum class to be used as the component's items.
      Returns:
      a Class object representing the enum items, or null if not set
    • setEnumItems

      public ComponentGenerationContext setEnumItems(@Nullable Class<?> enumItems)
      Sets the enum class to be used as the component's items.
      Parameters:
      enumItems - the Class representing the enum items; can be null
      Returns:
      this object
    • getCollectionItems

      @Nullable public CollectionContainer<?> getCollectionItems()
      Returns a collection container holding entity instances to be used as the component's items.
      Returns:
      a CollectionContainer instance containing the collection of entities, or null if not set.
    • setCollectionItems

      public ComponentGenerationContext setCollectionItems(@Nullable CollectionContainer<?> collectionItems)
      Sets a collection container to be used as the component's items.
      Parameters:
      collectionItems - the CollectionContainer instance containing the collection of entities; can be null
      Returns:
      this object
    • getXmlDescriptor

      @Nullable public org.dom4j.Element getXmlDescriptor()
      Returns:
      an XML descriptor which contains additional information
    • setXmlDescriptor

      public ComponentGenerationContext setXmlDescriptor(@Nullable org.dom4j.Element xmlDescriptor)
      Sets an XML descriptor which contains additional information, using fluent API method.
      Parameters:
      xmlDescriptor - an XML descriptor which contains additional information
      Returns:
      this object
    • getTargetClass

      @Nullable public Class<?> getTargetClass()
      Returns:
      a target class for which a component is created
    • setTargetClass

      public ComponentGenerationContext setTargetClass(@Nullable Class<?> targetClass)
      Sets a target class for which a component is created, using fluent API method. For instance, a target class can be a component or a screen.
      Parameters:
      targetClass - a target class for which a component is created
      Returns:
      this object