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 complex.toolkit.accessibility;
25 
26 // import lib.MultiMethodTest;
27 import com.sun.star.accessibility.XAccessibleExtendedComponent;
28 // import com.sun.star.accessibility.XAccessibleStateSet;
29 // import com.sun.star.accessibility.AccessibleStateType;
30 import com.sun.star.awt.XFont;
31 import com.sun.star.uno.XInterface;
32 import com.sun.star.uno.UnoRuntime;
33 // import share.LogWriter;
34 
35 /**
36  * Testing <code>com.sun.star.accessibility.XAccessibleExtendedComponent</code>
37  * interface methods :
38  * <ul>
39  *  <li><code> getForeground()</code></li>
40  *  <li><code> getBackground()</code></li>
41  *  <li><code> getFont()</code></li>
42  *  <li><code> isEnabled()</code></li>
43  *  <li><code> getTitledBorderText()</code></li>
44  *  <li><code> getToolTipText()</code></li>
45  * </ul> <p>
46  * @see com.sun.star.accessibility.XAccessibleExtendedComponent
47  */
48 public class _XAccessibleExtendedComponent {
49 
50     // private LogWriter log;
51     private static final String className =
52         "com.sun.star.accessibility.XAccessibleExtendedComponent" ;
53 
54     public XAccessibleExtendedComponent oObj = null;
55 
56     // temporary while accessibility package is in com.sun.star
getTestedClassName()57     protected String getTestedClassName() {
58         return className;
59     }
60 
_XAccessibleExtendedComponent(XInterface object )61     public _XAccessibleExtendedComponent(XInterface object/*, LogWriter log*/) {
62         oObj = UnoRuntime.queryInterface(XAccessibleExtendedComponent.class, object);
63         // this.log = log;
64     }
65 
66     /**
67      * Just calls the method.
68      * @return
69      */
_getFont()70     public boolean _getFont() {
71         XFont font = oObj.getFont();
72         System.out.println("getFont(): " + font);
73         return true;
74     }
75 
76     /**
77      * Calls the method and checks returned value.
78      * Has OK status if returned value isn't null.
79      * @return
80      */
_getTitledBorderText()81     public boolean _getTitledBorderText() {
82         String titleBorderText = oObj.getTitledBorderText();
83         System.out.println("getTitledBorderText(): '" + titleBorderText + "'");
84         return titleBorderText != null;
85     }
86 
87     /**
88      * Calls the method and checks returned value.
89      * Has OK status if returned value isn't null.
90      * @return
91      */
_getToolTipText()92     public boolean _getToolTipText() {
93         String toolTipText = oObj.getToolTipText();
94         System.out.println("getToolTipText(): '" + toolTipText + "'");
95         return toolTipText != null;
96     }
97 }
98