Community
Participate
Working Groups
3.2 - add a viewer contribution action to some view's menu - set a breakpoint in the contributed action's selectionChanged method - pop up the menu - choose the action, to ensure that its plugin is activated - pop up the menu again - notice the action's selectionChanged method gets hit twice If you look at the list of selection changed listeners on the view's viewer, you'll notice that it contains not only the ViewerContribution but also the ViewerContribution's plugin actions. The intent here is that only the ViewerContribution gets notified, and it then iterates over its actions, propagating the selection changed event itself. There is a comment in ViewerActionBuilder$ViewerContribution's selection changed method that states: * Rather than hooking up each action as a selection listener, * the contribution itself is added, and propagates * the selection changed notification to all actions. * This simplifies cleanup, in addition to potentially reducing the number of listeners. But it's still adding the individual actions. This could be a performance hit if the action's selectionChanged methods are expensive.
Assigning to component owner PW
I cannot reproduce this problem on 3.4. My IViewActionDelegate's implementation's selectionChanged(IAction, ISelection) method seems to only be called once when I change the selection in the view I'm targeting.
Updated as per http://wiki.eclipse.org/Platform_UI/Bug_Triage PW
(In reply to comment #2) > I cannot reproduce this problem on 3.4. > > My IViewActionDelegate's implementation's selectionChanged(IAction, ISelection) > method seems to only be called once when I change the selection in the view I'm > targeting. > I can reproduce a similar problem on 3.4 This is my similar question: http://www.eclipse.org/newsportal/article.php?id=1580&group=eclipse.platform.pde#1580 Is there solution for that?
Action, popupMenus and viewerContribution extensions are deprecated in favor of org.eclipse.ui.commands/org.eclipse.ui.menus. No work will be planned about actions.