@Component(value="cuba_RefreshAction") @Scope(value="prototype") public class RefreshAction extends BaseAction
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_RefreshAction" class="com.company.sample.gui.MyRefreshAction" scope="prototype"/>Also, use
create()
static methods instead of constructors when creating the action programmatically.BaseAction.EnabledRule
Action.ActionPerformedEvent, Action.BeforeActionPerformedHandler, Action.HasBeforeActionPerformedHandler, Action.HasOpenType, Action.HasSecurityConstraint, Action.HasTarget, Action.SecuredAction, Action.Status
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_ID |
protected java.lang.Runnable |
afterRefreshHandler |
protected java.lang.Runnable |
beforeRefreshHandler |
protected ListComponent |
owner |
protected java.util.Map<java.lang.String,java.lang.Object> |
refreshParams |
protected java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> |
refreshParamsSupplier |
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 |
---|
RefreshAction(ListComponent target)
The simplest constructor.
|
RefreshAction(ListComponent target,
java.lang.String id)
Constructor that allows to specify action's name.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerform(Component component)
This method is invoked by action owner component.
|
static RefreshAction |
create(ListComponent target)
Creates an action with default id.
|
static RefreshAction |
create(ListComponent target,
java.lang.String id)
Creates an action with the given id.
|
java.lang.Runnable |
getAfterRefreshHandler() |
java.lang.Runnable |
getBeforeRefreshHandler() |
java.util.Map<java.lang.String,java.lang.Object> |
getRefreshParams() |
java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> |
getRefreshParamsSupplier() |
void |
setAfterRefreshHandler(java.lang.Runnable afterRefreshHandler) |
void |
setBeforeRefreshHandler(java.lang.Runnable beforeRefreshHandler) |
void |
setRefreshParams(java.util.Map<java.lang.String,java.lang.Object> refreshParams) |
void |
setRefreshParamsSupplier(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> refreshParamsSupplier) |
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, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setIconFromSet, setShortcut, setShortcutCombination
public static final java.lang.String ACTION_ID
protected ListComponent owner
protected java.util.Map<java.lang.String,java.lang.Object> refreshParams
protected java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> refreshParamsSupplier
protected java.lang.Runnable beforeRefreshHandler
protected java.lang.Runnable afterRefreshHandler
public RefreshAction(ListComponent target)
target
- component containing this actionpublic RefreshAction(ListComponent target, java.lang.String id)
target
- component containing this actionid
- action's identifierpublic static RefreshAction create(ListComponent target)
target
- component containing this actionpublic static RefreshAction create(ListComponent target, java.lang.String id)
target
- component containing this actionpublic void actionPerform(Component component)
actionPerform
in interface Action
actionPerform
in class BaseAction
component
- component invoking actionpublic java.util.Map<java.lang.String,java.lang.Object> getRefreshParams()
CollectionDatasource.refresh(java.util.Map)
methodpublic void setRefreshParams(java.util.Map<java.lang.String,java.lang.Object> refreshParams)
refreshParams
- parameters for CollectionDatasource.refresh(java.util.Map)
methodpublic java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> getRefreshParamsSupplier()
CollectionDatasource.refresh(java.util.Map)
methodpublic void setRefreshParamsSupplier(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> refreshParamsSupplier)
refreshParamsSupplier
- supplier that provides parameters for CollectionDatasource.refresh(java.util.Map)
methodpublic java.lang.Runnable getBeforeRefreshHandler()
public void setBeforeRefreshHandler(java.lang.Runnable beforeRefreshHandler)
public java.lang.Runnable getAfterRefreshHandler()
public void setAfterRefreshHandler(java.lang.Runnable afterRefreshHandler)