Interface
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.

The table below explains each possible option.

namedefaulttypedescription
typeString The type of this menu model.
eventNameString An event that will be triggered along with the 'action' event. This event will bubble up to the parents which will then trigger it along with the instance of the item.

Constructor Summary

Attributes Name and Description
caplin.menu.Model(Map options)

Method Summary

Attributes Name and Description
void actionActivator()

This method will emit the action event.

String getEventName()

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

caplin.menu.Model getParent()

Returns the parent model if it exists, null if it doesn't.

String getType()

Returns the type in string format.

Boolean isEnabled()

Returns true if the item is enabled and the parent is enabled, false if it is not.

void setEnabled(Boolean enabled)

Sets the enabled property.

void setParent(caplin.menu.model.Menu parent)

This method will be called by a menu each time an item gets inserted.

Constructor Detail

caplin.menu.Model(Map options)

Parameters
Map options A map of options.

Method Detail

void actionActivator()

This method will emit the action event.

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

String getEventName()

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

Returns
{String}

caplin.menu.Model getParent()

Returns the parent model if it exists, null if it doesn't.

Returns
{caplin.menu.Model} The parent model

String getType()

Returns the type in string format.

Returns
{String}

Boolean isEnabled()

Returns true if the item is enabled and the parent is enabled, false if it is not.

Returns
{Boolean}

void setEnabled(Boolean enabled)

Sets the enabled property. It then emits an 'enabled-changed' event in case the property has changed.

Parameters
Boolean enabled True if item is enabled false if it is not.

void setParent(caplin.menu.model.Menu parent)

This method will be called by a menu each time an item gets inserted.

Parameters
caplin.menu.model.Menu parent The parent menu.