Class RelatedEntitiesBuilder

java.lang.Object
io.jmix.ui.relatedentities.RelatedEntitiesBuilder
Direct Known Subclasses:
RelatedEntitiesClassBuilder

public class RelatedEntitiesBuilder extends Object
Builder class creates screen for related entities. For instance:

      RelatedEntitiesBuilder builder = RelatedEntitiesSupport.builder(this);
      Screen colourBrowser = builder
              .withEntityClass(Car.class)
              .withProperty("colour")
              .withSelectedEntities(carsTable.getSelected())
              .withScreenId("ColourBrowser")
              .build();
      colourBrowser.show();
 
  • Field Details

  • Constructor Details

  • Method Details

    • getProperty

      @Nullable public String getProperty()
      Returns:
      property set by withProperty(String)
    • getMetaProperty

      @Nullable public MetaProperty getMetaProperty()
      Returns:
      meta property set by withMetaProperty(MetaProperty)
    • getEntityClass

      @Nullable public Class<?> getEntityClass()
      Returns:
      entity class set by withEntityClass(Class)
    • getOpenMode

      public OpenMode getOpenMode()
      Returns:
      open mode set by withOpenMode(OpenMode)
    • getScreenId

      @Nullable public String getScreenId()
      Returns:
      screen id set by withScreenId(String)
    • getOrigin

      public FrameOwner getOrigin()
      Returns:
      invoking screen
    • getOptions

      public ScreenOptions getOptions()
      Returns:
      screen options set by withOptions(ScreenOptions)
    • getMetaClass

      @Nullable public MetaClass getMetaClass()
      Returns:
      meta class set by withMetaClass(MetaClass)
    • getSelectedEntities

      @Nullable public Collection<?> getSelectedEntities()
      Returns:
      selected entities set by withSelectedEntities(Collection)
    • getConfigurationName

      @Nullable public String getConfigurationName()
      Returns:
      filter caption set by withConfigurationName(String)
    • withProperty

      public RelatedEntitiesBuilder withProperty(String property)
      Sets property from which you want to show related entities.
      Parameters:
      property - property
      Returns:
      current instance of builder
    • withMetaProperty

      public RelatedEntitiesBuilder withMetaProperty(MetaProperty metaProperty)
      Sets MetaProperty from which you want to show related entities.
      Parameters:
      metaProperty - meta property
      Returns:
      current instance of builder
    • withEntityClass

      public RelatedEntitiesBuilder withEntityClass(Class<?> entityClass)
      Sets class of entity for which you want to see related entities.
      Parameters:
      entityClass - class
      Returns:
      current instance of builder
    • withOpenMode

      public RelatedEntitiesBuilder withOpenMode(OpenMode openMode)
      Sets OpenMode for the lookup screen and returns the builder for chaining.

      For example: builder.withOpenMode(OpenMode.DIALOG).build();

      Parameters:
      openMode - open mode
      Returns:
      current instance of builder
    • withScreenId

      public RelatedEntitiesBuilder withScreenId(String screenId)
      Sets screen id and returns the builder for chaining.
      Parameters:
      screenId - identifier of the screen
      Returns:
      current instance of builder
    • withScreenClass

      public <S extends Screen> RelatedEntitiesClassBuilder<S> withScreenClass(Class<S> screenClass)
      Sets screen class and returns the RelatedEntitiesClassBuilder for chaining.
      Parameters:
      screenClass - class of the screen controller
      Returns:
      RelatedEntitiesClassBuilder with copied fields
    • withOptions

      public RelatedEntitiesBuilder withOptions(ScreenOptions options)
      Sets ScreenOptions for the lookup screen and returns the builder for chaining.
      Parameters:
      options - screen options
      Returns:
      current instance of builder
    • withMetaClass

      public RelatedEntitiesBuilder withMetaClass(MetaClass metaClass)
      Sets MetaClass of entity for which you want to see related entities.
      Parameters:
      metaClass - meta class
      Returns:
      current instance of builder
    • withSelectedEntities

      public RelatedEntitiesBuilder withSelectedEntities(Collection<?> selectedEntities)
      Sets collection of selected items.
      Parameters:
      selectedEntities - selected entities
      Returns:
      current instance of builder
    • withConfigurationName

      public RelatedEntitiesBuilder withConfigurationName(String configurationName)
      Sets a name to filter configuration in opened screen.
      Parameters:
      configurationName - a configuration name
      Returns:
      current instance of builder
    • build

      public Screen build()
      Builds the screen.
      Returns:
      created screen