Community
Participate
Working Groups
Build Identifier: 20120614-1722 In Eclipse 3 an action registered via extension point "org.eclipse.ui.editorActions" is correctly shown once in the toolbar and once as main menu entry. But in Eclipse 4.2 (Juno) the action is shown twice in the toolbar (same icon, same behavior) and once in the main menu. This is ugly and has the problem that the same action now can have different checked states at the same time (checked or radio button). Reproducible: Always
Confirmed. Affects the TeXlipse plugin. See: http://sourceforge.net/tracker/?func=detail&aid=3542507&group_id=133306&atid=726818
The org.eclipse.ui.editorActions extension is deprecated. Using the command / menus extensions solves the pb.
(In reply to comment #2) > The org.eclipse.ui.editorActions extension is deprecated. Using the command > / menus extensions solves the pb. This is true, but we still need to make sure editorActions is behaving correctly. PW
+1 on Eclipse 4.2 of Windows 7. Is there a way to work around this without totally changing the API to command/menu?
https://git.eclipse.org/r/#/c/12177/
Daniel, could you please attach a sample plugin that shows the duplication in the latest Kepler? PW
Created attachment 230639 [details] Sample editor with duplications in the toolbar Paul, Maybe we should eliminate the duplications during populating the extension registry (the IExtensionRegistry service) thanks, Daniel
(In reply to comment #7) > Created attachment 230639 [details] > Sample editor with duplications in the toolbar Thanks for this. > Maybe we should eliminate the duplications during populating the extension > registry (the IExtensionRegistry service) That's probably the correct place to target them. We need to narrow down which part of the code is adding the duplicate. Is it that org.eclipse.ui.internal.EditorActionBuilder contributes them in the EditorReference and MenuPersistence is still reading them? What happens if we comment them out of MenuPersistence like we did for actionSets? PW
> That's probably the correct place to target them. We need to narrow down > which part of the code is adding the duplicate. Is it that > org.eclipse.ui.internal.EditorActionBuilder contributes them in the > EditorReference and MenuPersistence is still reading them? What happens if > we comment them out of MenuPersistence like we did for actionSets? > > PW Commenting the readAdditions method invocation in the MenuPersistence class does not help. So there are two places that add the actions defined by the 'org.eclipse.ui.editorActions' extension point: 1) The EditorReference.createEditorActionBars method and processing the action extensions in the EditorActionBuilder class 2) Processing the contributions in the ToolbarManager.processContribution method that uses the ContributionsAnalyzer helper class. It looks for me like some 'org.eclipse.ui.editorActions' extension point parsing issue and we process the actions of the extension point twice and add it to the editor extension list as well as the contribution one and next render both lists generating duplicates. Preparing the original fix for that I was trying to disable the code mentioned in the point 1 and it solves the issue too. However I've skipped this approach since I was concerning some potential regression issues regarding it. thanks, Daniel
(In reply to comment #9) > 2) Processing the contributions in the ToolbarManager.processContribution > method that uses the ContributionsAnalyzer helper class. That's where they get added to the coolbar, not where they come from. What is adding them as an MToolBarContribution to the MApplication.getToolBarContributions() if it's not MenuPersistence ? I thought that was what org.eclipse.ui.internal.menus.MenuPersistence.readEditorActions() was doing. We want to make sure they don't make it into the MToolBarContribution list, since we want the EditorReference.createEditorActionBars to be the primary mechanism for legacy editor actions for Kepler. PW
> (In reply to comment #9) What > is adding them as an MToolBarContribution to the > MApplication.getToolBarContributions() if it's not MenuPersistence ? I > thought that was what > org.eclipse.ui.internal.menus.MenuPersistence.readEditorActions() was doing. Yes, You are correct. I've followed this clue and prepared the new patch - http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d988dbaa9ac808aa1c8f359128c1bc07cbd9ad0b thanks in advance for review, Daniel
Hi After upgrading to eclipse 4.3 we are seeing the same issue mentioned here. Is there a way we can use the fix attached (In reply to comment #11) > > (In reply to comment #9) > What > > is adding them as an MToolBarContribution to the > > MApplication.getToolBarContributions() if it's not MenuPersistence ? I > > thought that was what > > org.eclipse.ui.internal.menus.MenuPersistence.readEditorActions() was doing. > > Yes, You are correct. I've followed this clue and prepared the new patch - > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=d988dbaa9ac808aa1c8f359128c1bc07cbd9ad0b > > thanks in advance for review, > Daniel Hi Daniel Is there a way we can use this patch. If so would you let us know how? I am seeing the same issue after upgrading to eclipse 4.3. And it is pretty annoying to see duplicate editor actions. Thanks or your help Ani
Paul, Are you able to review the latest path for that and push it to master when it is OK? thanks, Daniel
(In reply to comment #13) > Paul, > > Are you able to review the latest path for that and push it to master when > it is OK? When I get to this I'll rebase the commit to bring it up to snuff. PW
Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=5e319c192c350c92199297fabc71d8efe940f1b0 PW
The same code condition isEditorAction() for method addToolBarContribution() is necessary to add to addContribution() method to prevent duplication in contributions in subMenues.
Verified in the build: I20131028-2000
*** Bug 428802 has been marked as a duplicate of this bug. ***
Released to the 'R4_2_maintenance' branch as: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=83314600616bd0d21cfa1306a6707c30286c8af5 Daniel
See comment #16 PW
If we're filtering out both menu and toolbar contributions, we should probably get rid of the whole thing. https://git.eclipse.org/r/25894 PW
Committed: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=2f741c3b3468797f1ed870ef81bb46dbd83b7ca6
Also released to 4.3.2+ with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_3_maintenance&id=8046760f7417c17e1640e26ca33e243d20d3dbd2 PW
Verified in I20140528-2000.