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.
name | default | type | description |
---|---|---|---|
type | String | The type of this menu model. | |
eventName | String | 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. |
Attributes | Name and Description |
---|---|
|
caplin.menu.Model(Map options)
|
Attributes | Name and Description |
---|---|
|
void
actionActivator()
This method will emit the |
|
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. |
►
caplin.menu.Model(Map options)
Map | options | A map of options. |
►
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.
►
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. It then emits an 'enabled-changed' event in case the property has changed.
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.
caplin.menu.model.Menu | parent | The parent menu. |