MenuItem¶
Definition¶
Extends¶
Extended By¶
None
Description¶
A custom menu item. Can implement AmiScript and take on the following modes: enabled, disabled, invisible, and divider.
Method Summary¶
| Owner | Name | Return Type | Description |
|---|---|---|---|
| MenuItem | addItem(position, menuId, display, bold, italic, underline, status, icon, callback) | MenuItem | Adds a transient menu item as a child of this menu item. Note the varname will be prefixed with the transient prefix(default is TRANSIENT_). Example: myMenuItem.addItem(0, "test_menu", "\"Test Menu\"" ,true,true,true,"\"enabled\"", null,"session.alert("test");"); |
| MenuItem | addItem(position, menuId, display, status, callback) | MenuItem | Adds a transient menu item as a child of this menu item. Note the varname will be prefixed with the transient prefix(default is TRANSIENT_) |
| DashboardResource | commit() | Object | Commits transient changes, promoting overrides to persisted values. If transient, makes permanent. |
| DashboardResource | getCallback(callbackName) | Callback | Returns a callback by name |
| DashboardResource | getCallbackNames() | List | Returns the callback names defined for this dashboard resource. Use session.getDevTools().getCallbackEditor(resource, callbackName) to edit one, and call editor.open() when you want to show the UI. |
| DashboardResource | getCallbacks() | Map | Returns a map of all callback definitions. |
| DashboardResource | getChildren() | List | Returns a list of the child dashboard resources. |
| Object | getClassName() | String | Returns the string name of this object's class type. |
| DashboardResource | getDRI() | String | Returns the Dashboard Resource Indicator (DRI) as a string. DRI is the unique identifier of an object within the entire dashboard. |
| DashboardResource | getDashboardResourceType() | String | Returns the Dashboard Resource Type as a string |
| DashboardResource | getFormula(formulaName) | Formula | Returns a Formula given the formula name. |
| DashboardResource | getFormulaNames() | Set | Returns a set of the names of all formulas for this object. |
| DashboardResource | getFormulas() | Map | Returns a map of all available formulas for this object. The key is the formula name. |
| MenuItem | getId() | String | Returns the id of the menu. |
| DashboardResource | getLRI() | String | Returns the Localized Resource Indicator (LRI) as a string. LRI is the unique identifier of this resource with the parent element. |
| DashboardResource | getOwner() | DashboardResource | Returns the DashboardResource that owns this object. |
| MenuItem | getPanel() | Panel | Returns the underlying panel.. |
| MenuItem | getParentMenuItem() | MenuItem | Returns the parent menu item, or null if this is the root. |
| MenuItem | getPosition() | Integer | Returns the position of this menu item |
| MenuItem | getSubMenuItems() | List | Returns a list of child menu items. |
| DashboardResource | invokeCallback(callbackName, args) | Object | Executes the specified callback definition and returns the result from the callback. |
| MenuItem | isBold() | null | Returns true if the menu item font is Bold, false otherwise. |
| MenuItem | isItalic() | null | Returns true if the menu item font is Italic, false otherwise. |
| DashboardResource | isTransient() | Boolean | Returns true if this is transient, false otherwise. Transient objects are not saved to the layout. |
| MenuItem | isUnderline() | null | Returns true if the menu item font is Underline, false otherwise. |
| MenuItem | setBold(isBold) | Boolean | Make the menu label font Bold. |
| MenuItem | setItalic(isItalic) | Boolean | Make the menu label font Italic. |
| MenuItem | setUnderline(isUnderline) | Boolean | Make the menu label font Underline. |
| Object | toJson() | String | Returns a string of a json representation of this object. |
Method Definitions¶
addItem(position,menuId,display,bold,italic,underline,status,icon,callback)¶
MenuItem MenuItem::addItem(Integer position, String menuId, String display, Boolean bold, Boolean italic, Boolean underline, String status, String icon, String callback)
Description¶
Adds a transient menu item as a child of this menu item. Note the varname will be prefixed with the transient prefix(default is TRANSIENT_).
Example: myMenuItem.addItem(0, "test_menu", "\"Test Menu\"" ,true,true,true,"\"enabled\"", null,"session.alert("test");");
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| position | Integer | position of the transient menu item |
| menuId | String | menu Id |
| display | String | |
| bold | Boolean | |
| italic | Boolean | |
| underline | Boolean | |
| status | String | status("enabled"/"disabled"/"invisible"/"divider") |
| icon | String | menu icon formula |
| callback | String | Amiscript callback to be executed on selected |
addItem(position,menuId,display,status,callback)¶
MenuItem MenuItem::addItem(Integer position, String menuId, String display, String status, String callback)
Description¶
Adds a transient menu item as a child of this menu item. Note the varname will be prefixed with the transient prefix(default is TRANSIENT_)
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| position | Integer | position of the transient menu item |
| menuId | String | menu Id |
| display | String | |
| status | String | status("enabled"/"disabled"/"invisible"/"divider") |
| callback | String | Amiscript callback to be executed on selected |
commit()¶
Object DashboardResource::commit()
Description¶
Commits transient changes, promoting overrides to persisted values. If transient, makes permanent.
getCallback(callbackName)¶
Callback DashboardResource::getCallback(String callbackName)
Description¶
Returns a callback by name
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| callbackName | String | method name of callback |
getCallbackNames()¶
List DashboardResource::getCallbackNames()
Description¶
Returns the callback names defined for this dashboard resource. Use session.getDevTools().getCallbackEditor(resource, callbackName) to edit one, and call editor.open() when you want to show the UI.
getCallbacks()¶
Map DashboardResource::getCallbacks()
Description¶
Returns a map of all callback definitions.
getChildren()¶
List DashboardResource::getChildren()
Description¶
Returns a list of the child dashboard resources.
getClassName()¶
Description¶
Returns the string name of this object's class type.
getDRI()¶
String DashboardResource::getDRI()
Description¶
Returns the Dashboard Resource Indicator (DRI) as a string. DRI is the unique identifier of an object within the entire dashboard.
getDashboardResourceType()¶
String DashboardResource::getDashboardResourceType()
Description¶
Returns the Dashboard Resource Type as a string
getFormula(formulaName)¶
Formula DashboardResource::getFormula(String formulaName)
Description¶
Returns a Formula given the formula name.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| formulaName | String | name of the formula to return |
getFormulaNames()¶
Set DashboardResource::getFormulaNames()
Description¶
Returns a set of the names of all formulas for this object.
getFormulas()¶
Map DashboardResource::getFormulas()
Description¶
Returns a map of all available formulas for this object. The key is the formula name.
getId()¶
Description¶
Returns the id of the menu.
getLRI()¶
String DashboardResource::getLRI()
Description¶
Returns the Localized Resource Indicator (LRI) as a string. LRI is the unique identifier of this resource with the parent element.
getOwner()¶
DashboardResource DashboardResource::getOwner()
Description¶
Returns the DashboardResource that owns this object.
getPanel()¶
Description¶
Returns the underlying panel..
getParentMenuItem()¶
MenuItem MenuItem::getParentMenuItem()
Description¶
Returns the parent menu item, or null if this is the root.
getPosition()¶
Integer MenuItem::getPosition()
Description¶
Returns the position of this menu item
getSubMenuItems()¶
List MenuItem::getSubMenuItems()
Description¶
Returns a list of child menu items.
invokeCallback(callbackName,args)¶
Object DashboardResource::invokeCallback(String callbackName, Object ... args)
Description¶
Executes the specified callback definition and returns the result from the callback.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| callbackName | String | method name of callback |
| args | Object ... | arguments |
isBold()¶
Description¶
Returns true if the menu item font is Bold, false otherwise.
isItalic()¶
Description¶
Returns true if the menu item font is Italic, false otherwise.
isTransient()¶
Boolean DashboardResource::isTransient()
Description¶
Returns true if this is transient, false otherwise. Transient objects are not saved to the layout.
isUnderline()¶
Description¶
Returns true if the menu item font is Underline, false otherwise.
setBold(isBold)¶
Boolean MenuItem::setBold(Boolean isBold)
Description¶
Make the menu label font Bold.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| isBold | Boolean | Whether or not make the font bold |
setItalic(isItalic)¶
Boolean MenuItem::setItalic(Boolean isItalic)
Description¶
Make the menu label font Italic.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| isItalic | Boolean | Whether or not make the font Italic |
setUnderline(isUnderline)¶
Boolean MenuItem::setUnderline(Boolean isUnderline)
Description¶
Make the menu label font Underline.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| isUnderline | Boolean | Whether or not make the font Underline |
toJson()¶
Description¶
Returns a string of a json representation of this object.