1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package ifc.frame;
29 
30 import com.sun.star.awt.XPopupMenu;
31 import com.sun.star.frame.XPopupMenuController;
32 import lib.MultiMethodTest;
33 
34 public class _XPopupMenuController extends MultiMethodTest {
35     public XPopupMenuController oObj = null;
36 
37     public void before() {
38 
39     }
40 
41     public void _setPopupMenu() {
42         XPopupMenu xMenu = new PopupMenuImpl();
43         oObj.setPopupMenu(xMenu);
44         tRes.tested("setPopupMenu()", true);
45     }
46 
47     public void _updatePopupMenu() {
48         oObj.updatePopupMenu();
49         tRes.tested("updatePopupMenu()", true);
50     }
51 
52     private class PopupMenuImpl implements XPopupMenu {
53 
54         public void addMenuListener(com.sun.star.awt.XMenuListener xMenuListener) {
55             System.out.println("addMenuListener called.");
56         }
57 
58         public void checkItem(short param, boolean param1) {
59             System.out.println("checkItemListener called.");
60         }
61 
62         public void enableItem(short param, boolean param1) {
63             System.out.println("enableItem called.");
64         }
65 
66         public short execute(com.sun.star.awt.XWindowPeer xWindowPeer, com.sun.star.awt.Rectangle rectangle, short param) {
67             System.out.println("execute called.");
68             return 0;
69         }
70 
71         public short getDefaultItem() {
72             System.out.println("getDefaultItem called.");
73             return 0;
74         }
75 
76         public short getItemCount() {
77             System.out.println("getItemCount called.");
78             return 0;
79         }
80 
81         public short getItemId(short param) {
82             System.out.println("getItemId called.");
83             return 0;
84         }
85 
86         public short getItemPos(short param) {
87             System.out.println("getItemPos called.");
88             return 0;
89         }
90 
91         public String getItemText(short param) {
92             System.out.println("getItemText called.");
93             return "Hi.";
94         }
95 
96         public com.sun.star.awt.XPopupMenu getPopupMenu(short param) {
97             System.out.println("getPopupMenu called.");
98             return this;
99         }
100 
101         public void insertItem(short param, String str, short param2, short param3) {
102             System.out.println("insertItem called.");
103         }
104 
105         public void insertSeparator(short param) {
106             System.out.println("insertSeparator called.");
107         }
108 
109         public boolean isItemChecked(short param) {
110             System.out.println("isItemChecked called.");
111             return false;
112         }
113 
114         public boolean isItemEnabled(short param) {
115             System.out.println("isItemEnabled called.");
116             return false;
117         }
118 
119         public void removeItem(short param, short param1) {
120             System.out.println("removeItem called.");
121         }
122 
123         public void removeMenuListener(com.sun.star.awt.XMenuListener xMenuListener) {
124             System.out.println("removeMenuListener called.");
125         }
126 
127         public void setDefaultItem(short param) {
128             System.out.println("setDefaultItem called.");
129         }
130 
131         public void setItemText(short param, String str) {
132             System.out.println("setItemText called.");
133         }
134 
135         public void setPopupMenu(short param, com.sun.star.awt.XPopupMenu xPopupMenu) {
136             System.out.println("setPopupMenu called.");
137         }
138     }
139 }
140