Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312039 - potential conflict with action filters on EObject
Summary: potential conflict with action filters on EObject
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Infrastructure (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 0.9.0 M5   Edit
Assignee: Nicolas Bros CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 327671
Blocks:
  Show dependency tree
 
Reported: 2010-05-07 07:14 EDT by Nicolas Bros CLA
Modified: 2011-01-11 04:47 EST (History)
3 users (show)

See Also:
nicolas.bros: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.