java-atk-wrapper accessibility and openjdk9
Fridrich Strba
fridrich.strba at suse.com
Thu Oct 26 08:35:52 UTC 2017
OK, with the attached patch, the java-atk-wrapper is loaded using the
javax.accessibility.AccessibilityProvider service.
I also modified the required java version in the configure.ac, since
source level 6 cannot be use because of "Hash<>" in the code.
It would be still good condition the compilation of the AtkProvider.java
to the fact one is compiling with java9, since the extended class was
introduced in java 9.
As I said, with this patch the provider is activated with
loadAssistiveTechnologies without having to go to the
fallbackToLoadClassForAT. But, at the end of the day, both bring us to
the same result, the java-atk-wrapper being loaded.
I gave a little thought to the approach of making this a module and
include it in the jdk, but that would mean basically to have distributed
also the libjava-atk-wrapper.so, which would mean the whole package
depending on the Gnome atk stack including gdk and glib. Not something
that would one really want, IMHO.
Cheers
F.
On 26/10/17 09:40, Fridrich Strba wrote:
> Good people,
>
> On 26/10/17 08:40, Fridrich Strba wrote:
>> It looks like the java-atk-wrapper has to implement the
>> https://docs.oracle.com/javase/9/docs/api/javax/accessibility/AccessibilityProvider.html
>>
>> Which, in my understanding means implementing two methods: getName and
>> activate. Not sure whether creating a new class that implements those
>> two methods and where the activate method loads the AtkWrapper class
>> should be enough.
>
> Actually reading the code in java.awt.Toolkit, I realize that
> java-atk-wrapper as it is now can work. For any class that is declared
> as assistive_technologies and does not implement the
> AccessibilityProvider, the java.awt.Toolkit has a static method
> fallbackToLoadClassForAT which loads happily the AtkWrapper with the
> class name from our java-atk-wrapper.jar.
>
> So, this solution, although maybe not as elegant as that, could work.
>
> Cheers
>
> Fridrich
>
> P.S.: It is always possible to implement the AccessibilityProvider by
> dropping the attached file to the wrapper/org/GNOME/Accessibility/
> directory and also craft inside the JAR file a
> META-INF/services/javax.accessibility.AccessibilityProvider with content
> "org.GNOME
> .Accessibility.AtkWrapper"
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jaw-java9.patch
Type: text/x-patch
Size: 4130 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20171026/2168c7b6/jaw-java9.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20171026/2168c7b6/signature.asc>
More information about the distro-pkg-dev
mailing list