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 org.openoffice.test.vcl.widgets;
25 
26 import org.openoffice.test.vcl.client.Constant;
27 
28 
29 /**
30  * Proxy to access the VCL tool box
31  *
32  * Type: WINDOW_TOOLBOX
33  *
34  */
35 public class VclToolBox extends VclDockingWin {
36 
VclToolBox(VclApp app, String id)37 	public VclToolBox(VclApp app, String id) {
38 		super(app, id);
39 	}
40 
41 	/**
42 	 * Click the down arrow of tool bar to show the menu
43 	 *
44 	 */
openMenu()45 	public void openMenu() {
46 		invoke(Constant.M_OpenContextMenu);
47 	}
48 
49 	/**
50 	 * Returns the count of items in the tool bar
51 	 *
52 	 * @return the count
53 	 */
getItemCount()54 	public int getItemCount() {
55 		return ((Long) invoke(Constant.M_GetItemCount)).intValue();
56 	}
57 
58 	/**
59 	 * Get the text of the index-th item
60 	 * @param index
61 	 * @return
62 	 */
getItemText(int index)63 	public String getItemText(int index) {
64 		return (String) invoke(Constant.M_GetItemText2, new Object[] {index + 1});
65 	}
66 
67 	/**
68 	 * Get the quick tooltip text of the index-th item
69 	 * @param index
70 	 * @return
71 	 */
getItemQuickToolTipText(int index)72 	public String getItemQuickToolTipText(int index) {
73 		return (String) invoke(Constant.M_GetItemQuickHelpText, new Object[] {index + 1});
74 	}
75 
76 	/**
77 	 * Get the tooltip text of the index-th item
78 	 * @param index
79 	 * @return
80 	 */
getItemToolTipText(int index)81 	public String getItemToolTipText(int index) {
82 		return (String) invoke(Constant.M_GetItemHelpText, new Object[] {index + 1});
83 	}
84 
85 	/**
86 	 * Get the name of the next tool bar
87 	 * @return
88 	 */
getNextToolBar()89 	public String getNextToolBar() {
90 		return (String) invoke(Constant.M_GetNextToolBox);
91 	}
92 }
93