public class AddSubMenu extends RPCRequest
Add a SubMenu to the Command Menu
A SubMenu can only be added to the Top Level Menu (i.e.a SubMenu cannot be added to a SubMenu), and may only contain commands as children
HMILevel needs to be FULL, LIMITED or BACKGROUND
Parameter List
| Param Name | Type | Description | Req. | Notes | Version Available |
|---|---|---|---|---|---|
| menuID | Integer | Unique ID that identifies this sub menu. This value is used in AddCommand to which SubMenu is the parent of the command being added. | Y | SmartDeviceLink 1.0 | |
| position | Integer | Position within the items of the top level Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc. Position of any submenu will always be located before the return and exit options. | N | Min Value: 0 Max Value: 1000 If position is greater or equal than the number of items on top level, the sub menu will be appended by the end. If this parameter is omitted, the entry will be added at the end of the list. |
SmartDeviceLink 1.0 |
| menuName | String | Text which is displayed representing this submenu item | Y | maxlength:500 | SmartDeviceLink 1.0 |
| menuIcon | Image | Image to be be shown along with the submenu item | N | SmartDeviceLink 5.0 | |
| menuLayout | MenuLayout | Sets the layout of the submenu screen. | SmartDeviceLink 6.0 | ||
| parentID | Integer | unique ID of the sub menu, the command will be added to. If not provided or 0, it will be provided to the top level of the in application menu. | N | Min Value: 0 Max Value: 2000000000 |
SmartDeviceLink 7.0.0 |
| secondaryText | String | Optional secondary text to display | N | {"string_min_length": 1, "string_max_length": 500} |
|
| tertiaryText | String | Optional tertiary text to display | N | {"string_min_length": 1, "string_max_length": 500} | , SmartDeviceLink 7.1.0 |
| secondaryImage | Image | Optional secondary image struct for sub-menu cell | N | , SmartDeviceLink 7.1.0 |
Indicates that the corresponding request either failed or succeeded. If the response returns with a SUCCESS result code, this means the SubMenu was added to the Command Menu successfully
Non-default Result Codes:
INVALID_ID
DUPLICATE NAME
, SmartDeviceLink 1.0DeleteSubMenu,
AddCommand,
DeleteCommand| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_MENU_ICON |
static String |
KEY_MENU_ID |
static String |
KEY_MENU_LAYOUT |
static String |
KEY_MENU_NAME |
static String |
KEY_PARENT_ID |
static String |
KEY_POSITION |
static String |
KEY_SECONDARY_IMAGE |
static String |
KEY_SECONDARY_TEXT |
static String |
KEY_TERTIARY_TEXT |
onResponseListenerfunction, KEY_CORRELATION_ID, KEY_FUNCTION_NAME, KEY_NOTIFICATION, KEY_PARAMETERS, KEY_REQUEST, KEY_RESPONSE, messageType, parametersKEY_BULK_DATA, KEY_PROTECTED, store| Constructor and Description |
|---|
AddSubMenu()
Constructs a new AddSubMenu object
|
AddSubMenu(Hashtable<String,Object> hash)
Constructs a new AddSubMenu object indicated by the Hashtable parameter
|
AddSubMenu(Integer menuID,
String menuName)
Constructs a new AddSubMenu object
|
| Modifier and Type | Method and Description |
|---|---|
Image |
getMenuIcon()
Returns Image to be be shown along with the submenu item
|
Integer |
getMenuID()
Returns an Integer object representing the Menu ID that identifies
a sub menu
|
MenuLayout |
getMenuLayout()
Gets the layout of the submenu screen.
|
String |
getMenuName()
Returns String which is displayed representing this submenu item
|
Integer |
getParentID()
Gets the parentID.
|
Integer |
getPosition()
Returns an Integer object representing the position of menu
|
Image |
getSecondaryImage()
Gets the secondaryImage.
|
String |
getSecondaryText()
Gets the secondaryText.
|
String |
getTertiaryText()
Gets the tertiaryText.
|
AddSubMenu |
setMenuIcon(Image menuIcon)
Sets image to be be shown along with the submenu item
|
AddSubMenu |
setMenuID(Integer menuID)
Sets a Menu ID that identifies a sub menu.
|
AddSubMenu |
setMenuLayout(MenuLayout menuLayout)
Sets the layout of the submenu screen.
|
AddSubMenu |
setMenuName(String menuName)
Sets a menuName which is displayed representing this submenu item
|
AddSubMenu |
setParentID(Integer parentID)
Sets the parentID.
|
AddSubMenu |
setPosition(Integer position)
Sets a position of menu
|
AddSubMenu |
setSecondaryImage(Image secondaryImage)
Sets the secondaryImage.
|
AddSubMenu |
setSecondaryText(String secondaryText)
Sets the secondaryText.
|
AddSubMenu |
setTertiaryText(String tertiaryText)
Sets the tertiaryText.
|
getCorrelationID, getOnRPCResponseListener, setCorrelationID, setOnRPCResponseListenergetBoolean, getDouble, getFloat, getFunctionID, getFunctionName, getInteger, getLong, getMessageType, getObject, getParameters, getString, setFunctionName, setParametersclone, deserializeJSON, equals, format, formatObject, getBulkData, getMessageTypeName, getStore, getStoreValue, getValue, getValueForString, hashCode, hasKey, isPayloadProtected, serializeJSON, serializeJSON, setBulkData, setPayloadProtected, setValuepublic static final String KEY_POSITION
public static final String KEY_MENU_NAME
public static final String KEY_MENU_ID
public static final String KEY_MENU_ICON
public static final String KEY_MENU_LAYOUT
public static final String KEY_PARENT_ID
public static final String KEY_SECONDARY_TEXT
public static final String KEY_TERTIARY_TEXT
public static final String KEY_SECONDARY_IMAGE
public AddSubMenu()
public AddSubMenu(Hashtable<String,Object> hash)
hash - The Hashtable to usepublic Integer getMenuID()
public AddSubMenu setMenuID(@NonNull Integer menuID)
Sets a Menu ID that identifies a sub menu.
This value is used in AddCommand to which SubMenu is the parent of the command being added
menuID - an integer object representing a Menu ID
Notes: Min Value: 0; Max Value: 2000000000
public Integer getPosition()
Returns an Integer object representing the position of menu
public AddSubMenu setPosition(Integer position)
position - An Integer object representing the position within the items of the top level Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc. Position of any submenu will always be located before the return and exit options
Notes:public String getMenuName()
public AddSubMenu setMenuName(@NonNull String menuName)
menuName - String which will be displayed representing this submenu itempublic Image getMenuIcon()
public AddSubMenu setMenuIcon(Image menuIcon)
menuIcon - Image to be be shown along with the submenu itempublic AddSubMenu setMenuLayout(MenuLayout menuLayout)
menuLayout - - the menuLayoutpublic MenuLayout getMenuLayout()
public AddSubMenu setParentID(Integer parentID)
parentID - unique ID of the sub menu, the command will be added to. If not provided or 0, it will be
provided to the top level of the in application menu.public Integer getParentID()
public AddSubMenu setSecondaryText(String secondaryText)
secondaryText - Optional secondary text to display
{"string_min_length": 1, "string_max_length": 500}public String getSecondaryText()
public AddSubMenu setTertiaryText(String tertiaryText)
tertiaryText - Optional tertiary text to display
{"string_min_length": 1, "string_max_length": 500}public String getTertiaryText()
public AddSubMenu setSecondaryImage(Image secondaryImage)
secondaryImage - Optional secondary image struct for sub-menu cellpublic Image getSecondaryImage()