Changed due to Simulation api change.
[debian/openrocket] / android-libraries / ActionBarSherlock / src / com / actionbarsherlock / internal / view / menu / MenuMule.java
1 package com.actionbarsherlock.internal.view.menu;
2
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;
9
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.";
15
16
17     private final com.actionbarsherlock.view.Menu mMenu;
18     public boolean mDispatchShow = false;
19
20     public MenuMule(com.actionbarsherlock.view.Menu menu) {
21         mMenu = menu;
22     }
23
24     public com.actionbarsherlock.view.Menu unwrap() {
25         return mMenu;
26     }
27
28
29     @Override
30     public MenuItem add(CharSequence arg0) {
31         throw new IllegalStateException(ERROR);
32     }
33
34     @Override
35     public MenuItem add(int arg0) {
36         throw new IllegalStateException(ERROR);
37     }
38
39     @Override
40     public MenuItem add(int arg0, int arg1, int arg2, CharSequence arg3) {
41         throw new IllegalStateException(ERROR);
42     }
43
44     @Override
45     public MenuItem add(int arg0, int arg1, int arg2, int arg3) {
46         throw new IllegalStateException(ERROR);
47     }
48
49     @Override
50     public int addIntentOptions(int arg0, int arg1, int arg2,
51             ComponentName arg3, Intent[] arg4, Intent arg5, int arg6,
52             MenuItem[] arg7) {
53         throw new IllegalStateException(ERROR);
54     }
55
56     @Override
57     public SubMenu addSubMenu(CharSequence arg0) {
58         throw new IllegalStateException(ERROR);
59     }
60
61     @Override
62     public SubMenu addSubMenu(int arg0) {
63         throw new IllegalStateException(ERROR);
64     }
65
66     @Override
67     public SubMenu addSubMenu(int arg0, int arg1, int arg2, CharSequence arg3) {
68         throw new IllegalStateException(ERROR);
69     }
70
71     @Override
72     public SubMenu addSubMenu(int arg0, int arg1, int arg2, int arg3) {
73         throw new IllegalStateException(ERROR);
74     }
75
76     @Override
77     public void clear() {
78         throw new IllegalStateException(ERROR);
79     }
80
81     @Override
82     public void close() {
83         throw new IllegalStateException(ERROR);
84     }
85
86     @Override
87     public MenuItem findItem(int arg0) {
88         throw new IllegalStateException(ERROR);
89     }
90
91     @Override
92     public MenuItem getItem(int arg0) {
93         throw new IllegalStateException(ERROR);
94     }
95
96     @Override
97     public boolean hasVisibleItems() {
98         return mMenu.hasVisibleItems();
99         //throw new IllegalStateException(ERROR);
100     }
101
102     @Override
103     public boolean isShortcutKey(int arg0, KeyEvent arg1) {
104         throw new IllegalStateException(ERROR);
105     }
106
107     @Override
108     public boolean performIdentifierAction(int arg0, int arg1) {
109         throw new IllegalStateException(ERROR);
110     }
111
112     @Override
113     public boolean performShortcut(int arg0, KeyEvent arg1, int arg2) {
114         throw new IllegalStateException(ERROR);
115     }
116
117     @Override
118     public void removeGroup(int arg0) {
119         throw new IllegalStateException(ERROR);
120     }
121
122     @Override
123     public void removeItem(int arg0) {
124         throw new IllegalStateException(ERROR);
125     }
126
127     @Override
128     public void setGroupCheckable(int arg0, boolean arg1, boolean arg2) {
129         throw new IllegalStateException(ERROR);
130     }
131
132     @Override
133     public void setGroupEnabled(int arg0, boolean arg1) {
134         throw new IllegalStateException(ERROR);
135     }
136
137     @Override
138     public void setGroupVisible(int arg0, boolean arg1) {
139         throw new IllegalStateException(ERROR);
140     }
141
142     @Override
143     public void setQwertyMode(boolean arg0) {
144         throw new IllegalStateException(ERROR);
145     }
146
147     @Override
148     public int size() {
149         throw new IllegalStateException(ERROR);
150     }
151 }