On Tue, 8 Jun 2021 13:06:53 GMT, Artem Semenov <github.com+36081106+savop...@openjdk.org> wrote:
> 8267385: Create NSAccessibilityElement implementation for > JavaComponentAccessibility > This pull request contains solutions for the following tickets: > * JDK-8267385 Create NSAccessibilityElement implementation for > JavaComponentAccessibility; > * JDK-8262031 Create implementation for NSAccessibilityNavigableStaticText > protocol; > * JDK-8264287 Create implementation for NSAccessibilityComboBox protocol peer; > * JDK-8264303 Create implementation for NSAccessibilityTabGroup protocol peer; > * JDK-8264292 Create implementation for NSAccessibilityList protocol peer; > * JDK-8267387 Create implementation for NSAccessibilityOutline protocol; > * JDK-8267388 Create implementation for NSAccessibilityTable protocol. src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 130: > 128: if (c != null) { > 129: try { > 130: value = EventQueue.isDispatchThread() ? callable.call() > : LWCToolkit.invokeAndWait(callable, c); When this method is called on EDT? src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 556: > 554: ((JList) parent).setSelectedIndex(i); > 555: return; > 556: } Looks like the a11y interface miss "setSelectedIndex" method? The code above will not work for the custom component which uses the "AccessibleJListChild" a11y object? src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m line 50: > 48: #define JAVA_AX_ALL_CHILDREN (-1) > 49: #define JAVA_AX_SELECTED_CHILDREN (-2) > 50: #define JAVA_AX_VISIBLE_CHILDREN (-3) Why not mark them as @native in the CAccessibility and use constants generated by the javac? src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/NavigableTextAccessibility.m line 79: > 77: if (values == NULL) { > 78: // Note: Java will not be on the stack here so a java exception > can't happen and no need to call ExceptionCheck. > 79: NSLog(@"%s failed calling GetDoubleArrayElements", __FUNCTION__); Please clarify the comment above. src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.m line 44: > 42: jclass clsInfo = (*env)->GetObjectClass(env, axContext); > 43: DECLARE_METHOD_RETURN(jm_getAccessibleRowCount, clsInfo, > "getAccessibleRowCount", "()I", 0); > 44: jint javaRowsCount = (*env)->CallIntMethod(env, axContext, > jm_getAccessibleRowCount); Do we need to check the java exception here and in other similar cases? This code is executed on appkit? src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.m line 155: > 153: - (NSArray *)accessibilitySelectedChildren > 154: { > 155: return [self accessibilitySelectedRows]; Does it mean that the children of the table are rows and columns and not "cells".? How it will work if only one cell is selected? test/jdk/java/awt/a11y/AccessibleJComboboxTest.java line 30: > 28: * @summary Create implementation for NSAccessibilityComboBox protocol > peer > 29: * @author artem.seme...@jetbrains.com > 30: * @run main/manual AccessibleJComboboxTest On what platforms these tests are supposed to work? ------------- PR: https://git.openjdk.java.net/jdk/pull/4412