Community
Participate
Working Groups
Currently our extensions to org.eclipse.ltk.core.refactoring loads the org.eclipse.jpt.jpa.core plugin and dependencies even when there are not any JPA faceted projects. It does not load the jpt.jpa.core.ui plug-in so at least the JpaProjectManager is not started (bug 386171) We probably need a plug-in just for determining if there are any projects with the JPA facet. Then our extension points would be able to define an enablement expression based on a property tester that checks that.
There is a faceted project tester that can test the project without loading *our* plugins.
Can it test if any project in the workspace is a jpa faceted project? A Java class rename refactoring could be done on a class that is in a non-JPA faceted project, but it could be referenced in a persistence.xml in a JPA faceted project. So I can't just test that the particular IType is in a JPA faceted project.
So the refactoring participant is not invoked on each prospective project? No, you'd have to have a project upon which to invoke the tester.
(In reply to comment #0) > It does not load the jpt.jpa.core.ui plug-in so at > least the JpaProjectManager is not started (bug 386171) this comment is not correct, not sure where I got that idea :( I'm looking at fixing this now.
In maintenance we are partially fixing this issue with bug 397778. It checked if any of the 'affectedNatures' are the facet nature.
The platform fixed a bug where forcePluginActivation=true was not working for refactoring participant enablement property testers. Now I have fixed this bug by putting the property tester class in org.eclipse.jpt.common.core.internal.bundleexclude, this package is excluded in the manifest.mf BundleActivation-Policy so it does not cause the plug-in to be activated. Now a jdt refactoring will only activate our plug-ins if the refactored element is in a project with a referencing project that has the JPA facet (another JPA faceted project references the project involved in the refactoring). http://git.eclipse.org/c/dali/webtools.dali.git/commit/?id=1583e09bb0f6def90ef454c8eda036d4331d20aa