Package io.jmix.ui.relatedentities
Class RelatedEntitiesBuilder
java.lang.Object
io.jmix.ui.relatedentities.RelatedEntitiesBuilder
- Direct Known Subclasses:
RelatedEntitiesClassBuilder
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 Summary
Modifier and TypeFieldDescriptionprotected String
protected Class<?>
protected final Function<RelatedEntitiesBuilder,
Screen> protected MetaClass
protected MetaProperty
protected OpenMode
protected ScreenOptions
protected FrameOwner
protected String
protected String
protected Collection<?>
-
Constructor Summary
ConstructorDescriptionRelatedEntitiesBuilder
(FrameOwner origin, Function<RelatedEntitiesBuilder, Screen> handler) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the screen.Class<?>
Collection<?>
withConfigurationName
(String configurationName) Sets a name to filter configuration in opened screen.withEntityClass
(Class<?> entityClass) Sets class of entity for which you want to see related entities.withMetaClass
(MetaClass metaClass) Sets MetaClass of entity for which you want to see related entities.withMetaProperty
(MetaProperty metaProperty) Sets MetaProperty from which you want to show related entities.withOpenMode
(OpenMode openMode) SetsOpenMode
for the lookup screen and returns the builder for chaining.withOptions
(ScreenOptions options) SetsScreenOptions
for the lookup screen and returns the builder for chaining.withProperty
(String property) Sets property from which you want to show related entities.<S extends Screen>
RelatedEntitiesClassBuilder<S>withScreenClass
(Class<S> screenClass) Sets screen class and returns theRelatedEntitiesClassBuilder
for chaining.withScreenId
(String screenId) Sets screen id and returns the builder for chaining.withSelectedEntities
(Collection<?> selectedEntities) Sets collection of selected items.
-
Field Details
-
handler
-
property
-
metaProperty
-
entityClass
-
metaClass
-
openMode
-
screenId
-
origin
-
options
-
selectedEntities
-
configurationName
-
-
Constructor Details
-
RelatedEntitiesBuilder
-
Method Details
-
getProperty
- Returns:
- property set by
withProperty(String)
-
getMetaProperty
- Returns:
- meta property set by
withMetaProperty(MetaProperty)
-
getEntityClass
- Returns:
- entity class set by
withEntityClass(Class)
-
getOpenMode
- Returns:
- open mode set by
withOpenMode(OpenMode)
-
getScreenId
- Returns:
- screen id set by
withScreenId(String)
-
getOrigin
- Returns:
- invoking screen
-
getOptions
- Returns:
- screen options set by
withOptions(ScreenOptions)
-
getMetaClass
- Returns:
- meta class set by
withMetaClass(MetaClass)
-
getSelectedEntities
- Returns:
- selected entities set by
withSelectedEntities(Collection)
-
getConfigurationName
- Returns:
- filter caption set by
withConfigurationName(String)
-
withProperty
Sets property from which you want to show related entities.- Parameters:
property
- property- Returns:
- current instance of builder
-
withMetaProperty
Sets MetaProperty from which you want to show related entities.- Parameters:
metaProperty
- meta property- Returns:
- current instance of builder
-
withEntityClass
Sets class of entity for which you want to see related entities.- Parameters:
entityClass
- class- Returns:
- current instance of builder
-
withOpenMode
SetsOpenMode
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
Sets screen id and returns the builder for chaining.- Parameters:
screenId
- identifier of the screen- Returns:
- current instance of builder
-
withScreenClass
Sets screen class and returns theRelatedEntitiesClassBuilder
for chaining.- Parameters:
screenClass
- class of the screen controller- Returns:
- RelatedEntitiesClassBuilder with copied fields
-
withOptions
SetsScreenOptions
for the lookup screen and returns the builder for chaining.- Parameters:
options
- screen options- Returns:
- current instance of builder
-
withMetaClass
Sets MetaClass of entity for which you want to see related entities.- Parameters:
metaClass
- meta class- Returns:
- current instance of builder
-
withSelectedEntities
Sets collection of selected items.- Parameters:
selectedEntities
- selected entities- Returns:
- current instance of builder
-
withConfigurationName
Sets a name to filter configuration in opened screen.- Parameters:
configurationName
- a configuration name- Returns:
- current instance of builder
-
build
Builds the screen.- Returns:
- created screen
-