On Thu, 21 Jan 2021 09:33:25 GMT, Alexander Zuev <kiz...@openjdk.org> wrote:

>> Create implementation for NSAccessibilityStaticText protocol
>> 
>> For testing that Label accessibility works fine, I have used something like 
>> https://docs.oracle.com/javase/tutorial/uiswing/examples/components/LabelDemoProject/src/components/LabelDemo.java.
>>  I also tried few other labels with html text. I have verified that the 
>> Voice Over output for JLables is same before and after this change.
>> 
>> The class CommonTextAccessibility has most of the code taken from 
>> JavaTextAccessibility. Only the functions needed for StaticTextAccessibility 
>> have been taken as of now. Few more (not all) functions will be added to 
>> this class from JavaTextAccessiblity when work is done for 
>> NavigableStaticText or TextField, TextArea, Text, Password etc accessibility 
>> roles.
>> 
>> I could not see AccessibleRole.HYPERLINK or "hyperlink" role being used 
>> anywhere. As we are reworking the implementation, I have included both roles 
>> "label" and "hyperlink" as of now.
>
> src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonTextAccessibility.h
>  line 39:
> 
>> 37: - (NSString *)accessibilityValueAttribute;
>> 38: - (NSRange)accessibilityVisibleCharacterRangeAttribute;
>> 39: - (NSString *)accessibilityStringForRangeAttribute:(NSRange)parameter;
> 
> Just wondering: here you don't include nullability flags, but in 
> StaticTextAccessibility you do. Any reason why such inconsistency?

There is no specific reason. I just thought of CommonTextAccessibility class as 
more of a helper class, so di not added these things here. But yes, it makes 
sense to be consistent. I will add the flag here as well and update the PR.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2147

Reply via email to