Bug 253759 - Wrong selection for object contributions after deselecting all items in a viewer
Summary: Wrong selection for object contributions after deselecting all items in a viewer
Status: RESOLVED DUPLICATE of bug 255330
Alias: None
Product: RAP
Classification: RT
Component: JFace (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2008-11-04 13:21 EST by Austin Riddle CLA
Modified: 2008-12-01 13:07 EST (History)
1 user (show)

See Also:


Attachments
Sample project to demonstrate bug (18.33 KB, application/octet-stream)
2008-12-01 11:34 EST, Austin Riddle CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Austin Riddle CLA 2008-11-04 13:21:02 EST
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
Comment 1 Ivan Furnadjiev CLA 2008-11-26 10:38:41 EST
Can you provide a simple project that reproduce it?
Comment 2 Austin Riddle CLA 2008-12-01 11:34:09 EST
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.
Comment 3 Ivan Furnadjiev CLA 2008-12-01 11:43:35 EST
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?
Comment 4 Austin Riddle CLA 2008-12-01 12:46:09 EST
I concur that this bug is fixed in CVS_HEAD.  Thanks for the fix.
Comment 5 Ivan Furnadjiev CLA 2008-12-01 13:07:20 EST

*** This bug has been marked as a duplicate of bug 255330 ***