Caplin Trader 4.7.1

Class: module:caplin/menu/presenter/node/Menu

module:caplin/menu/presenter/node/Menu

A PresentationNode which will serve as the control node for the module:caplin/menu/presenter/Control.

The caplin.menu.presenter.node.Menu uses any implementation of module:caplin/menu/model/Item as the model to render the menu. If you have chosen to implement your own menu and control (see module:caplin/menu/Control), you can provide your own model in the constructor. If you do not do so, a standard module:caplin/menu/model/Menu will be created which can then be retrieved using module:caplin/menu/presenter/node/Menu#getMenuModel.

Constructor

new module:caplin/menu/presenter/node/Menu(model)

Constructs a new instance of PresentationNode.
Parameters:
Name Type Description
model module:caplin/menu/model/Item The model used for the by the control to render the menu.

Methods

addGenerator(generator, type)

Allows the user to add custom generators into the caplin.menu.Control. See module:caplin/menu/Control#addGenerator for more details.
Parameters:
Name Type Description
generator module:caplin/menu/Generator Generator class which will render elements of the given type.
type String String representation of the item type the control registered will be in charge of rendering.

getGenerators()

Returns a map with the types as the keys and the generator instances as the values.

getMenuModel()

Returns the model.

hide()

Informs the control to hide the menu.

isVisible()

Returns the value of the visible property.

setMenuModel()

Sets the model.

show()

Informs the control to show the menu.