Package io.jmix.gridexportflowui.action
Class ExportAction
java.lang.Object
io.jmix.flowui.kit.action.AbstractAction
io.jmix.flowui.kit.action.BaseAction
io.jmix.flowui.action.SecuredBaseAction
io.jmix.flowui.action.list.ListDataComponentAction<ExportAction,Object>
io.jmix.gridexportflowui.action.ExportAction
- All Implemented Interfaces:
ExecutableAction
,SecuredAction
,TargetAction<ListDataComponent<Object>>
,Action
,HasShortcutCombination
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
ExcelExportAction
,JsonExportAction
@ActionType("grdexp_export")
public class ExportAction
extends ListDataComponentAction<ExportAction,Object>
implements org.springframework.context.ApplicationContextAware
Base action for export table content with defined exporter.
dataGridExporter
is required for this action
Should be defined for a list component (Table
, DataGrid
, etc.).
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.action.SecuredBaseAction
SecuredBaseAction.EnabledRule
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected DataGridExporter
protected Dialogs
protected Downloader
static final String
protected Messages
Fields inherited from class io.jmix.flowui.action.list.ListDataComponentAction
selectionListenerRegistration, target
Fields inherited from class io.jmix.flowui.action.SecuredBaseAction
enabledByUiPermissions, enabledRules, visibleByUiPermissions
Fields inherited from class io.jmix.flowui.kit.action.BaseAction
enabledExplicitly, visibleExplicitly
Fields inherited from class io.jmix.flowui.kit.action.AbstractAction
description, enabled, eventBus, icon, id, shortcutCombination, text, variant, visible
Fields inherited from interface io.jmix.flowui.kit.action.Action
PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT_COMBINATION, PROP_TEXT, PROP_VARIANT, PROP_VISIBLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addColumnValueProvider
(String columnId, Function<DataGridExporter.ColumnValueContext, Object> columnValueProvider) Adds a function to get value from the column.protected Action
protected Action
protected Action
protected void
doExport
(ExportMode exportMode) void
execute()
Executes theAction
getColumnValueProvider
(String columnId) protected String
getMessage
(String id) protected boolean
isDataLoaderExist
(ListDataComponent<?> target) void
removeColumnValueProvider
(String columnId) Removes an column value provider function by column id.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setDataGridExporter
(DataGridExporter dataGridExporter) Sets the dataGrid exporter instancevoid
setDialogs
(Dialogs dialogs) void
setDownloader
(Downloader downloader) void
setMessages
(Messages messages) <T> T
withExporter
(Class<T> exporterClass) Methods inherited from class io.jmix.flowui.action.list.ListDataComponentAction
actionPerform, attachSelectionListener, checkTarget, checkTargetItems, getTarget, initAction, onSelectionChange, setTarget, withEnabled, withEnabledByUiPermissions, withHandler, withIcon, withIcon, withShortcutCombination, withTarget, withText, withTitle, withVariant, withVisible, withVisibleByUiPermissions
Methods inherited from class io.jmix.flowui.action.SecuredBaseAction
addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabledByUiPermissions, setVisibleByUiPermissions
Methods inherited from class io.jmix.flowui.kit.action.BaseAction
addActionPerformedListener, isApplicable, setEnabled, setEnabledInternal, setVisible, setVisibleInternal
Methods inherited from class io.jmix.flowui.kit.action.AbstractAction
addPropertyChangeListener, firePropertyChange, getDescription, getEventBus, getIcon, getId, getShortcutCombination, getText, getVariant, hasListener, isEnabled, isVisible, setDescription, setIcon, setShortcutCombination, setText, setVariant
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.flowui.kit.action.Action
addPropertyChangeListener, getDescription, getIcon, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setText, setVariant, setVisible
Methods inherited from interface io.jmix.flowui.kit.component.HasShortcutCombination
getShortcutCombination, setShortcutCombination
-
Field Details
-
ID
- See Also:
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
messages
-
downloader
-
dialogs
-
dataGridExporter
-
-
Constructor Details
-
ExportAction
public ExportAction() -
ExportAction
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
setMessages
-
setDownloader
-
setDialogs
-
setDataGridExporter
Sets the dataGrid exporter instance -
withExporter
-
addColumnValueProvider
public void addColumnValueProvider(String columnId, Function<DataGridExporter.ColumnValueContext, Object> columnValueProvider) Adds a function to get value from the column.- Parameters:
columnId
- column idcolumnValueProvider
- column value provider function
-
removeColumnValueProvider
Removes an column value provider function by column id.- Parameters:
columnId
- column id
-
getColumnValueProvider
@Nullable public Function<DataGridExporter.ColumnValueContext,Object> getColumnValueProvider(String columnId) - Parameters:
columnId
- column id- Returns:
- column value provider function for the column id
-
execute
public void execute()Description copied from interface:ExecutableAction
Executes theAction
- Specified by:
execute
in interfaceExecutableAction
-
doExport
-
getMessage
-
createExportSelectedAction
-
createExportAllAction
-
createCurrentPageAction
-
isDataLoaderExist
-