|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.riotfamily.riot.list.command.core.AbstractCommand
public abstract class AbstractCommand
Abstract base class for commands.
| Field Summary | |
|---|---|
protected RiotLog |
log
|
| Constructor Summary | |
|---|---|
AbstractCommand()
|
|
| Method Summary | |
|---|---|
String |
getAction()
Returns the command's id. |
String |
getConfirmationMessage(CommandContext context)
Returns a localized message that is displayed to the user asking for a confirmation. |
protected Object[] |
getDefaultMessageArgs(CommandContext context)
|
String |
getId()
Returns a unique identifier used to reference the command. |
String |
getItemStyleClass(CommandContext context)
Returns a CSS class that is added to the list of class names of the whole item/row. The default implementation always returns null. |
String |
getLabel(MessageResolver messageResolver)
|
protected RiotRuntime |
getRuntime()
|
String |
getStyleClass()
Returns the CSS class that is assigned to command's HTML element and therefore defines which icon is displayed. If no class is set, the default implementation will return the action instead. |
boolean |
isEnabled(CommandContext context)
Implementors may inspect the given context to decide whether the command should be enabled. The default implementation always returns true. |
boolean |
isShowOnForm()
Returns whether the command should be shown beside the form. |
void |
setBeanName(String beanName)
Implementation of the BeanNameAware
interface. |
void |
setId(String id)
Sets the commandId. |
void |
setRiotRuntime(RiotRuntime runtime)
Implementation of the RiotRuntimeAware interface. |
void |
setShowOnForm(boolean showOnForm)
|
void |
setStyleClass(String styleClass)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.riotfamily.riot.list.command.Command |
|---|
execute |
| Field Detail |
|---|
protected RiotLog log
| Constructor Detail |
|---|
public AbstractCommand()
| Method Detail |
|---|
public String getId()
getId in interface Commandpublic void setId(String id)
setId in interface CommandsetBeanName(String)public void setBeanName(String beanName)
BeanNameAware
interface. If no command id is explicitly set, the bean name will be
used instead. Note that if the name ends with the suffix "Command"
it will be removed from the id.
setBeanName in interface BeanNameAwarepublic void setRiotRuntime(RiotRuntime runtime)
RiotRuntimeAware interface. Allows
subclasses to call #getRiotServletPrefix().
setRiotRuntime in interface RiotRuntimeAwareprotected RiotRuntime getRuntime()
public String getConfirmationMessage(CommandContext context)
Commandnull if no
confirmation is needed. Otherwise a dialog containing an Ok and a
Cancel button is displayed. If the user clicks Ok
the command is executed otherwise no action takes place.
getConfirmationMessage in interface Commandprotected Object[] getDefaultMessageArgs(CommandContext context)
public boolean isShowOnForm()
isShowOnForm in interface Commandpublic void setShowOnForm(boolean showOnForm)
public String getAction()
getAction in interface Commandpublic String getLabel(MessageResolver messageResolver)
getLabel in interface Commandpublic void setStyleClass(String styleClass)
public String getStyleClass()
getStyleClass in interface Commandpublic String getItemStyleClass(CommandContext context)
null. Subclasses may override this method to highlight
a list item depending on the context.
The default implementation always returns null.
getItemStyleClass in interface Commandpublic boolean isEnabled(CommandContext context)
policy since
commands will be automatically disabled if the action returned by
Command.getAction() is denied.
The default implementation always returns true.
isEnabled in interface Command
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||