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

Bug 325033

Summary: Can not de-select table item from SWT.Selection event
Product: [Eclipse Project] Platform Reporter: Roland Tepp <roland>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: devel, remy.suen, tom.schindl
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
SWT code snippet demonstrating the problem none

Description Roland Tepp CLA 2010-09-11 10:42:51 EDT
Build Identifier: 

I need to provide a way to de-select currently selected table item in a manner that is accessible for touch screen only users.

For this I tried to capture the SWT.Selection event and de-select currently selected item if it was previously selected.

The code works in the sense that the item gets de-selected but then it suddenly gets re-selected without any apparent reason whatsoever.


Reproducible: Always

Steps to Reproduce:
1. add SWT.Selection listener to Table widget
2. de-select already selected from within the listener
3. run the code and witness it happening
Comment 1 Roland Tepp CLA 2010-09-12 04:07:47 EDT
Created attachment 178699 [details]
SWT code snippet demonstrating the problem

Attached is a Java code snippet demonstrating the problem.

When you run his snippet a window opens with a table filled with a bunch of names.

Table item selection should work like toggle -- selecting already selected table item should de-select it, but at least in windows, the item gets magically re-selected in about a second after it was de-selected.
Comment 2 Thomas Schindl CLA 2010-09-12 05:26:00 EDT
Did you try to run the deselect(index) in an Display.asyncExec()?
Comment 3 Roland Tepp CLA 2010-09-12 06:13:39 EDT
(In reply to comment #2)
> Did you try to run the deselect(index) in an Display.asyncExec()?

Yes, but the result is roughly same.
Comment 4 Daniel Hirscher CLA 2011-11-28 04:19:18 EST
Are there any news or solutions on that?
I have the same use case: deselect for touch purposes.
I'm experiencing the same problem on windows.
Comment 5 Eclipse Genie CLA 2019-08-28 15:24:44 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.