From 8a5025216ecd841adb5257c363e39916fc227055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Timm?= Date: Thu, 12 Jun 2003 06:59:46 +0000 Subject: [PATCH] INTEGRATION: CWS uaa04 (1.4.2); FILE MERGED 2003/06/02 12:49:54 obr 1.4.2.1: #109747# implement getAccessibleContext in a failsafe way, so that it can't kill the dispatch thread of the Java AccessBridge for Windows --- .../java/accessibility/DescendantManager.java | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/accessibility/bridge/org/openoffice/java/accessibility/DescendantManager.java b/accessibility/bridge/org/openoffice/java/accessibility/DescendantManager.java index db79eb3f1a28..5c4dfb63be6a 100644 --- a/accessibility/bridge/org/openoffice/java/accessibility/DescendantManager.java +++ b/accessibility/bridge/org/openoffice/java/accessibility/DescendantManager.java @@ -54,25 +54,27 @@ * * ************************************************************************/ - package org.openoffice.java.accessibility; +import com.sun.star.accessibility.*; +import com.sun.star.uno.AnyConverter; +import com.sun.star.uno.UnoRuntime; + import javax.accessibility.AccessibleState; -import com.sun.star.uno.AnyConverter; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.accessibility.*; public abstract class DescendantManager extends Component { protected XAccessibleSelection unoAccessibleSelection = null; protected javax.accessibility.Accessible activeDescendant = null; protected boolean multiselectable = false; - protected DescendantManager(XAccessible xAccessible, XAccessibleContext xAccessibleContext) { + protected DescendantManager(XAccessible xAccessible, + XAccessibleContext xAccessibleContext) { super(xAccessible, xAccessibleContext); } - protected DescendantManager(XAccessible xAccessible, XAccessibleContext xAccessibleContext, boolean multiselectable) { + protected DescendantManager(XAccessible xAccessible, + XAccessibleContext xAccessibleContext, boolean multiselectable) { super(xAccessible, xAccessibleContext); this.multiselectable = multiselectable; } @@ -80,39 +82,43 @@ public abstract class DescendantManager extends Component { /** * Update the proxy objects appropriatly on property change events */ - protected class AccessibleDescendantManagerListener extends AccessibleUNOComponentListener { - + protected class AccessibleDescendantManagerListener + extends AccessibleUNOComponentListener { protected AccessibleDescendantManagerListener() { - super(); + unoAccessibleSelection = (XAccessibleSelection) UnoRuntime.queryInterface(XAccessibleSelection.class, + unoAccessibleContext); } /** Called by OpenOffice process to notify property changes */ public void notifyEvent(AccessibleEventObject event) { switch (event.EventId) { case AccessibleEventId.SELECTION_CHANGED: - firePropertyChange(javax.accessibility.AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY, null, null); + firePropertyChange(javax.accessibility.AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY, + null, null); + break; + default: super.notifyEvent(event); } } } - protected abstract class AccessibleDescendantManager extends AccessibleUNOComponent + protected abstract class AccessibleDescendantManager + extends AccessibleUNOComponent implements javax.accessibility.AccessibleSelection { - - /** - * Though the class is abstract, this should be called by all sub-classes - */ protected AccessibleDescendantManager() { - super(); + unoAccessibleSelection = (XAccessibleSelection) UnoRuntime.queryInterface(XAccessibleSelection.class, + unoAccessibleContext); } /** Returns an AccessibleStateSet that contains corresponding Java states to the UAA state types */ - protected javax.accessibility.AccessibleStateSet getAccessibleStateSetImpl(XAccessibleStateSet unoAS) { + protected javax.accessibility.AccessibleStateSet getAccessibleStateSetImpl( + XAccessibleStateSet unoAS) { javax.accessibility.AccessibleStateSet states = super.getAccessibleStateSetImpl(unoAS); states.add(AccessibleExtendedState.MANAGES_DESCENDANTS); + if (multiselectable) { states.add(javax.accessibility.AccessibleState.MULTISELECTABLE); } @@ -120,7 +126,6 @@ public abstract class DescendantManager extends Component { return states; } - /* * AccessibleContext */ @@ -198,4 +203,3 @@ public abstract class DescendantManager extends Component { } } } -