Bug 568946

Summary: Support prevent item selection in Table
Product: [Eclipse Project] Platform Reporter: Marco Descher <marco>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 4.18   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
The marked element should be treated as if it does not exist none

Description Marco Descher CLA 2020-11-19 02:47:28 EST
Created attachment 284813 [details]
The marked element should be treated as if it does not exist

It should be supported to prevent the selection of a single item in a Table (or List or Combo ... but I stick to Table first). 

That is, trying to select this element should treat it as being invisible, simply ignoring it and overleap it. A clean example can be seen in in the "Open Type" Dialog (see enclosed screenshot). The marked item should be treated as if it does not exist. 

Android e.g. seems to support this behavior (http://burnignorance.com/android-apps-development/how-to-disable-selection-of-selected-items-in-a-listview/) - while for Eclipse this does not seem possible at the moment (according to https://www.eclipse.org/forums/index.php/t/146776/) 

org.eclipse.swt.widgets.Table#tableViewSelectionIsChanging seems to be a starting point to add the resp. behaviour.

I see two solutions:

Extending the ContentProvider to be queried (e.g. #isSelectable) or add a new Event to be thrown like a PreSelectionEvent where Event.doIt = false would be considered. (If this is possible at all to implement)