Community
Participate
Working Groups
Build Info: Windows XP, Target Platform RAP 1.2 M2 Steps To Reproduce: 1.Register some object action contributions on a type 2.In a view, populate a viewer with those objects and register a popupmenu 3.Select a single item in the viewer and then deselect it (i.e. empty the viewer selection) 4.Now right click on the viewer (not on an item) to bring up the viewer popup. 5. The last item that was selected is the current selection for the contributed actions. Another use-case is to just register a selection listener on the view site. When you deselect the item in the viewer you will get that item as the selection. More information: I believe this may be related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=240193 There may be something wrong with the selection mechanisms
Can you provide a simple project that reproduce it?
Created attachment 119163 [details] Sample project to demonstrate bug This attachment is a project that can reproduce this bug. It was generated from the new project template from the RAP tooling. I changed the TableViewer in View.java to TreeViewer. The bug is at least reproducible using a TreeViewer, not a TableViewer (I did not try other viewers). Simply select an item in the tree and then deselect it. Then right click in the view (not on an item) and the actions are contributed to the popup for the previously selected item. A println in the console will also show that when the item is deselected, the selection is not null, which it should be. If you change the view to be a TableViewer, you can see that when the items are deselected, the selection returns null.
For me this bug is a duplicate of bug 255330 [Tree] Deselection of last selected item not possible. It is fixed in CVS HEAD. Can you check it against CVS HEAD?
I concur that this bug is fixed in CVS_HEAD. Thanks for the fix.
*** This bug has been marked as a duplicate of bug 255330 ***