Community
Participate
Working Groups
Steps to reproduce: Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Grid grid = new Grid(shell, SWT.NONE); grid.setCellSelectionEnabled(true); GridColumn column = new GridColumn(grid, SWT.NONE); grid.setFocusColumn(column); column.dispose(); grid.getFocusCell(); while (display.readAndDispatch()); display.dispose(); In my opinion the Grid.removeColumn method should set focusColumn = null
I just stumbled across this bug. I took Jacek's suggestion one step farther. void removeColumn(GridColumn column) { // blah blah blah if (focusColumn == column) { focusColumn = null; } // blah blah blah }
Makes sense to me. Want to provide a patch? The it gets P1
Created attachment 138532 [details] Patch set the focusColumn to null when the column I wonder though if we should not go even another step further, which would be to move the focus to the next visible column on the right - or to the left if there is nothing on the right, on both column disposing and hiding - see bug 238713. And the same for item hiding and disposing.
Same happens when the last row is removed from the grid. focusColumn and focusItem should be set to null when appropriate. Since it should be easy to fix it would be nice to push it to P1.
I really wonder how this slipped through that long - naturally the patch didn't apply anymore so I pushed my own version with http://git.eclipse.org/c/nebula/org.eclipse.nebula.git/commit/?id=272199aec6aee8d3b82e3eac8c0fec20beb2d8c7
Tried today => the bug has been fixed in the past.