summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorOliver Braun <obr@openoffice.org>2002-10-02 15:07:52 +0000
committerOliver Braun <obr@openoffice.org>2002-10-02 15:07:52 +0000
commit6d0ccf99654bd5feea1978242d8f636d0d8fdc5a (patch)
treebdfaf6418666511d7b24a7f83ed090337226d97d /accessibility
parent4b72e0ae24f499de97dc5e78b23e6fb962f0cef5 (diff)
#100456# added support for global focus events
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java28
1 files changed, 25 insertions, 3 deletions
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java
index d783beffb3c1..9aa8525b1f70 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.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: obr $ $Date: 2002-10-02 07:05:27 $
+ * last change: $Author: obr $ $Date: 2002-10-02 16:07:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -76,7 +76,7 @@ import drafts.com.sun.star.accessibility.XAccessibleStateSet;
/**
*/
-public class AccessibleObjectFactory {
+public class AccessibleObjectFactory implements XGlobalFocusListener {
// This type is needed for conversions from/to uno Any
public static final Type XAccessibleType = new Type(XAccessible.class);
@@ -120,6 +120,7 @@ public class AccessibleObjectFactory {
/** Sets a new AccessibleInformationProvider to be used by this factory object */
public void setInformationProvider(XAccessibilityInformationProvider provider) {
infoProvider = provider;
+ provider.setGlobalFocusListener(this);
}
/** Returns the AccessibleInformationProvider currently used by this factory object */
@@ -139,6 +140,10 @@ public class AccessibleObjectFactory {
}
}
+ return getAccessibleObject(xAccessibleContext, create, parent);
+ }
+
+ public AccessibleObject getAccessibleObject(XAccessibleContext xAccessibleContext, boolean create, Accessible parent) {
// Ensure that we really got an UNO accessible context
if(xAccessibleContext == null) {
if( Build.DEBUG ) {
@@ -426,6 +431,23 @@ public class AccessibleObjectFactory {
}
}
+ /*
+ * XGlobalFocusListener
+ */
+
+ public void focusGained(XAccessibleContext context) {
+ AccessibleObject ao = getAccessibleObject(context, true, null);
+ if( ao != null ) {
+ ao.getEventProxy().processFocusGained();
+ }
+ }
+
+ public void focusLost(XAccessibleContext context) {
+ AccessibleObject ao = getAccessibleObject(context, false, null);
+ if( ao != null ) {
+ ao.getEventProxy().processFocusLost();
+ }
+ }
}