AbstractMessageAction

Class

The abstract base class for MessageAction. To create a custom message action, extend from this class.

Implements

Constructors

new AbstractMessageAction(optionsMessageActionConstructorOptions): AbstractMessageAction
Parameters
ParameterType
options
MessageActionConstructorOptions
Returns 
AbstractMessageAction

Properties

PropertyTypeNotes
string

The unique id of the action. For actions provided by a widget, the id is: widgetId + actionName.

string

The action label. To support i18n, use _action_${actionName} as the string key.

string

The action name.

string

The widget id that provides the action. If a widget id is not provided, the action is provided by the Jimu framework.

id

Class Property
id: string

The unique id of the action. For actions provided by a widget, the id is: widgetId + actionName.

label

Class Property
label: string

The action label. To support i18n, use _action_${actionName} as the string key.

name

optional
Class Property
name: string

The action name.

widgetId

optional
Class Property
widgetId: string

The widget id that provides the action. If a widget id is not provided, the action is provided by the Jimu framework.

Methods

MethodReturnsNotes
void

When a widget is removed, actions provided by this widget will be destroyed.

filterMessage(message)
boolean

This indicates whether a specific message can trigger the filter message action. This method is used to filter messages in the message manager.

filterMessageDescription(messageDescription)
boolean

This indicates whether or not the type of message can trigger the filter message action. This method is used in builder to filter the available actions.

onExecute(message, actionConfig?)
boolean | Promise<boolean>

The execution of the action when the message is matched.

onRemoveListen(messageType, messageWidgetId?)
void

When an action is removed from a message's listener, this function will be invoked.

destroy

Class Method
destroy(): void

When a widget is removed, actions provided by this widget will be destroyed.

Returns 
void

filterMessage

abstract
Class Method
filterMessage(messageMessage): boolean

This indicates whether a specific message can trigger the filter message action. This method is used to filter messages in the message manager.

Parameters
ParameterType
message
Message
Returns 
boolean

filterMessageDescription

abstract
Class Method
filterMessageDescription(messageDescriptionMessageDescription): boolean

This indicates whether or not the type of message can trigger the filter message action. This method is used in builder to filter the available actions.

Parameters
ParameterType
messageDescription
MessageDescription
Returns 
boolean

onExecute

abstract
Class Method
onExecute(messageMessage, actionConfig?any): boolean | Promise<boolean>

The execution of the action when the message is matched.

Parameters
ParameterType
message
Message
actionConfig
any
Returns 
boolean | Promise<boolean>

onRemoveListen

Class Method
onRemoveListen(messageTypeMessageType, messageWidgetId?string): void

When an action is removed from a message's listener, this function will be invoked.

Parameters
ParameterType
messageType
MessageType
messageWidgetId
string
Returns 
void

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.