summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-04-15 12:00:22 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-04-15 12:00:22 +0000
commite3612e97e50ed9297fe7a7567ec526f73d02d82f (patch)
treec6dda117d9c288d5b9100f03503d4d6c3ac55fca /accessibility
parent9019f1952e44e93f938c39ec204b028bb7164c0c (diff)
INTEGRATION: CWS aqua11y01 (1.4.44); FILE MERGED
2008/02/11 10:29:44 obr 1.4.44.1: #i16061# implementation of getAccessibleAt for lists and some re-arrangement of component states
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/AccessibleStateAdapter.java27
1 files changed, 25 insertions, 2 deletions
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleStateAdapter.java b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleStateAdapter.java
index 68be96133d92..237a555ec227 100644
--- a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleStateAdapter.java
+++ b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleStateAdapter.java
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AccessibleStateAdapter.java,v $
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
* This file is part of OpenOffice.org.
*
@@ -34,6 +34,7 @@ import javax.accessibility.AccessibleState;
import javax.accessibility.AccessibleStateSet;
import com.sun.star.uno.AnyConverter;
+import com.sun.star.accessibility.AccessibleStateType;
import com.sun.star.accessibility.XAccessibleStateSet;
public class AccessibleStateAdapter {
@@ -87,7 +88,7 @@ public class AccessibleStateAdapter {
}
private static void printOutOfSyncMessage(AccessibleState s, java.awt.Component c, boolean enabled) {
- System.err.println("*** ERROR *** " + s + " state out of sync (" + !enabled + ", " + enabled + ") for " + getDisplayName(c));
+ System.err.println("*** ERROR *** " + s + " state out of sync (UNO state set: " + !enabled + ", Java component state: " + enabled + ") for " + getDisplayName(c));
}
public static AccessibleState getAccessibleState(Object any) {
@@ -114,6 +115,28 @@ public class AccessibleStateAdapter {
return ass;
}
+ public static void setComponentState(java.awt.Component c,
+ XAccessibleStateSet xAccessibleStateSet) {
+
+ try {
+ if (xAccessibleStateSet != null) {
+ // Set the boundings of the component if it is visible ..
+ if (!xAccessibleStateSet.contains(AccessibleStateType.VISIBLE)) {
+ c.setVisible(false);
+ }
+ // Set the components' enabled state ..
+ if (!xAccessibleStateSet.contains(AccessibleStateType.ENABLED)) {
+ c.setEnabled(false);
+ }
+ // Set the components' focusable state ..
+ if (!xAccessibleStateSet.contains(AccessibleStateType.FOCUSABLE)) {
+ c.setFocusable(false);
+ }
+ }
+ } catch (com.sun.star.uno.RuntimeException e) {
+ }
+ }
+
public static AccessibleStateSet getAccessibleStateSet(java.awt.Component c,
XAccessibleStateSet xAccessibleStateSet) {