Community
Participate
Working Groups
Build Identifier: Reproducable with the rap controls demo. Reproducible: Always Steps to Reproduce: 1. change the TableViewerTab.java with the attached file and start the rap demo (take sorter away from every column) 2. click the button "Create Cell Editor" and activate the cellediting 3. click on the table header line 4. the cell in 1. column und 1. row is selected, but the table selectionIndex gives -1 back.
Created attachment 163253 [details] new file for TableViewerTab
Checked the same TableViewerTab.java in SWT - the selection index is still -1, but there is NO cell highlighting. There is a RAP specific code in FocusCellOwnerDrawHighlighter#focusCellChanged, which forces new selected cell to be marked: if( newCell != null ) { markFocusedCell(null, newCell); } In the original SWT code there is no actual painting (foreground/background change) in that place - only table redraw. One possible solution is to remove the above code from FocusCellOwnerDrawHighlighter#focusCellChanged, but I'm not sure about the consequences on the overall FocusCellOwnerDrawHighlighter behavior.
Hi Ivan, you said: Checked the same TableViewerTab.java in SWT - the selection index is still -1. Does it mean, that this bug is also reproducible in swt TableViewerTab? Or I have misunderstanding for that. Remove some pieces of code from FocusCellOwnerDrawHighlighter#focusCellChanged would make the table selection completely confused. That's not good idea :-( I need this feature always in my apps. Do you have any other idea to resolve this? Many thanks. Wen
In SWT, when you click on the columns header area the Table selection is not changed ( Table#getSelectionIndex() returns -1 ) and visually there is NO selected cell. In RAP, Table#getSelectionIndex() returns -1, but cell( 0, 0 ) is visually marked as selected. The reason for this difference is the code mentioned in comment #2. Wen, did you tested your application with this code: if( newCell != null ) { markFocusedCell(null, newCell); } removed from the FocusCellOwnerDrawHighlighter#focusCellChanged? Can you provide an example that demonstrate the confused table selection?
OK... without this code... the focused cell is not highlighted at least on key navigation. Need to find a proper fix.
Created attachment 163390 [details] Proposed patch In FocusCellOwnerDrawHighlighter#focusCellChanged markFocusedCell method is called only if the corresponding item is selected.
Hi Ivan, your patch code works very well. Thanks a lot :-)
Applied patch to CVS HEAD.