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

Bug 312039

Summary: potential conflict with action filters on EObject
Product: [Modeling] MoDisco Reporter: Nicolas Bros <nicolas.bros>
Component: InfrastructureAssignee: Nicolas Bros <nicolas.bros>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: gdupe, hugo.bruneliere, modisco.web-inbox
Version: 0.8.0Flags: nicolas.bros: indigo+
Target Milestone: 0.9.0 M5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 327671    
Bug Blocks:    

Description Nicolas Bros CLA 2010-05-07 07:14:44 EDT
Plug-in "org.eclipse.gmt.modisco.infra.query.core" registers an adapter on EObject using extension point "org.eclipse.core.runtime.adapters". This adapter is used to provide an IActionFilter for EObjects, to filter actions on EObjects, for example in the Query Execution view.

The problem is that Eclipse seems to take the first adapter it finds. So, if any installed plug-in registers an adapter for IActionFilter on EObject as well, it will conflict with the one registered in infra.query.core.
Comment 1 Nicolas Bros CLA 2011-01-03 10:48:13 EST
In fact, the problem came from the fact that we used the extension point "org.eclipse.ui.popupMenus", which is now deprecated in favor of "org.eclipse.ui.menus", which is more flexible.

So, I replaced the extensions using "org.eclipse.ui.popupMenus" and "org.eclipse.ui.IActionFilter" by:
- a command ("org.eclipse.ui.commands")
- a handler for the command ("org.eclipse.ui.handlers"), with an implementation of IHandler instead of IActionDelegate, that uses property testers
- a menu definition ("org.eclipse.ui.menus"), that registers itself for any popup menu (with "popup:org.eclipse.ui.popup.any"), which is the equivalent of the old "org.eclipse.ui.popupMenus" objectContribution
- the definitions of the property testers for MoDisco queries ("org.eclipse.core.expressions.propertyTesters"), that replace the IActionFilter, and don't cause conflicts amongst extensions

The definitions are more verbose (92 more lines of XML in this case) using "org.eclipse.ui.menus", but also more flexible, with each part being reusable if needed.


Committed in revision 3682.
Comment 2 Hugo Bruneliere CLA 2011-01-11 04:47:39 EST
Conflict resolved.