@@ -90,6 +90,8 @@ public abstract class InstallerJDialog<T> extends JDialog {
90
90
private final JButton closeButton ;
91
91
private final JButton dismissErrorMessageButton ;
92
92
93
+ protected int previousRowAtPoint = -1 ;
94
+
93
95
abstract protected FilteredAbstractTableModel <T > createContribModel ();
94
96
95
97
abstract protected TableCellRenderer createCellRenderer ();
@@ -120,6 +122,7 @@ public InstallerJDialog(Frame parent, String title, ModalityType applicationModa
120
122
filterField = new FilterJTextField (tr ("Filter your search..." )) {
121
123
@ Override
122
124
protected void onFilter (String [] _filters ) {
125
+ previousRowAtPoint = -1 ;
123
126
filters = _filters ;
124
127
if (contribTable .getCellEditor () != null ) {
125
128
contribTable .getCellEditor ().stopCellEditing ();
@@ -171,12 +174,10 @@ public void keyReleased(KeyEvent keyEvent) {
171
174
172
175
contribTable .addMouseMotionListener (new MouseMotionListener () {
173
176
174
- int previousRowAtPoint = -1 ;
175
-
176
177
public void mouseDragged (MouseEvent e ) {}
177
178
178
179
public void mouseMoved (MouseEvent e ) {
179
- // avoid firing edits events until:
180
+ // avoid firing edits events until the mouse changes cell or the user is back on the cell after selecting a dropdown
180
181
int rowAtPoint = contribTable .rowAtPoint (e .getPoint ());
181
182
if (!InstallerTableCell .isDropdownSelected () && rowAtPoint != previousRowAtPoint ) {
182
183
contribTable .editCellAt (rowAtPoint , 0 );
@@ -309,6 +310,7 @@ private void setErrorMessageVisible(boolean visible) {
309
310
@ Override
310
311
public void actionPerformed (ActionEvent event ) {
311
312
DropdownItem <T > selected = (DropdownItem <T >) categoryChooser .getSelectedItem ();
313
+ previousRowAtPoint = -1 ;
312
314
if (categoryFilter == null || !categoryFilter .equals (selected )) {
313
315
categoryFilter = selected .getFilterPredicate ();
314
316
if (contribTable .getCellEditor () != null ) {
0 commit comments