1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _XAccessibleExtendedComponent.java,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 package ifc
.accessibility
;
33 import lib
.MultiMethodTest
;
35 import com
.sun
.star
.accessibility
.XAccessibleExtendedComponent
;
36 import com
.sun
.star
.awt
.XFont
;
39 * Testing <code>com.sun.star.accessibility.XAccessibleExtendedComponent</code>
42 * <li><code> getForeground()</code></li>
43 * <li><code> getBackground()</code></li>
44 * <li><code> getFont()</code></li>
45 * <li><code> isEnabled()</code></li>
46 * <li><code> getTitledBorderText()</code></li>
47 * <li><code> getToolTipText()</code></li>
49 * @see com.sun.star.accessibility.XAccessibleExtendedComponent
51 public class _XAccessibleExtendedComponent
extends MultiMethodTest
{
53 public XAccessibleExtendedComponent oObj
= null;
56 * Just calls the method.
57 * deprecated from version srx644g 29.10.02 on
59 public void _getForeground() {
60 int forColor = oObj.getForeground();
61 log.println("getForeground(): " + forColor);
62 tRes.tested("getForeground()", true);
66 * Just calls the method.
67 * deprecated from version srx644g 29.10.02 on
69 public void _getBackground() {
70 int backColor = oObj.getBackground();
71 log.println("getBackground(): " + backColor);
72 tRes.tested("getBackground()", true);
76 * Just calls the method.
78 public void _getFont() {
79 XFont font
= oObj
.getFont();
80 log
.println("getFont(): " + font
);
81 tRes
.tested("getFont()", true);
85 * Calls the method and compares returned value with value that was
86 * returned by the method
87 * <code>XAccessibleStateSet.contains(AccessibleStateType.ENABLED)</code>.
88 * Has OK status if returned values are equal.
89 * deprecated from version srx644g 29.10.02 on
91 public void _isEnabled() {
92 boolean isEnabled = oObj.isEnabled();
93 log.println("isEnabled(): " + isEnabled);
97 XAccessibleStateSet accStateSet = (XAccessibleStateSet)
98 UnoRuntime.queryInterface(XAccessibleStateSet.class, oObj);
100 if (accStateSet != null) {
101 res = accStateSet.contains(AccessibleStateType.ENABLED)==isEnabled;
104 tRes.tested("isEnabled()", res);
108 * Calls the method and checks returned value.
109 * Has OK status if returned value isn't null.
111 public void _getTitledBorderText() {
112 String titleBorderText
= oObj
.getTitledBorderText();
113 log
.println("getTitledBorderText(): '" + titleBorderText
+ "'");
114 tRes
.tested("getTitledBorderText()", titleBorderText
!= null);
118 * Calls the method and checks returned value.
119 * Has OK status if returned value isn't null.
121 public void _getToolTipText() {
122 String toolTipText
= oObj
.getToolTipText();
123 log
.println("getToolTipText(): '" + toolTipText
+ "'");
124 tRes
.tested("getToolTipText()", toolTipText
!= null);