Expand all

ve.ui.TriggerRegistry

Extends

Constructor

new ve.ui.TriggerRegistry() #

Trigger registry.

Methods

getMessages(name) → {Array.<string>} #

Get trigger messages for a trigger by name

Parameters:

Name Type Description
name string

Symbolic name

Source:

Returns:

List of trigger messages

Type
Array.<string>
Get trigger messages for a trigger by name

getNameByTrigger(triggerString) → {string|undefined} #

Get trigger name from its string representation

Parameters:

Name Type Description
triggerString string

Normalized trigger string (generated by Trigger.toString)

Source:

Returns:

Trigger name, if found

Type
string | undefined
Get trigger name from its string representation

register(name, triggers) #

Register a constructor with the factory.

The only supported platforms are 'mac' and 'pc'. All platforms not identified as 'mac' will be considered to be 'pc', including 'win', 'linux', 'solaris', etc.

Parameters:

Name Type Description
name string | Array.<string>

Symbolic name or list of symbolic names. Will trigger a command with the same name.

triggers Array.<ve.ui.Trigger> | Object

Trigger object(s) or map of trigger object(s) keyed by platform name e.g. 'mac' or 'pc'

Source:

Throws:

  • Trigger must be an instance of ve.ui.Trigger

    Type
    Error
  • Incomplete trigger

    Type
    Error
Register a constructor with the factory.