From 23bee84fedbd373b5f721f6b3183d18f58da67c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Timm?= Date: Tue, 2 Nov 2004 13:31:26 +0000 Subject: [PATCH] INTEGRATION: CWS accessbugs01 (1.7.26); FILE MERGED 2004/09/10 10:19:32 obr 1.7.26.1: #i34056# Reworked AccessibleState mapping --- .../java/accessibility/Container.java | 78 ++----------------- 1 file changed, 7 insertions(+), 71 deletions(-) diff --git a/accessibility/bridge/org/openoffice/java/accessibility/Container.java b/accessibility/bridge/org/openoffice/java/accessibility/Container.java index d3500782c2c2..0cee018bea81 100644 --- a/accessibility/bridge/org/openoffice/java/accessibility/Container.java +++ b/accessibility/bridge/org/openoffice/java/accessibility/Container.java @@ -440,70 +440,6 @@ public class Container extends java.awt.Container implements javax.accessibility */ } - /** Check if the parent of an selectable object supports AccessibleSelection */ - protected void dbgCheckSelectable() { - javax.accessibility.Accessible parent = getAccessibleParent(); - if (parent != null) { - javax.accessibility.AccessibleContext parentAC = parent.getAccessibleContext(); - if (parentAC != null) { - if (parentAC.getAccessibleSelection() == null) { - System.err.println("*** ERROR *** Object claims to be selectable, but parent does not support AccessibleSelection"); - } - } else { - System.err.println("*** ERROR *** Object claims to be selectable, but parent is not accessible"); - } - } else { - System.err.println("*** ERROR *** Object claims to be selectable, but has no accessible parent"); - } - } - - /** Returns an AccessibleStateSet that contains corresponding Java states to the UAA state types */ - protected javax.accessibility.AccessibleStateSet getAccessibleStateSetImpl(XAccessibleStateSet unoAS) { - javax.accessibility.AccessibleStateSet states = new javax.accessibility.AccessibleStateSet(); - if (Container.this.isEnabled()) { - states.add(AccessibleState.ENABLED); - } - if (Container.this.isFocusTraversable()) { - states.add(AccessibleState.FOCUSABLE); - } - if (Container.this.isVisible()) { - states.add(AccessibleState.VISIBLE); - } - if (Container.this.isShowing()) { - states.add(AccessibleState.SHOWING); - } - if (Container.this.isFocusOwner()) { - states.add(AccessibleState.FOCUSED); - } - - try { - if (unoAS != null) { - if (unoAS.contains(AccessibleStateType.SELECTABLE)) { - states.add(AccessibleState.SELECTABLE); - } - if (unoAS.contains(AccessibleStateType.SELECTED)) { - states.add(AccessibleState.SELECTED); - - if (Build.DEBUG) { - dbgCheckSelectable(); - } - } - if (unoAS.contains(AccessibleStateType.MULTI_SELECTABLE)) { - states.add(AccessibleState.MULTISELECTABLE); - } - if (unoAS.contains(AccessibleStateType.HORIZONTAL)) { - states.add(AccessibleState.HORIZONTAL); - } - if (unoAS.contains(AccessibleStateType.VERTICAL)) { - states.add(AccessibleState.VERTICAL); - } - } - } catch (com.sun.star.uno.RuntimeException e) { - } - - return states; - } - protected java.awt.event.ComponentListener accessibleComponentHandler = null; /** @@ -640,15 +576,15 @@ public class Container extends java.awt.Container implements javax.accessibility * containing the current state set of the object * @see AccessibleState */ - public final javax.accessibility.AccessibleStateSet getAccessibleStateSet() { + public javax.accessibility.AccessibleStateSet getAccessibleStateSet() { + if (disposed) + return AccessibleStateAdapter.getDefunctStateSet(); + try { - XAccessibleStateSet unoASS = null; - if ( !disposed ) { - unoASS = unoAccessibleContext.getAccessibleStateSet(); - } - return getAccessibleStateSetImpl(unoASS); + return AccessibleStateAdapter.getAccessibleStateSet(Container.this, + unoAccessibleContext.getAccessibleStateSet()); } catch (com.sun.star.uno.RuntimeException e) { - return getAccessibleStateSetImpl(null); + return AccessibleStateAdapter.getDefunctStateSet(); } }