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

Bug 362201

Summary: [Compatibility] 'Link with Selection' doesn't toggle properly in the 'Git Repositories' view
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, pwebster
Version: 4.2   
Target Milestone: 4.2 M7   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 331240    

Description Remy Suen CLA 2011-10-27 10:12:35 EDT
I20111025-2000

1. Open the 'Git Repositories' view.
2. Ctrl+F10 > Link with Selection
3. Ctrl+F10, the 'Link with Selection' menu item is not checked. The tool item is also not toggled. This works in 3.x.
Comment 1 Remy Suen CLA 2011-10-27 10:37:38 EDT
'Hierarchical Branch Layout' and 'Display Latest Branch Commit' also has this problem.

'Link with Editor' does _not_.
Comment 2 Remy Suen CLA 2011-11-17 11:25:29 EST
I think they use command states for the toggling, Paul. What is our strategy for that in the compatibility layer?
Comment 3 Paul Webster CLA 2011-11-18 13:02:47 EST
It's probably that we don't have one yet.  We're supposed to be compatible, and with Prakash's 3.x changes we have a good pattern for toggle commands based on org.eclipse.ui.handlers.RadioState

PW
Comment 4 Remy Suen CLA 2012-01-11 14:02:41 EST
As these toggle commands are predefined in XML, their state values are stored by using RegistryToggleState.STATE_ID. The RegistryToggleState class is defined in org.eclipse.ui.workbench so the renderer cannot be the one handling this link.

Perhaps the link should be established when the registry is first read so that the menu contribution itself is mapped to the command at a 1-1 link. When the cloning is done in ContributionRecord, we then map a listener from the clone onto the menu contribution. Now if the state changes, the menu contribution is notified by the first 1-1 link. When the menu contribution is modified, its N listeners from the clone are notified then all the cloned copies' selection states will be updated accordingly.
Comment 5 Remy Suen CLA 2012-02-17 08:08:43 EST
*** Bug 351350 has been marked as a duplicate of this bug. ***
Comment 6 Paul Webster CLA 2012-03-16 12:56:24 EDT
*** Bug 374503 has been marked as a duplicate of this bug. ***
Comment 7 Paul Webster CLA 2012-03-16 13:00:25 EDT
I've pushed a fix for this up to pwebster/bug374503 

Remy, could you have a quick look?

PW
Comment 8 Remy Suen CLA 2012-03-16 13:42:50 EDT
(In reply to comment #7)
> I've pushed a fix for this up to pwebster/bug374503 
> 
> Remy, could you have a quick look?

Paul implemented some changes I asked for and it looks okay to me for M7.
Comment 9 Paul Webster CLA 2012-03-16 19:56:31 EDT
Released for M7
PW
Comment 10 Dani Megert CLA 2012-03-21 09:50:56 EDT
Verified in 4.2-I20120321-0610.