Skip to content

Commit

Permalink
Merge pull request arduino#9145 from joew46167/master
Browse files Browse the repository at this point in the history
Add in accessibility support for screen readers in board and library managers
  • Loading branch information
facchinm authored Aug 19, 2019
2 parents 452ac63 + 6bcd052 commit c3fdb10
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ public ContributedLibraryTableCellJPanel(JTable parentTable, Object value,

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

// for modelToView to work, the text area has to be sized. It doesn't
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ void update(JTable parentTable, Object value, boolean isSelected,

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

// for modelToView to work, the text area has to be sized. It doesn't
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ public class ProgressJProgressBar extends JProgressBar {

public void setValue(Progress p) {
setValue((int) p.getProgress());
if (p.getStatus() != null)
if (p.getStatus() != null) {
setString(p.getStatus());
// copy status to accessibility context for screen readers to use
getAccessibleContext().setAccessibleDescription(p.getStatus());
// make status focusable so screen readers can get to it
setFocusable(true);
}
}

}

0 comments on commit c3fdb10

Please sign in to comment.