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.accessibility; 25 26 import lib.MultiMethodTest; 27 28 import com.sun.star.accessibility.XAccessibleExtendedComponent; 29 import com.sun.star.awt.XFont; 30 31 /** 32 * Testing <code>com.sun.star.accessibility.XAccessibleExtendedComponent</code> 33 * interface methods : 34 * <ul> 35 * <li><code> getForeground()</code></li> 36 * <li><code> getBackground()</code></li> 37 * <li><code> getFont()</code></li> 38 * <li><code> isEnabled()</code></li> 39 * <li><code> getTitledBorderText()</code></li> 40 * <li><code> getToolTipText()</code></li> 41 * </ul> <p> 42 * @see com.sun.star.accessibility.XAccessibleExtendedComponent 43 */ 44 public class _XAccessibleExtendedComponent extends MultiMethodTest { 45 46 public XAccessibleExtendedComponent oObj = null; 47 48 /** 49 * Just calls the method. 50 * deprecated from version srx644g 29.10.02 on 51 * 52 public void _getForeground() { 53 int forColor = oObj.getForeground(); 54 log.println("getForeground(): " + forColor); 55 tRes.tested("getForeground()", true); 56 } 57 58 /** 59 * Just calls the method. 60 * deprecated from version srx644g 29.10.02 on 61 * 62 public void _getBackground() { 63 int backColor = oObj.getBackground(); 64 log.println("getBackground(): " + backColor); 65 tRes.tested("getBackground()", true); 66 } 67 68 /** 69 * Just calls the method. 70 */ _getFont()71 public void _getFont() { 72 XFont font = oObj.getFont(); 73 log.println("getFont(): " + font); 74 tRes.tested("getFont()", true); 75 } 76 77 /** 78 * Calls the method and compares returned value with value that was 79 * returned by the method 80 * <code>XAccessibleStateSet.contains(AccessibleStateType.ENABLED)</code>. 81 * Has OK status if returned values are equal. 82 * deprecated from version srx644g 29.10.02 on 83 * 84 public void _isEnabled() { 85 boolean isEnabled = oObj.isEnabled(); 86 log.println("isEnabled(): " + isEnabled); 87 88 boolean res = true; 89 90 XAccessibleStateSet accStateSet = (XAccessibleStateSet) 91 UnoRuntime.queryInterface(XAccessibleStateSet.class, oObj); 92 93 if (accStateSet != null) { 94 res = accStateSet.contains(AccessibleStateType.ENABLED)==isEnabled; 95 } 96 97 tRes.tested("isEnabled()", res); 98 } 99 100 /** 101 * Calls the method and checks returned value. 102 * Has OK status if returned value isn't null. 103 */ _getTitledBorderText()104 public void _getTitledBorderText() { 105 String titleBorderText = oObj.getTitledBorderText(); 106 log.println("getTitledBorderText(): '" + titleBorderText + "'"); 107 tRes.tested("getTitledBorderText()", titleBorderText != null); 108 } 109 110 /** 111 * Calls the method and checks returned value. 112 * Has OK status if returned value isn't null. 113 */ _getToolTipText()114 public void _getToolTipText() { 115 String toolTipText = oObj.getToolTipText(); 116 log.println("getToolTipText(): '" + toolTipText + "'"); 117 tRes.tested("getToolTipText()", toolTipText != null); 118 } 119 }