USEPA / emf

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

can't open list of keywords using keyboard #64

Closed cseppan closed 2 years ago

cseppan commented 2 years ago

When adding a keyword to a dataset, the Keyword column is a combo box where you can either type in a new keyword or select from a list of existing keywords. If you click on the value in the Keyword column, you can open the menu listing the existing keywords, either by clicking the triangle or hitting the Down arrow. It's not possible to open up this list solely with the keyboard.

Need to update table to surrender focus on keystroke:

https://docs.oracle.com/javase/8/docs/api/javax/swing/JTable.html#setSurrendersFocusOnKeystroke-boolean-

public void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke) Sets whether editors in this JTable get the keyboard focus when an editor is activated as a result of the JTable forwarding keyboard events for a cell. By default, this property is false, and the JTable retains the focus unless the cell is clicked.

Look at implications of adding this to EditableTable in Commons lib (base widget is used by data editor table).

cseppan commented 2 years ago

Commit 96164ea94d16cdd90f2587fb4c450eb4552ae04a calls setSurrendersFocusOnKeystroke(true); for EditableTable in Commons. This fixes the Keyword pull-down menu and also makes editing text better anywhere EditableTable is used (shows the cursor, lets arrow keys move back and forth in the text instead of switching cells).

Hitting the Escape key starts and stops editing a cell, the same as double-clicking the cell.