@Component(value="charts_ShowPivotAction")
@Scope(value="prototype")
public class ShowPivotAction
extends com.haulmont.cuba.gui.components.actions.BaseAction
implements com.haulmont.cuba.gui.components.Action.HasBeforeActionPerformedHandler
ListComponent
and shows them in new screen with pivot table component.
Action's behaviour can be customized by providing arguments to constructor or setting properties.
In order to provide your own implementation globally, create a subclass and register it in web-spring.xml
,
for example:
<bean id="charts_ShowPivotAction" class="com.company.sample.gui.MyShowPivotAction" scope="prototype"/>Also, use
create()
static methods instead of constructors when creating the action programmatically.com.haulmont.cuba.gui.components.actions.BaseAction.EnabledRule
com.haulmont.cuba.gui.components.Action.ActionPerformedEvent, com.haulmont.cuba.gui.components.Action.BeforeActionPerformedHandler, com.haulmont.cuba.gui.components.Action.HasBeforeActionPerformedHandler, com.haulmont.cuba.gui.components.Action.HasOpenType, com.haulmont.cuba.gui.components.Action.HasSecurityConstraint, com.haulmont.cuba.gui.components.Action.HasTarget, com.haulmont.cuba.gui.components.Action.Status, com.haulmont.cuba.gui.components.Action.UiPermissionAware
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_ID |
static java.lang.String |
NAME |
static java.lang.String |
SCREEN_ID |
Constructor and Description |
---|
ShowPivotAction(com.haulmont.cuba.gui.components.ListComponent target)
The simplest constructor.
|
ShowPivotAction(com.haulmont.cuba.gui.components.ListComponent target,
java.lang.String id)
Constructor allows to specify action's name.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerform(com.haulmont.cuba.gui.components.Component component) |
static ShowPivotAction |
create(com.haulmont.cuba.gui.components.ListComponent target)
Creates an action with default id.
|
static ShowPivotAction |
create(com.haulmont.cuba.gui.components.ListComponent target,
java.lang.String id)
Creates an action with specified id.
|
java.util.List<java.lang.String> |
getAdditinalProperties()
Deprecated.
will be removed in 7.0
|
java.util.List<java.lang.String> |
getAdditionalProperties() |
com.haulmont.cuba.gui.components.Action.BeforeActionPerformedHandler |
getBeforeActionPerformedHandler() |
java.util.List<java.lang.String> |
getExcludedProperties() |
java.util.List<java.lang.String> |
getIncludedProperties() |
java.lang.String |
getNativeJson() |
void |
setBeforeActionPerformedHandler(com.haulmont.cuba.gui.components.Action.BeforeActionPerformedHandler handler) |
ShowPivotAction |
withAdditionalProperties(java.util.List<java.lang.String> additionalProperties)
Set properties which should be additionally included.
|
ShowPivotAction |
withExcludedProperties(java.util.List<java.lang.String> excludedProperties)
Set excluded properties list using fluent API method.
|
ShowPivotAction |
withIncludedProperties(java.util.List<java.lang.String> includedProperties)
Set included properties list using fluent API method.
|
ShowPivotAction |
withNativeJson(java.lang.String nativeJson)
Set native json using fluent API method.
|
addEnabledRule, getTarget, isEnabledByUiPermissions, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setTarget, setVisible, setVisibleByUiPermissions, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcut
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isPrimary, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setIconFromSet, setPrimary, setShortcut, setShortcutCombination
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, refreshState, removeOwner, removePropertyChangeListener, setCaption, setDescription, setEnabled, setIcon, setIconFromSet, setShortcut, setShortcutCombination, setVisible
public static final java.lang.String NAME
public static final java.lang.String ACTION_ID
public static final java.lang.String SCREEN_ID
public ShowPivotAction(com.haulmont.cuba.gui.components.ListComponent target)
target
- component containing data to exportpublic ShowPivotAction(com.haulmont.cuba.gui.components.ListComponent target, java.lang.String id)
target
- component containing data to exportid
- action's namepublic static ShowPivotAction create(com.haulmont.cuba.gui.components.ListComponent target)
target
- component containing data to exportpublic static ShowPivotAction create(com.haulmont.cuba.gui.components.ListComponent target, java.lang.String id)
target
- component containing data to exportid
- action's idpublic void actionPerform(com.haulmont.cuba.gui.components.Component component)
actionPerform
in interface com.haulmont.cuba.gui.components.Action
actionPerform
in class com.haulmont.cuba.gui.components.actions.BaseAction
public java.util.List<java.lang.String> getIncludedProperties()
public ShowPivotAction withIncludedProperties(java.util.List<java.lang.String> includedProperties)
withExcludedProperties(List)
is not set.includedProperties
- list of included propertiespublic java.util.List<java.lang.String> getExcludedProperties()
public ShowPivotAction withExcludedProperties(java.util.List<java.lang.String> excludedProperties)
withIncludedProperties(List)
, excluded properties will be
applied for all properties in the view.excludedProperties
- list of excluded propertiespublic ShowPivotAction withAdditionalProperties(java.util.List<java.lang.String> additionalProperties)
additionalProperties
- list of additional propertiespublic java.util.List<java.lang.String> getAdditionalProperties()
@Deprecated public java.util.List<java.lang.String> getAdditinalProperties()
getAdditionalProperties()
public java.lang.String getNativeJson()
public ShowPivotAction withNativeJson(java.lang.String nativeJson)
{
"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"]
}
}
for editable pivot table:
{
"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"
}]
}
}
nativeJson
- configuration json of pivot tablepublic com.haulmont.cuba.gui.components.Action.BeforeActionPerformedHandler getBeforeActionPerformedHandler()
getBeforeActionPerformedHandler
in interface com.haulmont.cuba.gui.components.Action.HasBeforeActionPerformedHandler
public void setBeforeActionPerformedHandler(com.haulmont.cuba.gui.components.Action.BeforeActionPerformedHandler handler)
setBeforeActionPerformedHandler
in interface com.haulmont.cuba.gui.components.Action.HasBeforeActionPerformedHandler