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

Bug 324475

Summary: Deselect by ctrl-click not working on jFace viewer
Product: [Eclipse Project] Platform Reporter: Josh O'Dowd <josh.odowd>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, eclipse.felipe, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Josh O'Dowd CLA 2010-09-03 14:36:29 EDT
Build Identifier: 

Greetings:

I have a jFace TreeViewer that I have given a style bit of SWT.SINGLE. It will not allow a tree element to be deselected using ctrl-click on the selected element.

I did find that deselect works if the style bit is set to SWT.MULTI

In my case I need SINGLE select only, with the ability to deselect an element, putting the tree in a no selection state.

I am using eclipse plugin development with eclipse 3.6

Any thoughts??

Thanks for your time.

Reproducible: Always
Comment 1 Curtis Windatt CLA 2010-09-03 14:46:49 EDT
I am pretty sure this is the default and expected behaviour when using single select.  Moving to platform UI for comment.

I expect that the best solution would be to use multi select and override the selection behaviour to deselect everything except the one item being clicked on.
Comment 2 Remy Suen CLA 2010-09-04 08:39:47 EDT
I'm pretty sure this is dictated by the OS.
Comment 3 Josh O'Dowd CLA 2010-09-05 18:21:57 EDT
(In reply to comment #2)
> I'm pretty sure this is dictated by the OS.

Odd that MULTI select style allows 0-many selections and SINGLE select style allows exactly 1 selection, but not 0.  Interesting.
Comment 4 Josh O'Dowd CLA 2010-09-05 18:24:49 EDT
You guys can close this if it is not something that precipitates a need for change.  Thanks for your time.

-Josh
Comment 5 Felipe Heidrich CLA 2010-09-07 09:52:53 EDT
Platform behaviour. Closing as Wont fix.

You can see this behaviour on Windows Explorer (try on My network place, where rename is not enabled)