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
Modifier and TypeFieldDescriptionprotected AccessManager
protected FetchPlanRepository
protected Messages
protected MessageTools
protected Metadata
protected MetadataTools
protected String
static final String
protected ListComponent
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
protected FetchPlan
getBaseFetchPlan
(MetaClass metaClass) protected MetaClass
getEmbeddedIdMetaClass
(MetaClass metaClass) getEmbeddedIdProperties
(MetaClass metaClass) getPropertiesFromView
(MetaClass metaClass, FetchPlan fetchPlan) protected MetaClass
getPropertyMetaClass
(MetaProperty metaProperty) protected boolean
hasEmbeddedId
(MetaClass metaClass) protected boolean
isByteArray
(MetaProperty metaProperty) protected boolean
isEmbeddedIdProperty
(String property, MetaClass metaClass) protected boolean
isIdProperty
(String property, MetaClass metaClass) Checks if current MetaClass contains given id property.protected boolean
isManagedProperty
(MetaProperty metaProperty, MetaClass metaClass) protected boolean
isPermitted
(MetaClass metaClass, MetaProperty metaProperty) protected boolean
isUuid
(MetaProperty metaProperty) removeNonExistingProperties
(List<String> properties, MetaClass metaClass, FetchPlan fetchPlan) protected void
setAccessManager
(AccessManager accessManager) protected void
setFetchPlanRepository
(FetchPlanRepository fetchPlanRepository) protected void
setMessages
(Messages messages) void
setMessageTools
(MessageTools messageTools) protected void
setMetadata
(Metadata metadata) void
setMetadataTools
(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:{ "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
-