Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3fdb10

Browse files
authored
Merge pull request #9145 from joew46167/master
Add in accessibility support for screen readers in board and library managers
2 parents 452ac63 + 6bcd052 commit c3fdb10

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ public ContributedLibraryTableCellJPanel(JTable parentTable, Object value,
193193

194194
desc += "</body></html>";
195195
description.setText(desc);
196+
// copy description to accessibility context for screen readers to use
197+
description.getAccessibleContext().setAccessibleDescription(desc);
196198
description.setBackground(Color.WHITE);
197199

198200
// for modelToView to work, the text area has to be sized. It doesn't

app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ void update(JTable parentTable, Object value, boolean isSelected,
230230

231231
desc += "</body></html>";
232232
description.setText(desc);
233+
// copy description to accessibility context for screen readers to use
234+
description.getAccessibleContext().setAccessibleDescription(desc);
233235
description.setBackground(Color.WHITE);
234236

235237
// for modelToView to work, the text area has to be sized. It doesn't

app/src/cc/arduino/contributions/ui/ProgressJProgressBar.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ public class ProgressJProgressBar extends JProgressBar {
3838

3939
public void setValue(Progress p) {
4040
setValue((int) p.getProgress());
41-
if (p.getStatus() != null)
41+
if (p.getStatus() != null) {
4242
setString(p.getStatus());
43+
// copy status to accessibility context for screen readers to use
44+
getAccessibleContext().setAccessibleDescription(p.getStatus());
45+
// make status focusable so screen readers can get to it
46+
setFocusable(true);
47+
}
4348
}
4449

4550
}

0 commit comments

Comments
 (0)