diff options
author | Andre Fischer <af@openoffice.org> | 2002-06-21 10:25:34 +0000 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2002-06-21 10:25:34 +0000 |
commit | 3de9a572e68db83f5b039b09d09eaa71488884da (patch) | |
tree | 59047706311fadc10a746b2cf0deb4477b4275bf /toolkit/test | |
parent | a54ab690bba6fbb43b7663bd9bf2292674156dce (diff) |
Changed semantic of getAccessibleRoot method. Added getAccessibleObject method.
Diffstat (limited to 'toolkit/test')
-rwxr-xr-x | toolkit/test/accessibility/SimpleOffice.java | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/toolkit/test/accessibility/SimpleOffice.java b/toolkit/test/accessibility/SimpleOffice.java index 2d99be9149ae..281827aac9af 100755 --- a/toolkit/test/accessibility/SimpleOffice.java +++ b/toolkit/test/accessibility/SimpleOffice.java @@ -177,7 +177,7 @@ public class SimpleOffice - public XAccessible getAccessibleRoot (XInterface xObject) + public XAccessible getAccessibleObject (XInterface xObject) { XAccessible xAccessible = null; try @@ -188,7 +188,34 @@ public class SimpleOffice catch (Exception e) { println ( + "caught exception while getting accessible object" + e); + e.printStackTrace(); + } + return xAccessible; + } + + /** Return the root object of the accessibility hierarchy. + */ + public XAccessible getAccessibleRoot (XAccessible xAccessible) + { + try + { + XAccessible xParent = null; + do + { + XAccessibleContext xContext = xAccessible.getAccessibleContext(); + if (xContext != null) + xParent = xContext.getAccessibleParent(); + if (xParent != null) + xAccessible = xParent; + } + while (xParent != null); + } + catch (Exception e) + { + println ( "caught exception while getting accessible root" + e); + e.printStackTrace(); } return xAccessible; } @@ -235,8 +262,6 @@ public class SimpleOffice } - - /** @descr Return the current draw page of the given desktop. */ public XDrawPage getCurrentDrawPage () |