2012-06-21 11:53:00 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2003-01-27 15:27:53 +00:00
|
|
|
package util;
|
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
import com.sun.star.accessibility.XAccessible;
|
|
|
|
import com.sun.star.accessibility.XAccessibleComponent;
|
|
|
|
import com.sun.star.accessibility.XAccessibleContext;
|
2003-01-27 15:27:53 +00:00
|
|
|
import com.sun.star.awt.XWindow;
|
|
|
|
import com.sun.star.frame.XController;
|
|
|
|
import com.sun.star.frame.XFrame;
|
|
|
|
import com.sun.star.frame.XModel;
|
2004-03-19 14:56:28 +00:00
|
|
|
import com.sun.star.uno.UnoRuntime;
|
|
|
|
import com.sun.star.uno.XInterface;
|
|
|
|
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
|
|
|
|
public class AccessibilityTools {
|
2013-05-21 16:40:03 +02:00
|
|
|
public static XAccessible SearchedAccessible = null;
|
2004-11-02 10:47:31 +00:00
|
|
|
private static boolean debug = false;
|
2003-01-27 15:27:53 +00:00
|
|
|
|
2014-12-19 16:00:53 +02:00
|
|
|
private AccessibilityTools() {}
|
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
public static XAccessible getAccessibleObject(XInterface xObject) {
|
2010-02-24 11:08:28 +01:00
|
|
|
return UnoRuntime.queryInterface(XAccessible.class, xObject);
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
|
|
|
|
2014-08-08 14:53:00 +02:00
|
|
|
public static XWindow getCurrentContainerWindow(XModel xModel) {
|
|
|
|
return getWindow(xModel, true);
|
2004-07-23 09:43:42 +00:00
|
|
|
}
|
|
|
|
|
2014-08-08 14:53:00 +02:00
|
|
|
public static XWindow getCurrentWindow(XModel xModel) {
|
|
|
|
return getWindow(xModel, false);
|
2004-07-23 09:43:42 +00:00
|
|
|
}
|
|
|
|
|
2014-08-08 14:53:00 +02:00
|
|
|
private static XWindow getWindow(XModel xModel,
|
2007-06-04 12:31:30 +00:00
|
|
|
boolean containerWindow) {
|
2003-01-27 15:27:53 +00:00
|
|
|
XWindow xWindow = null;
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
try {
|
2003-01-27 15:27:53 +00:00
|
|
|
XController xController = xModel.getCurrentController();
|
|
|
|
XFrame xFrame = xController.getFrame();
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
if (xFrame == null) {
|
|
|
|
System.out.println("can't get frame from controller");
|
2014-10-11 20:27:09 +02:00
|
|
|
} else {
|
|
|
|
if (containerWindow)
|
|
|
|
xWindow = xFrame.getContainerWindow();
|
|
|
|
else
|
|
|
|
xWindow = xFrame.getComponentWindow();
|
2004-03-19 14:56:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (xWindow == null) {
|
|
|
|
System.out.println("can't get window from frame");
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
System.out.println("caught exception while getting current window" + e);
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return xWindow;
|
|
|
|
}
|
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
public static XAccessibleContext getAccessibleObjectForRole(XAccessible xacc,
|
2007-06-04 12:31:30 +00:00
|
|
|
short role) {
|
2013-05-21 16:40:03 +02:00
|
|
|
SearchedAccessible = null;
|
2013-04-23 09:08:33 +02:00
|
|
|
return getAccessibleObjectForRole_(xacc, role);
|
2004-03-19 14:56:28 +00:00
|
|
|
}
|
2003-01-27 15:27:53 +00:00
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
public static XAccessibleContext getAccessibleObjectForRole(XAccessible xacc,
|
2007-06-04 12:31:30 +00:00
|
|
|
short role,
|
|
|
|
boolean ignoreShowing) {
|
2013-05-21 16:40:03 +02:00
|
|
|
SearchedAccessible = null;
|
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
if (ignoreShowing) {
|
2013-04-23 09:08:33 +02:00
|
|
|
return getAccessibleObjectForRoleIgnoreShowing_(xacc, role);
|
2004-03-19 14:56:28 +00:00
|
|
|
} else {
|
2013-04-23 09:08:33 +02:00
|
|
|
return getAccessibleObjectForRole_(xacc, role);
|
2004-03-19 14:56:28 +00:00
|
|
|
}
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
|
|
|
|
2014-08-08 12:44:57 +02:00
|
|
|
private static XAccessibleContext getAccessibleObjectForRoleIgnoreShowing_(XAccessible xacc,
|
2007-06-04 12:31:30 +00:00
|
|
|
short role) {
|
2004-03-19 14:56:28 +00:00
|
|
|
XAccessibleContext ac = xacc.getAccessibleContext();
|
2014-01-28 12:46:06 +01:00
|
|
|
if (ac == null) {
|
|
|
|
return null;
|
|
|
|
}
|
2004-03-19 14:56:28 +00:00
|
|
|
if (ac.getAccessibleRole() == role) {
|
2013-05-21 16:40:03 +02:00
|
|
|
SearchedAccessible = xacc;
|
2013-04-23 09:08:33 +02:00
|
|
|
return ac;
|
2004-03-19 14:56:28 +00:00
|
|
|
} else {
|
|
|
|
int k = ac.getAccessibleChildCount();
|
|
|
|
|
|
|
|
if (ac.getAccessibleChildCount() > 100) {
|
|
|
|
k = 50;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < k; i++) {
|
|
|
|
try {
|
2013-04-23 09:08:33 +02:00
|
|
|
XAccessibleContext ac2 = getAccessibleObjectForRoleIgnoreShowing_(
|
2007-06-04 12:31:30 +00:00
|
|
|
ac.getAccessibleChild(i), role);
|
2004-03-19 14:56:28 +00:00
|
|
|
|
2013-04-23 09:08:33 +02:00
|
|
|
if (ac2 != null) {
|
|
|
|
return ac2;
|
2004-03-19 14:56:28 +00:00
|
|
|
}
|
|
|
|
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
|
|
|
|
System.out.println("Couldn't get Child");
|
|
|
|
}
|
|
|
|
}
|
2013-04-23 09:08:33 +02:00
|
|
|
return null;
|
2004-03-19 14:56:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-08 12:44:57 +02:00
|
|
|
private static XAccessibleContext getAccessibleObjectForRole_(XAccessible xacc,
|
2007-06-04 12:31:30 +00:00
|
|
|
short role) {
|
2003-01-27 15:27:53 +00:00
|
|
|
XAccessibleContext ac = xacc.getAccessibleContext();
|
2013-05-21 16:40:03 +02:00
|
|
|
boolean isShowing = ac.getAccessibleStateSet()
|
|
|
|
.contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
if ((ac.getAccessibleRole() == role) && isShowing) {
|
2013-05-21 16:40:03 +02:00
|
|
|
SearchedAccessible = xacc;
|
2013-04-23 09:08:33 +02:00
|
|
|
return ac;
|
2003-01-27 15:27:53 +00:00
|
|
|
} else {
|
|
|
|
int k = ac.getAccessibleChildCount();
|
2004-03-19 14:56:28 +00:00
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
if (ac.getAccessibleChildCount() > 100) {
|
2004-03-19 14:56:28 +00:00
|
|
|
k = 50;
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < k; i++) {
|
2003-01-27 15:27:53 +00:00
|
|
|
try {
|
2013-04-23 09:08:33 +02:00
|
|
|
XAccessibleContext ac2 = getAccessibleObjectForRole_(ac.getAccessibleChild(i), role);
|
2004-03-19 14:56:28 +00:00
|
|
|
|
2013-04-23 09:08:33 +02:00
|
|
|
if (ac2 != null) {
|
|
|
|
return ac2;
|
2004-03-19 14:56:28 +00:00
|
|
|
}
|
2003-01-27 15:27:53 +00:00
|
|
|
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
|
|
|
|
System.out.println("Couldn't get Child");
|
|
|
|
}
|
|
|
|
}
|
2013-04-23 09:08:33 +02:00
|
|
|
return null;
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static XAccessibleContext getAccessibleObjectForRole(XAccessible xacc,
|
2007-06-04 12:31:30 +00:00
|
|
|
short role,
|
|
|
|
String name) {
|
2003-01-27 15:27:53 +00:00
|
|
|
return getAccessibleObjectForRole(xacc, role, name, "");
|
|
|
|
}
|
|
|
|
|
|
|
|
public static XAccessibleContext getAccessibleObjectForRole(XAccessible xacc,
|
2007-06-04 12:31:30 +00:00
|
|
|
short role,
|
|
|
|
String name,
|
|
|
|
boolean ignoreShowing) {
|
2004-03-19 14:56:28 +00:00
|
|
|
if (ignoreShowing) {
|
|
|
|
return getAccessibleObjectForRoleIgnoreShowing(xacc, role, name,
|
2007-06-04 12:31:30 +00:00
|
|
|
"");
|
2004-03-19 14:56:28 +00:00
|
|
|
} else {
|
|
|
|
return getAccessibleObjectForRole(xacc, role, name, "");
|
|
|
|
}
|
|
|
|
}
|
2003-01-27 15:27:53 +00:00
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
public static XAccessibleContext getAccessibleObjectForRoleIgnoreShowing(XAccessible xacc,
|
2007-06-04 12:31:30 +00:00
|
|
|
short role,
|
|
|
|
String name,
|
|
|
|
String implName) {
|
2003-01-27 15:27:53 +00:00
|
|
|
XAccessibleContext ac = xacc.getAccessibleContext();
|
2004-03-19 14:56:28 +00:00
|
|
|
if ((ac.getAccessibleRole() == role) &&
|
2007-06-04 12:31:30 +00:00
|
|
|
(ac.getAccessibleName().indexOf(name) > -1) &&
|
|
|
|
(utils.getImplName(ac).indexOf(implName) > -1)) {
|
2013-05-21 16:40:03 +02:00
|
|
|
SearchedAccessible = xacc;
|
2004-03-19 14:56:28 +00:00
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
return ac;
|
|
|
|
} else {
|
|
|
|
int k = ac.getAccessibleChildCount();
|
2004-03-19 14:56:28 +00:00
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
if (ac.getAccessibleChildCount() > 100) {
|
2004-03-19 14:56:28 +00:00
|
|
|
k = 50;
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < k; i++) {
|
2003-01-27 15:27:53 +00:00
|
|
|
try {
|
2004-03-19 14:56:28 +00:00
|
|
|
XAccessibleContext ac1 = getAccessibleObjectForRoleIgnoreShowing(
|
2007-06-04 12:31:30 +00:00
|
|
|
ac.getAccessibleChild(i),
|
|
|
|
role, name, implName);
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
if (ac1 != null) {
|
|
|
|
return ac1;
|
|
|
|
}
|
2003-01-27 15:27:53 +00:00
|
|
|
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
|
|
|
|
System.out.println("Couldn't get Child");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static XAccessibleContext getAccessibleObjectForRole(XAccessible xacc,
|
2007-06-04 12:31:30 +00:00
|
|
|
short role,
|
|
|
|
String name,
|
|
|
|
String implName) {
|
2004-03-19 14:56:28 +00:00
|
|
|
XAccessibleContext ac = xacc.getAccessibleContext();
|
2013-05-21 16:40:03 +02:00
|
|
|
boolean isShowing = ac.getAccessibleStateSet()
|
|
|
|
.contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
|
2008-09-30 07:44:27 +00:00
|
|
|
|
|
|
|
// hotfix for i91828:
|
2013-04-23 09:08:33 +02:00
|
|
|
// if role to search is 0 then ignore the role.
|
2008-09-30 07:44:27 +00:00
|
|
|
if ( (role == 0 || ac.getAccessibleRole() == role) &&
|
2007-06-04 12:31:30 +00:00
|
|
|
(ac.getAccessibleName().indexOf(name) > -1) &&
|
|
|
|
(utils.getImplName(ac).indexOf(implName) > -1) &&
|
|
|
|
isShowing) {
|
2013-05-21 16:40:03 +02:00
|
|
|
SearchedAccessible = xacc;
|
2004-03-19 14:56:28 +00:00
|
|
|
return ac;
|
|
|
|
} else {
|
|
|
|
int k = ac.getAccessibleChildCount();
|
|
|
|
|
|
|
|
if (ac.getAccessibleChildCount() > 100) {
|
|
|
|
k = 50;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < k; i++) {
|
|
|
|
try {
|
|
|
|
XAccessibleContext ac1 = getAccessibleObjectForRole(
|
2007-06-04 12:31:30 +00:00
|
|
|
ac.getAccessibleChild(i),
|
|
|
|
role, name, implName);
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
if (ac1 != null) {
|
|
|
|
return ac1;
|
|
|
|
}
|
|
|
|
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
|
|
|
|
System.out.println("Couldn't get Child");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
|
|
|
|
2004-11-02 10:47:31 +00:00
|
|
|
public static void printAccessibleTree(PrintWriter log, XAccessible xacc, boolean debugIsActive) {
|
|
|
|
debug = debugIsActive;
|
2005-02-24 16:22:34 +00:00
|
|
|
if (debug) printAccessibleTree(log, xacc, "");
|
2004-11-02 10:47:31 +00:00
|
|
|
}
|
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
public static void printAccessibleTree(PrintWriter log, XAccessible xacc) {
|
|
|
|
printAccessibleTree(log, xacc, "");
|
|
|
|
}
|
|
|
|
|
2014-08-08 12:44:57 +02:00
|
|
|
private static void printAccessibleTree(PrintWriter log,
|
2007-06-04 12:31:30 +00:00
|
|
|
XAccessible xacc, String indent) {
|
2005-02-24 16:22:34 +00:00
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
XAccessibleContext ac = xacc.getAccessibleContext();
|
|
|
|
|
2004-11-02 10:47:31 +00:00
|
|
|
logging(log,indent + ac.getAccessibleRole() + "," +
|
2007-06-04 12:31:30 +00:00
|
|
|
ac.getAccessibleName() + "(" +
|
|
|
|
ac.getAccessibleDescription() + "):" +
|
|
|
|
utils.getImplName(ac));
|
2004-03-19 14:56:28 +00:00
|
|
|
|
2012-06-27 15:40:17 +02:00
|
|
|
XAccessibleComponent aComp = UnoRuntime.queryInterface(
|
2007-06-04 12:31:30 +00:00
|
|
|
XAccessibleComponent.class, xacc);
|
2003-01-27 15:27:53 +00:00
|
|
|
|
2003-02-21 07:27:34 +00:00
|
|
|
if (aComp != null) {
|
2004-03-19 14:56:28 +00:00
|
|
|
String bounds = "(" + aComp.getBounds().X + "," +
|
2007-06-04 12:31:30 +00:00
|
|
|
aComp.getBounds().Y + ")" + " (" +
|
|
|
|
aComp.getBounds().Width + "," +
|
|
|
|
aComp.getBounds().Height + ")";
|
2004-03-19 14:56:28 +00:00
|
|
|
bounds = "The boundary Rectangle is " + bounds;
|
2004-11-02 10:47:31 +00:00
|
|
|
logging(log,indent + indent + bounds);
|
2003-02-21 07:27:34 +00:00
|
|
|
}
|
|
|
|
|
2013-05-21 16:40:03 +02:00
|
|
|
boolean isShowing = ac.getAccessibleStateSet()
|
|
|
|
.contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
|
2004-11-02 10:47:31 +00:00
|
|
|
logging(log,indent + indent + "StateType contains SHOWING: " +
|
2007-06-04 12:31:30 +00:00
|
|
|
isShowing);
|
2003-02-21 07:27:34 +00:00
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
int k = ac.getAccessibleChildCount();
|
|
|
|
|
|
|
|
if (ac.getAccessibleChildCount() > 100) {
|
2004-03-19 14:56:28 +00:00
|
|
|
k = 50;
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < k; i++) {
|
2003-01-27 15:27:53 +00:00
|
|
|
try {
|
2004-03-19 14:56:28 +00:00
|
|
|
printAccessibleTree(log, ac.getAccessibleChild(i),
|
2007-06-04 12:31:30 +00:00
|
|
|
indent + " ");
|
2003-01-27 15:27:53 +00:00
|
|
|
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
|
|
|
|
System.out.println("Couldn't get Child");
|
|
|
|
}
|
|
|
|
}
|
2004-03-19 14:56:28 +00:00
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
if (ac.getAccessibleChildCount() > 100) {
|
2004-03-19 14:56:28 +00:00
|
|
|
k = ac.getAccessibleChildCount();
|
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
int st = ac.getAccessibleChildCount() - 50;
|
2004-11-02 10:47:31 +00:00
|
|
|
logging(log,indent + " " + " ...... [skipped] ......");
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
for (int i = st; i < k; i++) {
|
2003-01-27 15:27:53 +00:00
|
|
|
try {
|
2004-03-19 14:56:28 +00:00
|
|
|
printAccessibleTree(log, ac.getAccessibleChild(i),
|
2007-06-04 12:31:30 +00:00
|
|
|
indent + " ");
|
2003-01-27 15:27:53 +00:00
|
|
|
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
|
|
|
|
System.out.println("Couldn't get Child");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String accessibleToString(Object AC) {
|
2012-06-27 15:40:17 +02:00
|
|
|
XAccessibleContext xAC = UnoRuntime.queryInterface(
|
2007-06-04 12:31:30 +00:00
|
|
|
XAccessibleContext.class, AC);
|
2004-03-19 14:56:28 +00:00
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
if (xAC != null) {
|
2014-08-20 14:48:54 +02:00
|
|
|
return xAC.getAccessibleRole() + "," +
|
2007-06-04 12:31:30 +00:00
|
|
|
xAC.getAccessibleName() + "(" +
|
|
|
|
xAC.getAccessibleDescription() + "):";
|
2004-03-19 14:56:28 +00:00
|
|
|
}
|
|
|
|
|
2012-06-27 15:40:17 +02:00
|
|
|
XAccessible xA = UnoRuntime.queryInterface(
|
2007-06-04 12:31:30 +00:00
|
|
|
XAccessible.class, AC);
|
2004-03-19 14:56:28 +00:00
|
|
|
|
|
|
|
if (xA == null) {
|
|
|
|
return "(Not supported)";
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
xAC = xA.getAccessibleContext();
|
2004-03-19 14:56:28 +00:00
|
|
|
|
2014-08-20 14:48:54 +02:00
|
|
|
return xAC.getAccessibleRole() + "," + xAC.getAccessibleName() +
|
2007-06-04 12:31:30 +00:00
|
|
|
"(" + xAC.getAccessibleDescription() + ")";
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean equals(XAccessible c1, XAccessible c2) {
|
2004-03-19 14:56:28 +00:00
|
|
|
if ((c1 == null) || (c2 == null)) {
|
|
|
|
return c1 == c2;
|
|
|
|
}
|
|
|
|
|
2003-01-27 15:27:53 +00:00
|
|
|
return AccessibilityTools.equals(c1.getAccessibleContext(),
|
2007-06-04 12:31:30 +00:00
|
|
|
c2.getAccessibleContext());
|
2003-01-27 15:27:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean equals(XAccessibleContext c1, XAccessibleContext c2) {
|
2004-03-19 14:56:28 +00:00
|
|
|
if ((c1 == null) || (c2 == null)) {
|
|
|
|
return c1 == c2;
|
|
|
|
}
|
2003-01-27 15:27:53 +00:00
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
if (c1.getAccessibleRole() != c2.getAccessibleRole()) {
|
|
|
|
return false;
|
|
|
|
}
|
2003-01-27 15:27:53 +00:00
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
if (!c1.getAccessibleName().equals(c2.getAccessibleName())) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!c1.getAccessibleDescription()
|
2007-06-04 12:31:30 +00:00
|
|
|
.equals(c2.getAccessibleDescription())) {
|
2004-03-19 14:56:28 +00:00
|
|
|
return false;
|
|
|
|
}
|
2003-01-27 15:27:53 +00:00
|
|
|
|
2004-03-19 14:56:28 +00:00
|
|
|
if (c1.getAccessibleChildCount() != c2.getAccessibleChildCount()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return AccessibilityTools.equals(c1.getAccessibleParent(),
|
2007-06-04 12:31:30 +00:00
|
|
|
c2.getAccessibleParent());
|
2004-03-19 14:56:28 +00:00
|
|
|
}
|
2004-11-02 10:47:31 +00:00
|
|
|
|
2007-06-04 12:31:30 +00:00
|
|
|
private static void logging(PrintWriter log, String content){
|
|
|
|
if (debug) log.println(content);
|
|
|
|
}
|
2014-01-28 12:46:06 +01:00
|
|
|
}
|