summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorOliver Braun <obr@openoffice.org>2002-08-09 14:10:55 +0000
committerOliver Braun <obr@openoffice.org>2002-08-09 14:10:55 +0000
commit64b1ac11ff54c777f4bb7a51ef0d571edcffb144 (patch)
tree6e8f3b4655de256f3b176e3391055ed483c9c7f2 /accessibility
parentabb1725fe235cbe9fde01dc9f1d3677f21ec6b45 (diff)
#100467# avoid deadlocks with SolarMutex
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java29
1 files changed, 21 insertions, 8 deletions
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java
index 17121248ef31..262dbadc0560 100644
--- a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java
+++ b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleObjectFactory.java,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: obr $ $Date: 2002-08-08 14:12:38 $
+ * last change: $Author: obr $ $Date: 2002-08-09 15:10:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -82,9 +82,21 @@ public class AccessibleObjectFactory {
java.util.Hashtable objectList = new java.util.Hashtable();
XAccessibilityInformationProvider infoProvider;
- public AccessibleObjectFactory(XAccessibilityInformationProvider provider) {
+ private static AccessibleObjectFactory defaultFactory = new AccessibleObjectFactory();
+
+ protected AccessibleObjectFactory() {
+ // FIXME: provide default implementation of XAccessibilityInformationProvider
+// infoProvider = provider;
+ }
+
+ /** Returns the default accessible object factory */
+ public static AccessibleObjectFactory getDefault() {
+ return defaultFactory;
+ }
+
+ /** Sets a new AccessibleInformationProvider to be used by this factory object */
+ public void setInformationProvider(XAccessibilityInformationProvider provider) {
infoProvider = provider;
- System.out.println("ObjectFactory created");
}
public AccessibleObject getAccessibleObject(XAccessible xAccessible, Accessible parent) {
@@ -215,7 +227,8 @@ public class AccessibleObjectFactory {
break;
default:
if( Build.DEBUG) {
- System.out.println("Unmapped role: " + AccessibleRoleMap.toAccessibleRole(info.Role));
+ System.out.println("Unmapped role: " + AccessibleRoleMap.toAccessibleRole(info.Role)
+ + " (id = " + info.Role + ")");
}
o = new AccessibleWindow(AccessibleRoleMap.toAccessibleRole(info.Role), xAccessibleContext);
break;
@@ -264,8 +277,6 @@ public class AccessibleObjectFactory {
// Set the initial values of this accessible object
protected void initializeAccessibleObject(AccessibleObject o, AccessibleComponentInfo info) {
- // Set the factory to retrieve callback on finalize
- o.setObjectFactory(this);
// Set accessible name and description
o.setAccessibleName(info.Name);
@@ -322,7 +333,9 @@ public class AccessibleObjectFactory {
AccessibleObject o = null;
// Check if we already have a wrapper object for this context
synchronized (objectList) {
- WeakReference r = (WeakReference) objectList.remove(oid);
+ // Do not remove the object from the list, may need to recycle
+ // them as long as they are do garbage collected
+ WeakReference r = (WeakReference) objectList.get(oid);
if(r != null) {
o = (AccessibleObject) r.get();
}