Package io.jmix.pivottable.action.list
Class PivotScreenBuilder
java.lang.Object
io.jmix.pivottable.action.list.PivotScreenBuilder
@Component("ui_PivotScreenBuilder")
@Scope("prototype")
public class PivotScreenBuilder
extends Object
Prepares data and builds a screen with pivot table component.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AccessManagerprotected FetchPlanRepositoryprotected Messagesprotected MessageToolsprotected Metadataprotected MetadataToolsprotected Stringstatic final Stringprotected ListComponent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()protected FetchPlangetBaseFetchPlan(MetaClass metaClass) protected MetaClassgetEmbeddedIdMetaClass(MetaClass metaClass) getEmbeddedIdProperties(MetaClass metaClass) getPropertiesFromView(MetaClass metaClass, FetchPlan fetchPlan) protected MetaClassgetPropertyMetaClass(MetaProperty metaProperty) protected booleanhasEmbeddedId(MetaClass metaClass) protected booleanisByteArray(MetaProperty metaProperty) protected booleanisEmbeddedIdProperty(String property, MetaClass metaClass) protected booleanisIdProperty(String property, MetaClass metaClass) Checks if current MetaClass contains given id property.protected booleanisManagedProperty(MetaProperty metaProperty, MetaClass metaClass) protected booleanisPermitted(MetaClass metaClass, MetaProperty metaProperty) protected booleanisUuid(MetaProperty metaProperty) removeNonExistingProperties(List<String> properties, MetaClass metaClass, FetchPlan fetchPlan) protected voidsetAccessManager(AccessManager accessManager) protected voidsetFetchPlanRepository(FetchPlanRepository fetchPlanRepository) protected voidsetMessages(Messages messages) voidsetMessageTools(MessageTools messageTools) protected voidsetMetadata(Metadata metadata) voidsetMetadataTools(MetadataTools metadataTools) withAdditionalProperties(List<String> additionalProperties) Set properties which should be additionally included.withExcludedProperties(List<String> excludedProperties) Set excluded properties list using fluent API method.withIncludedProperties(List<String> includedProperties) Set included properties list using fluent API method.withItems(Collection<? extends Entity> items) Sets items that should be shown in PivotTable.withNativeJson(String nativeJson) Set native json using fluent API method.
-
Field Details
-
SCREEN_ID
- See Also:
-
metadata
-
metadataTools
-
fetchPlanRepository
-
messages
-
messageTools
-
accessManager
-
includedProperties
-
excludedProperties
-
additionalProperties
-
dataItems
-
nativeJson
-
target
-
-
Constructor Details
-
PivotScreenBuilder
-
-
Method Details
-
setMetadata
-
setFetchPlanRepository
-
setMessages
-
setAccessManager
-
setMetadataTools
-
setMessageTools
-
getIncludedProperties
- Returns:
- list of included properties
-
withIncludedProperties
Set included properties list using fluent API method. If included properties aren't set, all properties in the fetch plan will be shown, otherwise only included properties will be shown in the pivot table unlessShowPivotAction.setExcludedProperties(String)is not set.- Parameters:
includedProperties- list of included properties- Returns:
- current instance of action
-
getExcludedProperties
- Returns:
- list of excluded properties
-
withExcludedProperties
Set excluded properties list using fluent API method.
Note, if it is used withoutShowPivotAction.setExcludedProperties(String), excluded properties will be applied for all properties in the fetch plan.- Parameters:
excludedProperties- list of excluded properties- Returns:
- current instance
-
withAdditionalProperties
Set properties which should be additionally included. Additional property doesn't applied if excluded properties list contains it.- Parameters:
additionalProperties- list of additional properties- Returns:
- current instance of action
-
getAdditionalProperties
- Returns:
- list of additionally included properties
-
getNativeJson
- Returns:
- configuration json of pivot table
-
withNativeJson
Set native json using fluent API method. Using native json you can configure pivot table with initial values. For instance, for non-editable pivot table:
for editable pivot table:{ "cols": ["localized property", "localized property"], "rows": ["localized property"], "editable": false, "renderer": "heatmap", "aggregation": { "id": "d8fc3fdf-730d-c94f-a0c8-72a9ce3dcb3a", "mode": "sumOverSum", "properties": ["localized property", "localized property"] } }{ "cols": ["localized property"], "rows": ["localized property"], "editable": true, "renderers": { "selectedRenderer": "barChart" }, "autoSortUnusedProperties": true, "aggregationProperties": ["localized property", "localized property"], "aggregations": { "selectedAggregation": "count", "aggregations": [{ "id": "647780f0-c6d0-6ade-a63a-542b5c8cdbd5", "mode": "count", "caption": "Count" }, { "id": "c2663238-2654-67f0-2dec-add6962d867c", "mode": "sumOverSum" }] } }- Parameters:
nativeJson- configuration json of pivot table- Returns:
- current instance of action
-
withItems
Sets items that should be shown in PivotTable.- Parameters:
items- collection of entities- Returns:
- current instance
-
build
- Returns:
- created screen
-
getPropertiesWithLocale
-
isManagedProperty
-
isPermitted
-
isByteArray
-
isUuid
-
getPropertiesFromView
-
getBaseFetchPlan
-
getEmbeddedIdProperties
-
hasEmbeddedId
-
getEmbeddedIdMetaClass
-
removeNonExistingProperties
-
isIdProperty
Checks if current MetaClass contains given id property.- Parameters:
property- property to checkmetaClass- metaClass- Returns:
- true if MetaClass contains given id property
-
isEmbeddedIdProperty
-
getPropertyMetaClass
-