1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package ifc.frame;
25 
26 import com.sun.star.graphic.XGraphic;
27 import com.sun.star.awt.XPopupMenu;
28 import com.sun.star.awt.KeyEvent;
29 import com.sun.star.frame.XPopupMenuController;
30 import lib.MultiMethodTest;
31 
32 public class _XPopupMenuController extends MultiMethodTest {
33     public XPopupMenuController oObj = null;
34 
35     public void before() {
36 
37     }
38 
39     public void _setPopupMenu() {
40         XPopupMenu xMenu = new PopupMenuImpl();
41         oObj.setPopupMenu(xMenu);
42         tRes.tested("setPopupMenu()", true);
43     }
44 
45     public void _updatePopupMenu() {
46         oObj.updatePopupMenu();
47         tRes.tested("updatePopupMenu()", true);
48     }
49 
50     private class PopupMenuImpl implements XPopupMenu {
51 
52         public void addMenuListener(com.sun.star.awt.XMenuListener xMenuListener) {
53             System.out.println("addMenuListener called.");
54         }
55 
56         public void checkItem(short param, boolean param1) {
57             System.out.println("checkItemListener called.");
58         }
59 
60         public void enableItem(short param, boolean param1) {
61             System.out.println("enableItem called.");
62         }
63 
64         public short execute(com.sun.star.awt.XWindowPeer xWindowPeer, com.sun.star.awt.Point pos, short param) {
65             System.out.println("execute called.");
66             return 0;
67         }
68 
69         public short getDefaultItem() {
70             System.out.println("getDefaultItem called.");
71             return 0;
72         }
73 
74         public short getItemCount() {
75             System.out.println("getItemCount called.");
76             return 0;
77         }
78 
79         public short getItemId(short param) {
80             System.out.println("getItemId called.");
81             return 0;
82         }
83 
84         public short getItemPos(short param) {
85             System.out.println("getItemPos called.");
86             return 0;
87         }
88 
89         public String getItemText(short param) {
90             System.out.println("getItemText called.");
91             return "Hi.";
92         }
93 
94         public com.sun.star.awt.XPopupMenu getPopupMenu(short param) {
95             System.out.println("getPopupMenu called.");
96             return this;
97         }
98 
99         public void insertItem(short param, String str, short param2, short param3) {
100             System.out.println("insertItem called.");
101         }
102 
103         public void insertSeparator(short param) {
104             System.out.println("insertSeparator called.");
105         }
106 
107         public boolean isItemChecked(short param) {
108             System.out.println("isItemChecked called.");
109             return false;
110         }
111 
112         public boolean isItemEnabled(short param) {
113             System.out.println("isItemEnabled called.");
114             return false;
115         }
116 
117         public void removeItem(short param, short param1) {
118             System.out.println("removeItem called.");
119         }
120 
121         public void removeMenuListener(com.sun.star.awt.XMenuListener xMenuListener) {
122             System.out.println("removeMenuListener called.");
123         }
124 
125         public void setDefaultItem(short param) {
126             System.out.println("setDefaultItem called.");
127         }
128 
129         public void setItemText(short param, String str) {
130             System.out.println("setItemText called.");
131         }
132 
133         public void setPopupMenu(short param, com.sun.star.awt.XPopupMenu xPopupMenu) {
134             System.out.println("setPopupMenu called.");
135         }
136 
137         public XGraphic getItemImage(short param ) {
138             System.out.println("getItemImage called.");
139             return null;
140         }
141 
142         public void setItemImage(short param, XGraphic param1, boolean param2 ) {
143             System.out.println("setItemImage called.");
144         }
145 
146         public KeyEvent getAcceleratorKeyEvent(short param ) {
147             System.out.println("getAcceleratorKeyEvent called.");
148             return new KeyEvent();
149         }
150 
151         public void setAcceleratorKeyEvent(short param, KeyEvent param1 ) {
152             System.out.println("setAcceleratorKeyEvent called.");
153         }
154 
155         public void endExecute() {
156             System.out.println("endExecute called.");
157         }
158 
159         public boolean isInExecute() {
160             System.out.println("isInExecute called.");
161             return false;
162         }
163 
164         public boolean isPopupMenu() {
165             System.out.println("isPopupMenu called.");
166             return true;
167         }
168 
169         public String getTipHelpText(short param ) {
170             System.out.println("getTipHelpText called.");
171             return null;
172         }
173 
174         public void setTipHelpText(short param, String param1 ) {
175             System.out.println("setTipHelpText called.");
176         }
177 
178         public String getHelpText(short param ) {
179             System.out.println("getHelpText called.");
180             return null;
181         }
182 
183         public void setHelpText(short param, String param1 ) {
184             System.out.println("setHelpText called.");
185         }
186 
187         public String getHelpCommand(short param ) {
188             System.out.println("getHelpCommand called.");
189             return null;
190         }
191 
192         public void setHelpCommand(short param, String param1 ) {
193             System.out.println("setHelpCommand called.");
194         }
195 
196         public String getCommand(short param ) {
197             System.out.println("getCommand called.");
198             return null;
199         }
200 
201         public void setCommand(short param, String param1 ) {
202             System.out.println("setCommand called.");
203         }
204 
205         public void enableAutoMnemonics(boolean param ) {
206             System.out.println("enableAutoMnemonics called.");
207         }
208 
209         public void hideDisabledEntries(boolean param ) {
210             System.out.println("hideDisabledEntries called.");
211         }
212 
213         public com.sun.star.awt.MenuItemType getItemType(short param ) {
214             System.out.println("getItemType called.");
215             return com.sun.star.awt.MenuItemType.DONTKNOW;
216         }
217 
218         public void setItemType(com.sun.star.awt.MenuItemType param ) {
219             System.out.println("setItemType called.");
220         }
221 
222         public void clear() {
223             System.out.println("clear called.");
224         }
225     }
226 }
227