java.lang.Object | |
↳ | com.pdftron.pdf.tools.QuickMenuBuilder |
A helper Menu
class for constructing QuickMenu
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.view.Menu
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
QuickMenuBuilder(Context context, ToolManager toolManager, boolean annotationPermission) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MenuItem |
add(int groupId, int itemId, int order, CharSequence title)
Add a new item to the menu.
| ||||||||||
MenuItem |
add(int titleRes)
Add a new item to the menu.
| ||||||||||
MenuItem |
add(CharSequence title)
Add a new item to the menu.
| ||||||||||
MenuItem |
add(int groupId, int itemId, int order, int titleRes)
Variation on
add(int, int, int, CharSequence) that takes a
string resource identifier instead of the string itself. | ||||||||||
SubMenu |
addSubMenu(int groupId, int itemId, int order, CharSequence title)
Add a new sub-menu to the menu.
| ||||||||||
SubMenu |
addSubMenu(int titleRes)
Add a new sub-menu to the menu.
| ||||||||||
SubMenu |
addSubMenu(CharSequence title)
Add a new sub-menu to the menu.
| ||||||||||
SubMenu |
addSubMenu(int groupId, int itemId, int order, int titleRes)
Variation on
addSubMenu(int, int, int, CharSequence) that takes
a string resource identifier for the title instead of the string itself. | ||||||||||
void |
clear()
Remove all existing items from the menu, leaving it empty as if it had
just been created.
| ||||||||||
void |
close()
Same as
clear()
| ||||||||||
MenuItem |
findItem(int id)
Return the menu item with a particular identifier.
| ||||||||||
MenuItem |
getItem(int index)
Gets the menu item at the given index.
| ||||||||||
MenuItem |
getItem()
Gets the
MenuItem that represents this submenu in the parent
menu. | ||||||||||
ArrayList<QuickMenuItem> |
getMenuItems()
Gets menu items, it will remove items if menu item's sub menu list is empty
| ||||||||||
void |
removeGroup(int groupId)
Remove all items in the given group.
| ||||||||||
void |
removeItem(int id)
Remove the item with the given identifier.
| ||||||||||
void |
setParentMenuItem(QuickMenuItem item)
Sets parent item that represents this submenu in the parent.
| ||||||||||
int |
size()
Gets the number of items in the menu.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.view.Menu
| |||||||||||
From interface
android.view.SubMenu
|
Add a new item to the menu. This item displays the given title for its label.
groupId | The group identifier that this item should be part of.
This can be used to define groups of items for batch state
changes. Normally use NONE if an item should not be in a
group. |
---|---|
itemId | Unique item ID. Use NONE if you do not need a
unique ID. |
order | The order for the item. Use NONE if you do not care
about the order. |
title | The text to display for the item. |
Add a new item to the menu. This item displays the given title for its label.
titleRes | Resource identifier of title string. |
---|
Add a new item to the menu. This item displays the given title for its label.
title | The text to display for the item. |
---|
Variation on add(int, int, int, CharSequence)
that takes a
string resource identifier instead of the string itself.
groupId | The group identifier that this item should be part of.
This can also be used to define groups of items for batch state
changes. Normally use NONE if an item should not be in a
group. |
---|---|
itemId | Unique item ID. Use NONE if you do not need a
unique ID. |
order | The order for the item. Use NONE if you do not care
about the order. |
titleRes | Resource identifier of title string. |
Add a new sub-menu to the menu. This item displays the given
title for its label. To modify other attributes on the
submenu's menu item, use getItem()
.
groupId | The group identifier that this item should be part of.
This can also be used to define groups of items for batch state
changes. Normally use NONE if an item should not be in a
group. |
---|---|
itemId | Unique item ID. Use NONE if you do not need a
unique ID. |
order | The order for the item. Use NONE if you do not care
about the order. |
title | The text to display for the item. |
Add a new sub-menu to the menu. This item displays the given title for
its label. To modify other attributes on the submenu's menu item, use
getItem()
.
titleRes | Resource identifier of title string. |
---|
Add a new sub-menu to the menu. This item displays the given title for
its label. To modify other attributes on the submenu's menu item, use
getItem()
.
title | The text to display for the item. |
---|
Variation on addSubMenu(int, int, int, CharSequence)
that takes
a string resource identifier for the title instead of the string itself.
groupId | The group identifier that this item should be part of.
This can also be used to define groups of items for batch state
changes. Normally use NONE if an item should not be in a group. |
---|---|
itemId | Unique item ID. Use NONE if you do not need a unique ID. |
order | The order for the item. Use NONE if you do not care about the
order. |
titleRes | Resource identifier of title string. |
Remove all existing items from the menu, leaving it empty as if it had just been created.
Return the menu item with a particular identifier.
id | The identifier to find. |
---|
Gets the menu item at the given index.
index | The index of the menu item to return. |
---|
IndexOutOfBoundsException | when index < 0 || >= size()
|
---|
Gets the MenuItem
that represents this submenu in the parent
menu. Use this for setting additional item attributes.
MenuItem
that launches the submenu when invoked.
Gets menu items, it will remove items if menu item's sub menu list is empty
Remove all items in the given group.
groupId | The group to be removed. If there are no items in this group, nothing happens. |
---|
Remove the item with the given identifier.
id | The item to be removed. If there is no item with this identifier, nothing happens. |
---|
Sets parent item that represents this submenu in the parent. Use this for getItem()
item | parent menu item |
---|
Gets the number of items in the menu. Note that this will change any times items are added or removed from the menu.