Skip to content

Fix announcing of multi-line state in Java Access Bridge apps#15557

Merged
seanbudd merged 1 commit into
nvaccess:masterfrom
dmitrii-drobotov:14609-Fix-JAB-multiline-state
Oct 3, 2023
Merged

Fix announcing of multi-line state in Java Access Bridge apps#15557
seanbudd merged 1 commit into
nvaccess:masterfrom
dmitrii-drobotov:14609-Fix-JAB-multiline-state

Conversation

@dmitrii-drobotov

@dmitrii-drobotov dmitrii-drobotov commented Oct 2, 2023

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #14609

Summary of the issue:

NVDA doesn't report multi-line state for Java Access Bridge components that expose it.

Description of user facing changes

NVDA will correctly report multi-line state in applications using Java Access Bridge.

Description of development approach

Added mapping from "multiple line" JAB state to NVDA multiline state. There is already a mapping from "multi_line" JAB state to NVDA state, but the string was incorrect, so NVDA didn't announce it. JAB uses the string from the following resource file: https://github.com/openjdk/jdk/blob/516cfb135f7e5fefaf6e6f2928f6ecb88806f1ef/src/java.desktop/share/classes/com/sun/accessibility/internal/resources/accessibility_en.properties#L114. Existing "multi_line" value probably comes from the name of Java's AccessibleState.MULTI_LINE const, but it doesn't seem to have ever been used as a resource value after looking at the git history. I still kept it in the mapping to ensure backwards compatibility: while unlikely, it's possible that in older Java versions the value was "multi_line".

Testing strategy:

Manual testing with the sample app from #14609. NVDA output before and after the changes:

Before

Single-line text: edit read only This is a text
tab
filler
Multi-line text: edit read only This is the first part of a

After

Single-line text: edit read only This is a text
tab
filler
Multi-line text: edit read only multi line This is the first part of a

Multi-line text is now correctly reported as "multi line". NVDA still reads only the first line, but this seems to be the same as with other read only multiline edits (e.g. NVDA Speech Viewer). Up/down arrows can still navigate the text, and the NVDA+down shortcut will read the whole text.

Known issues with pull request:

None.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

"multiple line" is the string that JAB returns for AccessibleState.MULTI_LINE.
"multi_line" is still kept in the mapping to ensure backwards compatibility.
@OzancanKaratas

Copy link
Copy Markdown
Collaborator

Please do not touch the changes file. This file will be changed by NV Access.

@dmitrii-drobotov

Copy link
Copy Markdown
Contributor Author

Please do not touch the changes file. This file will be changed by NV Access.

I believe the current practice is to modify the change log file directly in PR: #15475. It's also stated in the contributing guide which I was following.

@OzancanKaratas

Copy link
Copy Markdown
Collaborator

No. Do not revert. I misled you because I was not aware of the final decision. I am sorry.

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Oct 2, 2023

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanbudd

seanbudd commented Oct 3, 2023

Copy link
Copy Markdown
Member

Given that multi line content is expected to require multi-line navigation to read the full text, I am going to say this closes #14609

@seanbudd seanbudd merged commit 2adb77c into nvaccess:master Oct 3, 2023
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA does not announce the multi-line state and the complete multi-line text of a JTextArea (JAB)

4 participants