Bug 351313 - [Contributions] selection should be the same as active menus election if the selection providers are the same
[Contributions] selection should be the same as active menus election if the ...
Status: NEW
Product: Platform
Classification: Eclipse
Component: UI
3.7
PC Linux
: P3 normal (vote)
: ---
Assigned To: Platform UI Triaged CLA Friend
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-07-06 07:47 EDT by johannes.dohmen CLA Friend
Modified: 2012-06-07 07:18 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description johannes.dohmen CLA Friend 2011-07-06 07:47:59 EDT
Build Identifier: 20110218-0911

This problems occurs in a view containing a (Tree)Viewer and a context menu. The viewpart and the context menu use both the viewer to contribute to the selection. If the context menu is open through a right click the selection for the context menu is not updated correctly.

For example consider a view with two items and a context menu with one entry:
The first item is currently selected. Then the second is right-clicked to open the context menu (at the same time the selection in the viewer changes) and then the menu entry is clicked. Inside the execution method of the handler which handles the command (sent by the context menu) the current selection is still the old one containing item1 instead of item2


Reproducible: Always

Steps to Reproduce:
1. Create a viewpart with a viewer and a context menu
2. Set the selection provider of the viewpart and the context menu to the viewer
3. connect a command to an menu item in the context menu
4. connect the command with a handler
5. check the result of HandlerUtil.getCurrentSelection(event) inside the execute method of the handler
Comment 1 Prakash Rangaraj CLA Friend 2011-07-07 23:29:23 EDT
Will investigate. A sample code to reproduce would be lot better.