@Component(value="cuba_ExcelAction") @Scope(value="prototype") public class ExcelAction extends BaseAction implements Action.HasBeforeActionPerformedHandler
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="cuba_ExcelAction" class="com.company.sample.gui.MyExcelAction" scope="prototype"/>Also, use
create()
static methods instead of constructors when creating the action programmatically.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 |
---|---|
static java.lang.String |
ACTION_ID |
protected Action.BeforeActionPerformedHandler |
beforeActionPerformedHandler |
protected ExportDisplay |
display |
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 |
protected ListComponent |
listComponent |
protected Messages |
messages |
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(ListComponent listComponent)
The simplest constructor.
|
ExcelAction(ListComponent listComponent,
ExportDisplay display)
Constructor that allows to specify the ExportDisplay implementation.
|
ExcelAction(ListComponent listComponent,
ExportDisplay display,
java.lang.String id)
Constructor that allows to specify all parameters.
|
ExcelAction(Table table)
The simplest constructor.
|
ExcelAction(Table table,
ExportDisplay display)
Constructor that allows to specify the ExportDisplay implementation.
|
ExcelAction(Table table,
ExportDisplay display,
java.lang.String id)
Constructor that allows to specify all parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerform(Component component)
This method is invoked by action owner component.
|
static ExcelAction |
create(ListComponent target)
Creates an action with default id.
|
static ExcelAction |
create(ListComponent target,
ExportDisplay display)
Creates an action with default id.
|
static ExcelAction |
create(ListComponent target,
ExportDisplay display,
java.lang.String id)
Creates an action with the given id.
|
protected void |
export(ExcelExporter.ExportMode exportMode)
Export via
ExcelExporter . |
Action.BeforeActionPerformedHandler |
getBeforeActionPerformedHandler() |
ExcelExportFormat |
getExportFormatType() |
java.lang.String |
getFileName() |
boolean |
isExportAggregation() |
void |
setBeforeActionPerformedHandler(Action.BeforeActionPerformedHandler handler) |
void |
setExportAggregation(boolean exportAggregation) |
void |
setExportFormatType(ExcelExportFormat exportFormat) |
void |
setFileName(java.lang.String fileName) |
addActionPerformedListener, addEnabledRule, isApplicable, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternal, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcut
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 ACTION_ID
protected final ListComponent listComponent
protected final ExportDisplay display
protected java.lang.String fileName
protected Action.BeforeActionPerformedHandler beforeActionPerformedHandler
protected Messages messages
protected boolean exportAggregation
protected ExcelExportFormat exportFormat
ClientConfig.getDefaultExcelExportFormat()
public ExcelAction(Table table)
table
- table containing this actionpublic ExcelAction(Table table, ExportDisplay display)
table
- table containing this actiondisplay
- ExportDisplay implementationpublic ExcelAction(Table table, ExportDisplay display, java.lang.String id)
table
- table containing this actiondisplay
- ExportDisplay implementation
ExcelExporter
id
- action's namepublic ExcelAction(ListComponent listComponent)
listComponent
- listComponent containing this actionpublic ExcelAction(ListComponent listComponent, ExportDisplay display)
listComponent
- listComponent containing this actiondisplay
- ExportDisplay implementationpublic ExcelAction(ListComponent listComponent, ExportDisplay display, java.lang.String id)
listComponent
- listComponent containing this actiondisplay
- ExportDisplay implementation
ExcelExporter
id
- action's namepublic static ExcelAction create(ListComponent target)
target
- component containing this actionpublic static ExcelAction create(ListComponent target, ExportDisplay display)
target
- component containing this actiondisplay
- ExportDisplay implementationpublic static ExcelAction create(ListComponent target, ExportDisplay display, java.lang.String id)
target
- component containing this actiondisplay
- ExportDisplay implementationid
- action's namepublic java.lang.String getFileName()
public void setFileName(java.lang.String fileName)
fileName
- excel file name without extensionpublic void actionPerform(Component component)
actionPerform
in interface Action
actionPerform
in class BaseAction
component
- component invoking actionprotected void export(ExcelExporter.ExportMode exportMode)
ExcelExporter
.public Action.BeforeActionPerformedHandler getBeforeActionPerformedHandler()
getBeforeActionPerformedHandler
in interface Action.HasBeforeActionPerformedHandler
public void setBeforeActionPerformedHandler(Action.BeforeActionPerformedHandler handler)
setBeforeActionPerformedHandler
in interface Action.HasBeforeActionPerformedHandler
public boolean isExportAggregation()
public void setExportAggregation(boolean exportAggregation)
public ExcelExportFormat getExportFormatType()
public void setExportFormatType(ExcelExportFormat exportFormat)