Caplin Trader 4.7.1

Interface: module:caplin/menu/Model

module:caplin/menu/Model

The abstract class caplin.menu.Model represents an item that can be inserted into a menu with some default enable/disable functionality.
Implementations:

Members

(static) ACTION_EVENT :String

The name of the event that is emitted when an action is activated.
Type:
  • String
Implementations:

Methods

actionActivator()

This method will emit the action event.

The method will usually be called by a module:caplin/menu/control/ItemGenerator when it determines that the action of this item needs to be executed (on item click for instance).

getEventName() → {String}

Returns the string name if it exists, null if it doesn't.
Returns:
Type
String

getParent() → {module:caplin/menu/Model}

Returns the parent model if it exists, null if it doesn't.
Returns:
The parent model
Type
module:caplin/menu/Model

getType() → {String}

Returns the type in string format.
Returns:
Type
String

isEnabled() → {Boolean}

Returns true if the item is enabled, otherwise false.
Returns:
Type
Boolean

setEnabled(enabled)

Sets the enabled property. It then emits an 'enabled-changed' event in case the property has changed.
Parameters:
Name Type Description
enabled Boolean True if item is enabled false if it is not.

setParent(parent)

This method will be called by a menu each time an item gets inserted.
Parameters:
Name Type Description
parent module:caplin/menu/model/Menu The parent menu.

(inner) areAllNodesToRootEnabled() → {boolean}

Returns true if the model and its ancestors are enabled, otherwise false.
Returns:
Type
boolean