Package org.robolectric.fakes
Class RoboMenu
- java.lang.Object
-
- org.robolectric.fakes.RoboMenu
-
- All Implemented Interfaces:
Menu
- Direct Known Subclasses:
RoboSubMenu
public class RoboMenu extends Object implements Menu
Robolectric implementation ofMenu
.
-
-
Field Summary
-
Fields inherited from interface android.view.Menu
CATEGORY_ALTERNATIVE, CATEGORY_CONTAINER, CATEGORY_MASK, CATEGORY_SECONDARY, CATEGORY_SHIFT, CATEGORY_SYSTEM, FIRST, FLAG_ALWAYS_PERFORM_CLOSE, FLAG_APPEND_TO_GROUP, FLAG_PERFORM_NO_CLOSE, NONE, SUPPORTED_MODIFIERS_MASK, USER_MASK, USER_SHIFT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MenuItem
add(int titleRes)
MenuItem
add(int groupId, int itemId, int order, int titleRes)
MenuItem
add(int groupId, int itemId, int order, CharSequence title)
MenuItem
add(CharSequence title)
int
addIntentOptions(int groupId, int itemId, int order, ComponentName caller, Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems)
SubMenu
addSubMenu(int titleRes)
SubMenu
addSubMenu(int groupId, int itemId, int order, int titleRes)
SubMenu
addSubMenu(int groupId, int itemId, int order, CharSequence title)
SubMenu
addSubMenu(CharSequence title)
void
clear()
void
close()
MenuItem
findItem(int id)
RoboMenuItem
findMenuItem(CharSequence title)
RoboMenuItem
findMenuItemContaining(CharSequence desiredText)
MenuItem
getItem(int index)
boolean
hasVisibleItems()
boolean
isShortcutKey(int keyCode, KeyEvent event)
boolean
performIdentifierAction(int id, int flags)
boolean
performShortcut(int keyCode, KeyEvent event, int flags)
void
removeGroup(int groupId)
void
removeItem(int id)
void
setGroupCheckable(int group, boolean checkable, boolean exclusive)
void
setGroupEnabled(int group, boolean enabled)
void
setGroupVisible(int group, boolean visible)
void
setQwertyMode(boolean isQwerty)
int
size()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface android.view.Menu
setGroupDividerEnabled
-
-
-
-
Constructor Detail
-
RoboMenu
public RoboMenu()
-
RoboMenu
public RoboMenu(Context context)
-
-
Method Detail
-
add
public MenuItem add(CharSequence title)
-
add
public MenuItem add(int groupId, int itemId, int order, CharSequence title)
-
add
public MenuItem add(int groupId, int itemId, int order, int titleRes)
-
addSubMenu
public SubMenu addSubMenu(CharSequence title)
- Specified by:
addSubMenu
in interfaceMenu
-
addSubMenu
public SubMenu addSubMenu(int titleRes)
- Specified by:
addSubMenu
in interfaceMenu
-
addSubMenu
public SubMenu addSubMenu(int groupId, int itemId, int order, CharSequence title)
- Specified by:
addSubMenu
in interfaceMenu
-
addSubMenu
public SubMenu addSubMenu(int groupId, int itemId, int order, int titleRes)
- Specified by:
addSubMenu
in interfaceMenu
-
addIntentOptions
public int addIntentOptions(int groupId, int itemId, int order, ComponentName caller, Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems)
- Specified by:
addIntentOptions
in interfaceMenu
-
removeItem
public void removeItem(int id)
- Specified by:
removeItem
in interfaceMenu
-
removeGroup
public void removeGroup(int groupId)
- Specified by:
removeGroup
in interfaceMenu
-
setGroupCheckable
public void setGroupCheckable(int group, boolean checkable, boolean exclusive)
- Specified by:
setGroupCheckable
in interfaceMenu
-
setGroupVisible
public void setGroupVisible(int group, boolean visible)
- Specified by:
setGroupVisible
in interfaceMenu
-
setGroupEnabled
public void setGroupEnabled(int group, boolean enabled)
- Specified by:
setGroupEnabled
in interfaceMenu
-
hasVisibleItems
public boolean hasVisibleItems()
- Specified by:
hasVisibleItems
in interfaceMenu
-
performShortcut
public boolean performShortcut(int keyCode, KeyEvent event, int flags)
- Specified by:
performShortcut
in interfaceMenu
-
isShortcutKey
public boolean isShortcutKey(int keyCode, KeyEvent event)
- Specified by:
isShortcutKey
in interfaceMenu
-
performIdentifierAction
public boolean performIdentifierAction(int id, int flags)
- Specified by:
performIdentifierAction
in interfaceMenu
-
setQwertyMode
public void setQwertyMode(boolean isQwerty)
- Specified by:
setQwertyMode
in interfaceMenu
-
findMenuItem
public RoboMenuItem findMenuItem(CharSequence title)
-
findMenuItemContaining
public RoboMenuItem findMenuItemContaining(CharSequence desiredText)
-
-