Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 288130

Summary: [Widgets] Table.getItem(Point) returns non-selectable items when header displayed
Product: [Eclipse Project] Platform Reporter: Larry Colson <lcolson>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact: Felipe Heidrich <eclipse.felipe>
Severity: minor    
Priority: P3 CC: lcolson, Silenio_Quarti
Version: 3.5Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
Snippet that illustrates bug none

Description Larry Colson CLA 2009-08-31 10:25:48 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
Build Identifier: I20090611-1540

In a table control, the getItem(Point) method incorrectly returns items that cannot be selected.  This happens when the header bar is displayed.  When the attached snippet is run and spacebar is hit, you'll see the results in the console of a getItem(Point) call for every vertical pixel in the box from 5 above the box to 5 below.

On my machine with the default font, I initially see items 10-0 thru 19-0 (item 20 has a few pixels, so should be returned by the appropriate getItem(Point) call).  The top Index is set to 10 to ensure that there are items above the top visible item.

When space bar is pressed, the following (abbreviated) is displayed.  I would expect that items (20,0) thru (20,23) would say "Over no item" because items 8 and 9 are not visible - they are 'underneath' the header.  I suspect that the header is not being taken into account in this case

(  20,  -5) Over no item
(  20,  -4) Over no item
(  20,  -3) Over no item
(  20,  -2) Over no item
(  20,  -1) Over no item
(  20,   0) Over item 'Item 8-0'
(  20,   1) Over item 'Item 8-0'
(  20,   2) Over item 'Item 8-0'
(  20,   3) Over item 'Item 8-0'
(  20,   4) Over item 'Item 8-0'
(  20,   5) Over item 'Item 9-0'
(  20,   6) Over item 'Item 9-0'
(  20,   7) Over item 'Item 9-0'
(  20,   8) Over item 'Item 9-0'
(  20,   9) Over item 'Item 9-0'
(  20,  10) Over item 'Item 9-0'
(  20,  11) Over item 'Item 9-0'
(  20,  12) Over item 'Item 9-0'
(  20,  13) Over item 'Item 9-0'
(  20,  14) Over item 'Item 9-0'
(  20,  15) Over item 'Item 9-0'
(  20,  16) Over item 'Item 9-0'
(  20,  17) Over item 'Item 9-0'
(  20,  18) Over item 'Item 9-0'
(  20,  19) Over item 'Item 9-0'
(  20,  20) Over item 'Item 9-0'
(  20,  21) Over item 'Item 9-0'
(  20,  22) Over item 'Item 9-0'
(  20,  23) Over item 'Item 9-0'
(  20,  24) Over item 'Item 10-0'
(  20,  25) Over item 'Item 10-0'
(  20,  26) Over item 'Item 10-0'
(  20,  27) Over item 'Item 10-0'
(  20,  28) Over item 'Item 10-0'


Reproducible: Always

Steps to Reproduce:
1. run the attached snippet
2. press spacebar
3. observe that items that are not visible and cannot be selected are displayed contrary to the documentation that states "The item that is returned represents an item that could be selected by the user."
Comment 1 Larry Colson CLA 2009-08-31 10:27:28 EDT
Created attachment 146072 [details]
Snippet that illustrates bug

This bug seems to occur with and without SWT.FULL_SELECTION
Comment 2 Larry Colson CLA 2009-08-31 10:36:54 EDT
Simple workaround

  public TableItem myGetItem(Table tbl, Point pt)
  {
    if(tbl.getHeaderVisible() && pt.y < tbl.getHeaderHeight())
      return(null) ;
        
    return(tbl.getItem(pt)) ;
  }
Comment 3 Leo Ufimtsev CLA 2017-08-03 12:30:57 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 4 Eclipse Genie CLA 2019-09-27 15:12:12 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.