2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package ifc
.accessibility
;
21 import lib
.MultiMethodTest
;
23 import com
.sun
.star
.accessibility
.XAccessibleExtendedComponent
;
24 import com
.sun
.star
.awt
.XFont
;
27 * Testing <code>com.sun.star.accessibility.XAccessibleExtendedComponent</code>
30 * <li><code> getForeground()</code></li>
31 * <li><code> getBackground()</code></li>
32 * <li><code> getFont()</code></li>
33 * <li><code> isEnabled()</code></li>
34 * <li><code> getTitledBorderText()</code></li>
35 * <li><code> getToolTipText()</code></li>
37 * @see com.sun.star.accessibility.XAccessibleExtendedComponent
39 public class _XAccessibleExtendedComponent
extends MultiMethodTest
{
41 public XAccessibleExtendedComponent oObj
= null;
44 * Just calls the method.
45 * deprecated from version srx644g 29.10.02 on
47 public void _getForeground() {
48 int forColor = oObj.getForeground();
49 log.println("getForeground(): " + forColor);
50 tRes.tested("getForeground()", true);
54 * Just calls the method.
55 * deprecated from version srx644g 29.10.02 on
57 public void _getBackground() {
58 int backColor = oObj.getBackground();
59 log.println("getBackground(): " + backColor);
60 tRes.tested("getBackground()", true);
64 * Just calls the method.
66 public void _getFont() {
67 XFont font
= oObj
.getFont();
68 log
.println("getFont(): " + font
);
69 tRes
.tested("getFont()", true);
73 * Calls the method and compares returned value with value that was
74 * returned by the method
75 * <code>XAccessibleStateSet.contains(AccessibleStateType.ENABLED)</code>.
76 * Has OK status if returned values are equal.
77 * deprecated from version srx644g 29.10.02 on
79 public void _isEnabled() {
80 boolean isEnabled = oObj.isEnabled();
81 log.println("isEnabled(): " + isEnabled);
85 XAccessibleStateSet accStateSet = (XAccessibleStateSet)
86 UnoRuntime.queryInterface(XAccessibleStateSet.class, oObj);
88 if (accStateSet != null) {
89 res = accStateSet.contains(AccessibleStateType.ENABLED)==isEnabled;
92 tRes.tested("isEnabled()", res);
96 * Calls the method and checks returned value.
97 * Has OK status if returned value isn't null.
99 public void _getTitledBorderText() {
100 String titleBorderText
= oObj
.getTitledBorderText();
101 log
.println("getTitledBorderText(): '" + titleBorderText
+ "'");
102 tRes
.tested("getTitledBorderText()", titleBorderText
!= null);
106 * Calls the method and checks returned value.
107 * Has OK status if returned value isn't null.
109 public void _getToolTipText() {
110 String toolTipText
= oObj
.getToolTipText();
111 log
.println("getToolTipText(): '" + toolTipText
+ "'");
112 tRes
.tested("getToolTipText()", toolTipText
!= null);