@StudioAction(category="List Actions", description="Exports a list of entities to XLS file") @ActionType(value="excel") public class ExcelAction extends ListAction implements Action.ExecutableAction
Should be defined for a list component (Table
, DataGrid
, etc.) in a screen XML descriptor.
BaseAction.EnabledRule
Action.ActionPerformedEvent, Action.AdjustWhenScreenReadOnly, Action.BeforeActionPerformedHandler, Action.DisabledWhenScreenReadOnly, Action.ExecutableAction, Action.HasBeforeActionPerformedHandler, Action.HasOpenType, Action.HasPrimaryState, Action.HasSecurityConstraint, Action.HasTarget, Action.SecuredAction, Action.Status
Modifier and Type | Field and Description |
---|---|
protected BeanLocator |
beanLocator |
protected boolean |
exportAggregation
If true and table is aggregatable will export aggregation row to excel document.
|
protected ExcelExportFormat |
exportFormat
Excel format used for export: xls or xlsx.
|
protected java.lang.String |
fileName |
static java.lang.String |
ID |
protected Messages |
messages |
target
caption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visible
PROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE
Constructor and Description |
---|
ExcelAction() |
ExcelAction(java.lang.String id) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerform(Component component)
Invoked by owning component to execute the action.
|
void |
execute()
Executes the action.
|
protected void |
export(ExcelExporter.ExportMode exportMode)
Export via
ExcelExporter . |
ExcelExportFormat |
getExportFormat() |
java.lang.String |
getFileName() |
boolean |
isExportAggregation() |
protected boolean |
needExportAll() |
protected void |
setBeanLocator(BeanLocator beanLocator) |
void |
setExportAggregation(boolean exportAggregation) |
void |
setExportFormat(ExcelExportFormat exportFormat) |
void |
setFileName(java.lang.String fileName) |
protected void |
setIcons(Icons icons) |
protected void |
setMessages(Messages messages) |
getTarget, setTarget, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcut
addActionPerformedListener, addEnabledRule, isApplicable, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternal
addOwner, addPropertyChangeListener, firePropertyChange, getCaption, getDefaultCaption, getDescription, getEventHub, getIcon, getId, getOwner, getOwners, getShortcutCombination, hasSubscriptions, isEnabled, isPrimary, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setIconFromSet, setPrimary, setShortcut, setShortcutCombination
clone, equals, finalize, 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 ID
protected Messages messages
protected BeanLocator beanLocator
protected java.lang.String fileName
protected boolean exportAggregation
protected ExcelExportFormat exportFormat
ClientConfig.getDefaultExcelExportFormat()
public ExcelAction()
public ExcelAction(java.lang.String id)
@Inject protected void setIcons(Icons icons)
@Inject protected void setMessages(Messages messages)
@Inject protected void setBeanLocator(BeanLocator beanLocator)
public void actionPerform(Component component)
Action
actionPerform
in interface Action
actionPerform
in class BaseAction
component
- invoking componentpublic void execute()
execute
in interface Action.ExecutableAction
protected boolean needExportAll()
public boolean isExportAggregation()
@StudioPropertiesItem(defaultValue="true") public void setExportAggregation(boolean exportAggregation)
public java.lang.String getFileName()
@StudioPropertiesItem public void setFileName(java.lang.String fileName)
public ExcelExportFormat getExportFormat()
@StudioPropertiesItem(defaultValue="DEFAULT") public void setExportFormat(ExcelExportFormat exportFormat)
protected void export(ExcelExporter.ExportMode exportMode)
ExcelExporter
.