Package io.jmix.flowui.component
Class ComponentGenerationContext
java.lang.Object
io.jmix.flowui.component.ComponentGenerationContext
- Direct Known Subclasses:
InputDialogGenerationContext,JpqlFilterComponentGenerationContext,MessageTemplateParameterGenerationContext,MultiValueSelectView.MultiValueSelectContext,PropertyFilterComponentGenerationContext
Contains information for
ComponentGenerationStrategy when creating
components using UiComponentsGenerator.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CollectionContainer<?>protected Class<?>protected com.vaadin.flow.data.provider.DataProviderprotected final MetaClassprotected final Stringprotected Class<?>protected ValueSourceprotected org.dom4j.Element -
Constructor Summary
ConstructorsConstructorDescriptionComponentGenerationContext(MetaClass metaClass, String property) Creates an instance of ComponentGenerationContext. -
Method Summary
Modifier and TypeMethodDescriptionReturns a collection container holding entity instances to be used as the component's items.Class<?>Returns the enum class to be used as the component's items.com.vaadin.flow.data.provider.DataProvidergetItems()Returns theDataProviderinstance to use as a component's itemsClass<?>org.dom4j.ElementsetCollectionItems(CollectionContainer<?> collectionItems) Sets a collection container to be used as the component's items.setEnumItems(Class<?> enumItems) Sets the enum class to be used as the component's items.setItems(com.vaadin.flow.data.provider.DataProvider items) Sets theDataProviderinstance to be used as the component's items.setTargetClass(Class<?> targetClass) Sets a target class for which a component is created, using fluent API method.setValueSource(ValueSource valueSource) Sets a value source, using fluent API method.setXmlDescriptor(org.dom4j.Element xmlDescriptor) Sets an XML descriptor which contains additional information, using fluent API method.
-
Field Details
-
metaClass
-
property
-
valueSource
-
xmlDescriptor
protected org.dom4j.Element xmlDescriptor -
targetClass
-
items
protected com.vaadin.flow.data.provider.DataProvider items -
enumItems
-
collectionItems
-
-
Constructor Details
-
ComponentGenerationContext
Creates an instance of ComponentGenerationContext.- Parameters:
metaClass- the entity for which the component is createdproperty- the entity attribute for which the component is created
-
-
Method Details
-
getMetaClass
- Returns:
- the entity for which the component is created
-
getProperty
- Returns:
- the entity attribute for which the component is created
-
getValueSource
- Returns:
- a value source that can be used to create the component
-
setValueSource
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 theDataProviderinstance to use as a component's items- Returns:
- the
DataProviderinstance to use as a component's items
-
setItems
public ComponentGenerationContext setItems(@Nullable com.vaadin.flow.data.provider.DataProvider items) Sets theDataProviderinstance to be used as the component's items.- Parameters:
items- theDataProviderinstance to be set as items; can benull- Returns:
- this object
-
getEnumItems
Returns the enum class to be used as the component's items.- Returns:
- a
Classobject representing the enum items, ornullif not set
-
setEnumItems
Sets the enum class to be used as the component's items.- Parameters:
enumItems- theClassrepresenting the enum items; can benull- Returns:
- this object
-
getCollectionItems
Returns a collection container holding entity instances to be used as the component's items.- Returns:
- a
CollectionContainerinstance containing the collection of entities, ornullif not set.
-
setCollectionItems
public ComponentGenerationContext setCollectionItems(@Nullable CollectionContainer<?> collectionItems) Sets a collection container to be used as the component's items.- Parameters:
collectionItems- theCollectionContainerinstance containing the collection of entities; can benull- Returns:
- this object
-
getXmlDescriptor
@Nullable public org.dom4j.Element getXmlDescriptor()- Returns:
- an XML descriptor which contains additional information
-
setXmlDescriptor
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
- Returns:
- a target class for which a component is created
-
setTargetClass
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
-