USEPA / emf

Emissions Modeling Framework (EMF)
6 stars 3 forks source link

accessibility of Data Viewer and Data Editor tables #85

Closed cseppan closed 3 years ago

cseppan commented 3 years ago

Commit e3e6fde0dc6d97956a33fe9df27f9aa4ec08b70d updated the data viewer and data editor table headers to work with screen readers by switching from a custom JPanel/JTextPane TableCellRenderer to directly using DefaultTableCellRenderer with HTML multi-line labels (similar approach as #72).

This update caused problems in Java 8, where the table headers wouldn't scroll horizontally with the table content, so it was reverted (commit 4b0fd19f1f7f7e591e2bcaec8187b7103d716ca2).

cseppan commented 3 years ago

After testing the original update, the scrolling problem is due to setting the preferred height of the table header. The table headers need to be two lines tall (one line for the column name and one line for the column type). For the Data Editor, the first column is just a single line "SELECT". By updating the HTML so this header is two lines SELECT<br>&nbsp; Java automatically makes all the header cells two lines tall, removing the need for the problematic setPreferredSize() call.

Commit 8be5cbb9cc1b223adeac3084739970cbf0eea3c0 restores the original code update and commit 1ecdb132c9e26bb56fd8454119d53b6cc8a8b663 removes setPreferredSize and updates the SELECT column header.