summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorOliver Braun <obr@openoffice.org>2002-08-16 12:13:09 +0000
committerOliver Braun <obr@openoffice.org>2002-08-16 12:13:09 +0000
commitc13376f492be86d94efc082d402f85f424835d0e (patch)
treee0ea0689b047b138864b08063492eb996a9a430f /accessibility
parent914e154325ebb61a7a907a0d671ae4bf824e1e1e (diff)
#100201#, #101302# completed JDK 1.4 interface and removed deadlocks
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/AccessibleKeyBinding.java403
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java151
-rwxr-xr-xaccessibility/bridge/org/openoffice/java/accessibility/makefile.mk8
3 files changed, 501 insertions, 61 deletions
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleKeyBinding.java b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleKeyBinding.java
new file mode 100644
index 000000000000..118b7588e5b8
--- /dev/null
+++ b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleKeyBinding.java
@@ -0,0 +1,403 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleKeyBinding.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: obr $ $Date: 2002-08-16 13:13:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (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.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package org.openoffice.java.accessibility;
+
+import org.openoffice.accessibility.internal.*;
+
+/**
+ *
+ */
+public class AccessibleKeyBinding extends Object implements javax.accessibility.AccessibleKeyBinding {
+
+ javax.swing.KeyStroke[] data;
+
+ public AccessibleKeyBinding(KeyStroke[] keys) {
+ data = new javax.swing.KeyStroke[keys.length];
+
+ for(int i=0; i<keys.length; i++) {
+ data[i] = javax.swing.KeyStroke.getKeyStroke(
+ convertKeyCode(keys[i].KeyCode),
+ convertModifiers(keys[i].Modifiers)
+ );
+ }
+ }
+
+ public static int convertModifiers(short s) {
+ int modifiers = 0;
+
+ if( (s & com.sun.star.awt.KeyModifier.SHIFT) != 0 ) {
+ modifiers = modifiers | java.awt.event.KeyEvent.VK_SHIFT;
+ }
+
+ if( (s & com.sun.star.awt.KeyModifier.MOD1) != 0 ) {
+ modifiers = modifiers | java.awt.event.KeyEvent.VK_CONTROL;
+ }
+
+ if( (s & com.sun.star.awt.KeyModifier.MOD2) != 0 ) {
+ modifiers = modifiers | java.awt.event.KeyEvent.VK_ALT;
+ }
+
+ return modifiers;
+ }
+
+ static int convertKeyCode(short s) {
+ int keycode = java.awt.event.KeyEvent.VK_UNDEFINED;
+
+ switch( s ) {
+ case com.sun.star.awt.Key.NUM0:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD0;
+ break;
+ case com.sun.star.awt.Key.NUM1:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD1;
+ break;
+ case com.sun.star.awt.Key.NUM2:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD2;
+ break;
+ case com.sun.star.awt.Key.NUM3:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD3;
+ break;
+ case com.sun.star.awt.Key.NUM4:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD4;
+ break;
+ case com.sun.star.awt.Key.NUM5:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD5;
+ break;
+ case com.sun.star.awt.Key.NUM6:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD6;
+ break;
+ case com.sun.star.awt.Key.NUM7:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD7;
+ break;
+ case com.sun.star.awt.Key.NUM8:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD8;
+ break;
+ case com.sun.star.awt.Key.NUM9:
+ keycode = java.awt.event.KeyEvent.VK_NUMPAD9;
+ break;
+ case com.sun.star.awt.Key.A:
+ keycode = java.awt.event.KeyEvent.VK_A;
+ break;
+ case com.sun.star.awt.Key.B:
+ keycode = java.awt.event.KeyEvent.VK_B;
+ break;
+ case com.sun.star.awt.Key.C:
+ keycode = java.awt.event.KeyEvent.VK_C;
+ break;
+ case com.sun.star.awt.Key.D:
+ keycode = java.awt.event.KeyEvent.VK_D;
+ break;
+ case com.sun.star.awt.Key.E:
+ keycode = java.awt.event.KeyEvent.VK_E;
+ break;
+ case com.sun.star.awt.Key.F:
+ keycode = java.awt.event.KeyEvent.VK_F;
+ break;
+ case com.sun.star.awt.Key.G:
+ keycode = java.awt.event.KeyEvent.VK_G;
+ break;
+ case com.sun.star.awt.Key.H:
+ keycode = java.awt.event.KeyEvent.VK_H;
+ break;
+ case com.sun.star.awt.Key.I:
+ keycode = java.awt.event.KeyEvent.VK_I;
+ break;
+ case com.sun.star.awt.Key.J:
+ keycode = java.awt.event.KeyEvent.VK_J;
+ break;
+ case com.sun.star.awt.Key.K:
+ keycode = java.awt.event.KeyEvent.VK_K;
+ break;
+ case com.sun.star.awt.Key.L:
+ keycode = java.awt.event.KeyEvent.VK_L;
+ break;
+ case com.sun.star.awt.Key.M:
+ keycode = java.awt.event.KeyEvent.VK_M;
+ break;
+ case com.sun.star.awt.Key.N:
+ keycode = java.awt.event.KeyEvent.VK_N;
+ break;
+ case com.sun.star.awt.Key.O:
+ keycode = java.awt.event.KeyEvent.VK_O;
+ break;
+ case com.sun.star.awt.Key.P:
+ keycode = java.awt.event.KeyEvent.VK_P;
+ break;
+ case com.sun.star.awt.Key.Q:
+ keycode = java.awt.event.KeyEvent.VK_Q;
+ break;
+ case com.sun.star.awt.Key.R:
+ keycode = java.awt.event.KeyEvent.VK_R;
+ break;
+ case com.sun.star.awt.Key.S:
+ keycode = java.awt.event.KeyEvent.VK_S;
+ break;
+ case com.sun.star.awt.Key.T:
+ keycode = java.awt.event.KeyEvent.VK_T;
+ break;
+ case com.sun.star.awt.Key.U:
+ keycode = java.awt.event.KeyEvent.VK_U;
+ break;
+ case com.sun.star.awt.Key.V:
+ keycode = java.awt.event.KeyEvent.VK_V;
+ break;
+ case com.sun.star.awt.Key.W:
+ keycode = java.awt.event.KeyEvent.VK_W;
+ break;
+ case com.sun.star.awt.Key.X:
+ keycode = java.awt.event.KeyEvent.VK_X;
+ break;
+ case com.sun.star.awt.Key.Y:
+ keycode = java.awt.event.KeyEvent.VK_Y;
+ break;
+ case com.sun.star.awt.Key.Z:
+ keycode = java.awt.event.KeyEvent.VK_Z;
+ break;
+ case com.sun.star.awt.Key.F1:
+ keycode = java.awt.event.KeyEvent.VK_F1;
+ break;
+ case com.sun.star.awt.Key.F2:
+ keycode = java.awt.event.KeyEvent.VK_F2;
+ break;
+ case com.sun.star.awt.Key.F3:
+ keycode = java.awt.event.KeyEvent.VK_F3;
+ break;
+ case com.sun.star.awt.Key.F4:
+ keycode = java.awt.event.KeyEvent.VK_F4;
+ break;
+ case com.sun.star.awt.Key.F5:
+ keycode = java.awt.event.KeyEvent.VK_F5;
+ break;
+ case com.sun.star.awt.Key.F6:
+ keycode = java.awt.event.KeyEvent.VK_F6;
+ break;
+ case com.sun.star.awt.Key.F7:
+ keycode = java.awt.event.KeyEvent.VK_F7;
+ break;
+ case com.sun.star.awt.Key.F8:
+ keycode = java.awt.event.KeyEvent.VK_F8;
+ break;
+ case com.sun.star.awt.Key.F9:
+ keycode = java.awt.event.KeyEvent.VK_F9;
+ break;
+ case com.sun.star.awt.Key.F10:
+ keycode = java.awt.event.KeyEvent.VK_F10;
+ break;
+ case com.sun.star.awt.Key.F11:
+ keycode = java.awt.event.KeyEvent.VK_F11;
+ break;
+ case com.sun.star.awt.Key.F12:
+ keycode = java.awt.event.KeyEvent.VK_F12;
+ break;
+ case com.sun.star.awt.Key.F13:
+ keycode = java.awt.event.KeyEvent.VK_F13;
+ break;
+ case com.sun.star.awt.Key.F14:
+ keycode = java.awt.event.KeyEvent.VK_F14;
+ break;
+ case com.sun.star.awt.Key.F15:
+ keycode = java.awt.event.KeyEvent.VK_F15;
+ break;
+ case com.sun.star.awt.Key.F16:
+ keycode = java.awt.event.KeyEvent.VK_F16;
+ break;
+ case com.sun.star.awt.Key.F17:
+ keycode = java.awt.event.KeyEvent.VK_F17;
+ break;
+ case com.sun.star.awt.Key.F18:
+ keycode = java.awt.event.KeyEvent.VK_F18;
+ break;
+ case com.sun.star.awt.Key.F19:
+ keycode = java.awt.event.KeyEvent.VK_F19;
+ break;
+ case com.sun.star.awt.Key.F20:
+ keycode = java.awt.event.KeyEvent.VK_F20;
+ break;
+ case com.sun.star.awt.Key.F21:
+ keycode = java.awt.event.KeyEvent.VK_F21;
+ break;
+ case com.sun.star.awt.Key.F22:
+ keycode = java.awt.event.KeyEvent.VK_F22;
+ break;
+ case com.sun.star.awt.Key.F23:
+ keycode = java.awt.event.KeyEvent.VK_F23;
+ break;
+ case com.sun.star.awt.Key.F24:
+ keycode = java.awt.event.KeyEvent.VK_F24;
+ break;
+ case com.sun.star.awt.Key.DOWN:
+ keycode = java.awt.event.KeyEvent.VK_DOWN;
+ break;
+ case com.sun.star.awt.Key.UP:
+ keycode = java.awt.event.KeyEvent.VK_UP;
+ break;
+ case com.sun.star.awt.Key.LEFT:
+ keycode = java.awt.event.KeyEvent.VK_LEFT;
+ break;
+ case com.sun.star.awt.Key.RIGHT:
+ keycode = java.awt.event.KeyEvent.VK_RIGHT;
+ break;
+ case com.sun.star.awt.Key.HOME:
+ keycode = java.awt.event.KeyEvent.VK_HOME;
+ break;
+ case com.sun.star.awt.Key.END:
+ keycode = java.awt.event.KeyEvent.VK_END;
+ break;
+ case com.sun.star.awt.Key.PAGEUP:
+ keycode = java.awt.event.KeyEvent.VK_PAGE_UP;
+ break;
+ case com.sun.star.awt.Key.PAGEDOWN:
+ keycode = java.awt.event.KeyEvent.VK_PAGE_DOWN;
+ break;
+ case com.sun.star.awt.Key.RETURN:
+ keycode = java.awt.event.KeyEvent.VK_ENTER;
+ break;
+ case com.sun.star.awt.Key.ESCAPE:
+ keycode = java.awt.event.KeyEvent.VK_ESCAPE;
+ break;
+ case com.sun.star.awt.Key.TAB:
+ keycode = java.awt.event.KeyEvent.VK_TAB;
+ break;
+ case com.sun.star.awt.Key.BACKSPACE:
+ keycode = java.awt.event.KeyEvent.VK_BACK_SPACE;
+ break;
+ case com.sun.star.awt.Key.SPACE:
+ keycode = java.awt.event.KeyEvent.VK_SPACE;
+ break;
+ case com.sun.star.awt.Key.INSERT:
+ keycode = java.awt.event.KeyEvent.VK_INSERT;
+ break;
+ case com.sun.star.awt.Key.DELETE:
+ keycode = java.awt.event.KeyEvent.VK_DELETE;
+ break;
+ case com.sun.star.awt.Key.ADD:
+ keycode = java.awt.event.KeyEvent.VK_ADD;
+ break;
+ case com.sun.star.awt.Key.SUBTRACT:
+ keycode = java.awt.event.KeyEvent.VK_SUBTRACT;
+ break;
+ case com.sun.star.awt.Key.MULTIPLY:
+ keycode = java.awt.event.KeyEvent.VK_MULTIPLY;
+ break;
+ case com.sun.star.awt.Key.DIVIDE:
+ keycode = java.awt.event.KeyEvent.VK_DIVIDE;
+ break;
+ case com.sun.star.awt.Key.POINT:
+ keycode = java.awt.event.KeyEvent.VK_PERIOD;
+ break;
+ case com.sun.star.awt.Key.COMMA:
+ keycode = java.awt.event.KeyEvent.VK_COMMA;
+ break;
+ case com.sun.star.awt.Key.LESS:
+ keycode = java.awt.event.KeyEvent.VK_LESS;
+ break;
+ case com.sun.star.awt.Key.GREATER:
+ keycode = java.awt.event.KeyEvent.VK_GREATER;
+ break;
+ case com.sun.star.awt.Key.EQUAL:
+ keycode = java.awt.event.KeyEvent.VK_EQUALS;
+ break;
+ case com.sun.star.awt.Key.CUT:
+ keycode = java.awt.event.KeyEvent.VK_CUT;
+ break;
+ case com.sun.star.awt.Key.COPY:
+ keycode = java.awt.event.KeyEvent.VK_COPY;
+ break;
+ case com.sun.star.awt.Key.PASTE:
+ keycode = java.awt.event.KeyEvent.VK_PASTE;
+ break;
+ case com.sun.star.awt.Key.UNDO:
+ keycode = java.awt.event.KeyEvent.VK_UNDO;
+ break;
+ case com.sun.star.awt.Key.FIND:
+ keycode = java.awt.event.KeyEvent.VK_FIND;
+ break;
+ case com.sun.star.awt.Key.PROPERTIES:
+ keycode = java.awt.event.KeyEvent.VK_PROPS;
+ break;
+ case com.sun.star.awt.Key.HELP:
+ keycode = java.awt.event.KeyEvent.VK_HELP;
+ break;
+ default:
+ ;
+ }
+
+ return keycode;
+ }
+
+ /*
+ * AccessibleKeyBinding
+ */
+
+ /** Returns a key binding for this object */
+ public Object getAccessibleKeyBinding(int i) {
+ if( i < data.length ) {
+ return data[i];
+ }
+
+ return null;
+ }
+
+ /** Returns the number of key bindings for this object */
+ public int getAccessibleKeyBindingCount() {
+ return data.length;
+ }
+}
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java
index 6621edafb7bc..641d094a8e30 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.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: obr $ $Date: 2002-08-14 12:12:12 $
+ * last change: $Author: obr $ $Date: 2002-08-16 13:13:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,6 +89,27 @@ public class AccessibleObjectFactory {
// infoProvider = provider;
}
+ public class GenericAccessibleParent extends Object implements javax.accessibility.Accessible {
+ XAccessibleContext unoObject;
+ AccessibleObject wrapperObject;
+
+ public GenericAccessibleParent(AccessibleObject o, XAccessibleContext ac) {
+ unoObject = ac;
+ wrapperObject = o;
+ }
+
+ public javax.accessibility.AccessibleContext getAccessibleContext() {
+ XAccessible xAccessible = unoObject.getAccessibleParent();
+ if( xAccessible != null ) {
+ AccessibleObject o = AccessibleObjectFactory.this.getAccessibleObject(xAccessible, true, null);
+ wrapperObject.setAccessibleParent(o);
+ return o;
+ }
+
+ return null;
+ }
+ }
+
/** Returns the default accessible object factory */
public static AccessibleObjectFactory getDefault() {
return defaultFactory;
@@ -99,28 +120,35 @@ public class AccessibleObjectFactory {
infoProvider = provider;
}
- public AccessibleObject getAccessibleObject(XAccessible xAccessible, Accessible parent) {
- XAccessibleContext xAccessibleContext = null;
+ /** Returns the AccessibleInformationProvider currently used by this factory object */
+ public XAccessibilityInformationProvider getInformationProvider() {
+ return infoProvider;
+ }
- if(xAccessible == null) {
- return null;
- }
+ public AccessibleObject getAccessibleObject(XAccessible xAccessible, boolean create, Accessible parent) {
+ XAccessibleContext xAccessibleContext = null;
- // Save the round trip to C++ UNO if possible
- if(xAccessible instanceof XAccessibleContext) {
- xAccessibleContext = (XAccessibleContext) xAccessible;
- } else {
- xAccessibleContext = xAccessible.getAccessibleContext();
+ if(xAccessible != null) {
+ // Save the round trip to C++ UNO if possible
+ if(xAccessible instanceof XAccessibleContext) {
+ xAccessibleContext = (XAccessibleContext) xAccessible;
+ } else {
+ xAccessibleContext = xAccessible.getAccessibleContext();
+ }
}
// Ensure that we really got an UNO accessible context
if(xAccessibleContext == null) {
+ if( Build.DEBUG ) {
+ System.err.println("No accessible context");
+ }
return null;
}
// Retrieve unique id for the original UNO object to be used as a hash key
String oid = UnoRuntime.generateOid(xAccessibleContext);
AccessibleObject o = null;
+
// Check if we already have a wrapper object for this context
synchronized (objectList) {
WeakReference r = (WeakReference) objectList.get(oid);
@@ -128,7 +156,8 @@ public class AccessibleObjectFactory {
o = (AccessibleObject) r.get();
}
}
- if( o == null ) {
+
+ if( o == null && create ) {
AccessibleContextInfo info = infoProvider.getAccessibleContextInfo(xAccessibleContext);
switch(info.Role) {
@@ -164,6 +193,9 @@ public class AccessibleObjectFactory {
);
break;
case AccessibleRole.ICON:
+ case AccessibleRole.GRAPHIC:
+ case AccessibleRole.SHAPE:
+ case AccessibleRole.EMBEDDED_OBJECT:
o = new AccessibleImage(xAccessibleContext);
break;
case AccessibleRole.LISTITEM:
@@ -223,11 +255,11 @@ public class AccessibleObjectFactory {
case AccessibleRole.FOOTNOTE:
case AccessibleRole.HEADER:
case AccessibleRole.LAYEREDPANE:
+ case AccessibleRole.OPTIONPANE:
case AccessibleRole.PAGETAB:
case AccessibleRole.PANEL:
case AccessibleRole.ROOTPANE:
case AccessibleRole.SCROLLPANE:
- case AccessibleRole.SHAPE:
case AccessibleRole.SPLITPANE:
case AccessibleRole.STATUSBAR:
case AccessibleRole.TOOLBAR:
@@ -242,7 +274,10 @@ public class AccessibleObjectFactory {
System.out.println("Unmapped role: " + AccessibleRoleMap.toAccessibleRole(info.Role)
+ " (id = " + info.Role + ")");
}
- o = new AccessibleWindow(AccessibleRoleMap.toAccessibleRole(info.Role), xAccessibleContext);
+ o = new AccessibleWindow(
+ AccessibleRoleMap.toAccessibleRole(info.Role),
+ xAccessibleContext
+ );
break;
}
@@ -265,14 +300,18 @@ public class AccessibleObjectFactory {
* using dispose().
*/
synchronized (o) {
- initializeAccessibleObject(o,
- infoProvider.getAccessibleComponentInfo(xAccessibleContext, listener)
- );
+ o.initialize(infoProvider.getAccessibleComponentInfo(xAccessibleContext, listener));
+ }
+
+ // Create generic parent if parent is null
+ if( parent == null && info.IndexInParent != -1 ) {
+ parent = new GenericAccessibleParent(o, xAccessibleContext);
}
// Finaly set accessible parent object
- // FIXME: create temporary parent if parent is null !!
- o.setAccessibleParent(parent);
+ if( parent != null ) {
+ o.setAccessibleParent(parent);
+ }
// Add the child to the internal list if parent is AccessibleWindow
if( ((info.States & AccessibleState.CHILDREN_TRANSIENT) == 0) && (parent instanceof AccessibleWindow) ) {
@@ -286,44 +325,7 @@ public class AccessibleObjectFactory {
}
return o;
}
-
- // Set the initial values of this accessible object
- protected void initializeAccessibleObject(AccessibleObject o, AccessibleComponentInfo info) {
-
- // Set accessible name and description
- o.setAccessibleName(info.Name);
- o.setAccessibleDescription(info.Description);
-
- // Set the object boundaries and colors
- o.setBounds(new java.awt.Rectangle(info.Bounds.X, info.Bounds.Y, info.Bounds.Width, info.Bounds.Height));
- o.setForeground(new java.awt.Color(info.ForegroundColor));
- o.setBackground(new java.awt.Color(info.BackgroundColor));
-
- // Fill the state set
- AccessibleStateTypeMap.fillAccessibleStateSet(o.getAccessibleStateSet(), info.States);
-
- // Set the number of children
- if(o instanceof AccessibleWindow) {
- AccessibleWindow w = (AccessibleWindow) o;
- w.setAccessibleChildrenCount(info.ChildrenCount);
- } else if(o instanceof AccessibleMenu) {
- AccessibleMenu m = (AccessibleMenu) o;
- m.setAccessibleChildrenCount(info.ChildrenCount);
- } else if(o instanceof AccessibleFixedText) {
- AccessibleFixedText t = (AccessibleFixedText) o;
- if( info.Text != null )
- t.setText(info.Text);
- else
- t.setText(info.Name);
- } else if(o instanceof AccessibleLabel) {
- AccessibleLabel l = (AccessibleLabel) o;
- if( info.Text != null && info.Text.length() > 0 )
- l.setText(info.Text);
- else
- l.setText(info.Name);
- }
- }
-
+/*
public AccessibleObject removeAccessibleObject(XAccessible xAccessible) {
XAccessibleContext xAccessibleContext = null;
@@ -360,7 +362,7 @@ public class AccessibleObjectFactory {
return null;
}
-
+*/
public static XAccessible toXAccessible(Object any) {
if(AnyConverter.isObject(any)) {
try {
@@ -375,6 +377,37 @@ public class AccessibleObjectFactory {
return null;
}
+ public java.lang.Object[] getAccessibleObjectSet(java.lang.Object o) {
+ java.lang.Object[] list = null;
+
+ if( o instanceof java.lang.Object[] ) {
+ list = (java.lang.Object[]) o;
+ } else if( o instanceof com.sun.star.uno.Any && AnyConverter.isArray(o) ) {
+ try {
+ list = (java.lang.Object[]) AnyConverter.toArray(o);
+ }
+
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ // this should never happen
+ }
+ }
+
+ if( list != null ) {
+ java.util.ArrayList set = new java.util.ArrayList(list.length);
+
+ for(int i=0; i<list.length; i++) {
+ AccessibleObject ao = getAccessibleObject(toXAccessible(list[i]), true, null);
+ if( ao != null ) {
+ set.add(ao);
+ }
+ }
+
+ set.trimToSize();
+ return set.toArray();
+ }
+
+ return null;
+ }
public void releaseAccessibleObject(AccessibleObject o) {
synchronized (objectList) {
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/makefile.mk b/accessibility/bridge/org/openoffice/java/accessibility/makefile.mk
index 852383062072..05bdd3b32ee9 100755
--- a/accessibility/bridge/org/openoffice/java/accessibility/makefile.mk
+++ b/accessibility/bridge/org/openoffice/java/accessibility/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.2 $
+# $Revision: 1.3 $
#
-# last change: $Author: obr $ $Date: 2002-08-14 12:12:13 $
+# last change: $Author: obr $ $Date: 2002-08-16 13:13:09 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -83,6 +83,7 @@ JAVAFILES = \
AccessibleFixedText.java \
AccessibleFrame.java \
AccessibleImage.java \
+ AccessibleKeyBinding.java \
AccessibleLabel.java \
AccessibleListItem.java \
AccessibleMenu.java \
@@ -90,6 +91,7 @@ JAVAFILES = \
AccessibleObjectFactory.java \
AccessibleObject.java \
AccessibleParagraph.java \
+ AccessibleRelationTypeMap.java \
AccessibleRoleMap.java \
AccessibleScrollBar.java \
AccessibleSeparator.java \
@@ -140,3 +142,5 @@ $(JAVADIR)$/$(PACKAGE)$/%.java:
$(CLASSDIR)$/$(PACKAGE)$/Build.class : $(JAVADIR)$/$(PACKAGE)$/Build.java
-+$(JAVAC) -d $(CLASSDIR) $(JAVADIR)$/$(PACKAGE)$/Build.java
+
+$(JAVACLASSFILES) : $(UCR)$/internal.db