1 package com.actionbarsherlock.internal.view.menu;
3 import android.content.ComponentName;
4 import android.content.Intent;
5 import android.view.KeyEvent;
6 import android.view.Menu;
7 import android.view.MenuItem;
8 import android.view.SubMenu;
10 /** Used to carry an instance of our version of Menu through a native channel. */
11 public class MenuMule implements Menu {
12 private static final String ERROR = "Cannot interact with object designed for temporary "
13 + "instance passing. Make sure you using both SherlockFragmentActivity and "
14 + "SherlockFragment.";
17 private final com.actionbarsherlock.view.Menu mMenu;
18 public boolean mDispatchShow = false;
20 public MenuMule(com.actionbarsherlock.view.Menu menu) {
24 public com.actionbarsherlock.view.Menu unwrap() {
30 public MenuItem add(CharSequence arg0) {
31 throw new IllegalStateException(ERROR);
35 public MenuItem add(int arg0) {
36 throw new IllegalStateException(ERROR);
40 public MenuItem add(int arg0, int arg1, int arg2, CharSequence arg3) {
41 throw new IllegalStateException(ERROR);
45 public MenuItem add(int arg0, int arg1, int arg2, int arg3) {
46 throw new IllegalStateException(ERROR);
50 public int addIntentOptions(int arg0, int arg1, int arg2,
51 ComponentName arg3, Intent[] arg4, Intent arg5, int arg6,
53 throw new IllegalStateException(ERROR);
57 public SubMenu addSubMenu(CharSequence arg0) {
58 throw new IllegalStateException(ERROR);
62 public SubMenu addSubMenu(int arg0) {
63 throw new IllegalStateException(ERROR);
67 public SubMenu addSubMenu(int arg0, int arg1, int arg2, CharSequence arg3) {
68 throw new IllegalStateException(ERROR);
72 public SubMenu addSubMenu(int arg0, int arg1, int arg2, int arg3) {
73 throw new IllegalStateException(ERROR);
78 throw new IllegalStateException(ERROR);
83 throw new IllegalStateException(ERROR);
87 public MenuItem findItem(int arg0) {
88 throw new IllegalStateException(ERROR);
92 public MenuItem getItem(int arg0) {
93 throw new IllegalStateException(ERROR);
97 public boolean hasVisibleItems() {
98 return mMenu.hasVisibleItems();
99 //throw new IllegalStateException(ERROR);
103 public boolean isShortcutKey(int arg0, KeyEvent arg1) {
104 throw new IllegalStateException(ERROR);
108 public boolean performIdentifierAction(int arg0, int arg1) {
109 throw new IllegalStateException(ERROR);
113 public boolean performShortcut(int arg0, KeyEvent arg1, int arg2) {
114 throw new IllegalStateException(ERROR);
118 public void removeGroup(int arg0) {
119 throw new IllegalStateException(ERROR);
123 public void removeItem(int arg0) {
124 throw new IllegalStateException(ERROR);
128 public void setGroupCheckable(int arg0, boolean arg1, boolean arg2) {
129 throw new IllegalStateException(ERROR);
133 public void setGroupEnabled(int arg0, boolean arg1) {
134 throw new IllegalStateException(ERROR);
138 public void setGroupVisible(int arg0, boolean arg1) {
139 throw new IllegalStateException(ERROR);
143 public void setQwertyMode(boolean arg0) {
144 throw new IllegalStateException(ERROR);
149 throw new IllegalStateException(ERROR);