Skip to main content
summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorBrian Vosburgh2013-07-03 16:08:23 +0000
committerBrian Vosburgh2013-07-05 17:05:01 +0000
commit8c8c716e11480748535aa9b88d992bbc72d7d87f (patch)
tree3f28708903f7c7b7b8f9064c3b159cfb8005d5b6 /common
parent66c1b9e48c155ef9f40ccdd03a2d8ebcefb87837 (diff)
downloadwebtools.dali-8c8c716e11480748535aa9b88d992bbc72d7d87f.tar.gz
webtools.dali-8c8c716e11480748535aa9b88d992bbc72d7d87f.tar.xz
webtools.dali-8c8c716e11480748535aa9b88d992bbc72d7d87f.zip
clean up various plugin.xml files
Diffstat (limited to 'common')
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/plugin.xml146
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/FacetedReferencingProjectsPropertyTester.java57
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/IndeterminateContentDescriber.java3
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/ResourcePropertyTester.java75
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml78
5 files changed, 200 insertions, 159 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/plugin.xml b/common/plugins/org.eclipse.jpt.common.core/plugin.xml
index fc7a55ccd4..f8876bac29 100644
--- a/common/plugins/org.eclipse.jpt.common.core/plugin.xml
+++ b/common/plugins/org.eclipse.jpt.common.core/plugin.xml
@@ -30,6 +30,43 @@
schema="schema/resourceTypes.exsd"/>
+ <!-- ***** expression definitions ***** -->
+
+ <extension
+ point="org.eclipse.core.expressions.definitions">
+
+ <!--
+ Return whether a resource's project has the Java facet
+ (or a project facet version matches the Java facet).
+ Force activation of the WST facet plug-in containing the property tester.
+ Example usage:
+ <adapt type="org.eclipse.core.resources.IResource">
+ <reference definitionId="org.eclipse.jpt.expression.hasJavaFacet"/>
+ </adapt>
+ -->
+ <definition id="org.eclipse.jpt.expression.hasJavaFacet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="java"
+ forcePluginActivation="true"/>
+ </definition>
+
+ <!-- Return whether a resource's project has the Static Web facet. -->
+ <definition id="org.eclipse.jpt.expression.hasStaticWebFacet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="wst.web"
+ forcePluginActivation="true"/>
+ </definition>
+
+ <!-- Return whether a resource's project has the Dynamic Web facet. -->
+ <definition id="org.eclipse.jpt.expression.hasDynamicWebFacet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="jst.web"
+ forcePluginActivation="true"/>
+ </definition>
+
+ </extension>
+
+
<!-- ***** adapters ***** -->
<extension
@@ -50,13 +87,13 @@
</factory>
</extension>
-
-
+
+
<!-- ***** content types ***** -->
-
+
<extension
point="org.eclipse.core.contenttype.contentTypes">
-
+
<!-- JAR content type -->
<content-type
id="org.eclipse.jpt.common.core.content.jar"
@@ -67,16 +104,16 @@
<parameter name="signature" value="50 4B 03 04"/>
</describer>
</content-type>
-
- <!-- package-info.java content type (for package annotations) -->
+
+ <!-- package-info.java content type (for package annotations) -->
<content-type
- id="org.eclipse.jpt.common.core.content.javaPackageInfo"
- name="%JAVA_PACKAGE_INFO_CONTENT"
- base-type="org.eclipse.jdt.core.javaSource"
- file-names="package-info.java"
- priority="normal">
- </content-type>
-
+ id="org.eclipse.jpt.common.core.content.javaPackageInfo"
+ name="%JAVA_PACKAGE_INFO_CONTENT"
+ base-type="org.eclipse.jdt.core.javaSource"
+ file-names="package-info.java"
+ priority="normal">
+ </content-type>
+
<!-- faceted project file -->
<content-type
id="org.eclipse.jpt.common.core.content.projectFacet"
@@ -85,12 +122,10 @@
base-type="org.eclipse.core.runtime.xml">
<describer
class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber2">
- <parameter
- name="element"
- value="faceted-project"/>
+ <parameter name="element" value="faceted-project"/>
</describer>
</content-type>
-
+
</extension>
@@ -118,61 +153,60 @@
<extension
point="org.eclipse.core.expressions.propertyTesters">
-
+
<propertyTester
id="org.eclipse.jpt.common.core.propertyTester.LibraryProvider"
type="org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider"
namespace="org.eclipse.jpt.common.core"
properties="id, extendsId"
class="org.eclipse.jpt.common.core.internal.LibraryProviderPropertyTester"/>
-
+
<propertyTester
id="org.eclipse.jpt.common.core.propertyTester.JptResourceTypeReference"
type="org.eclipse.jpt.common.core.JptResourceTypeReference"
namespace="org.eclipse.jpt.common.core"
properties="resourceTypeIsKindOf"
class="org.eclipse.jpt.common.core.internal.JptResourceTypeReferencePropertyTester"/>
-
+
<propertyTester
- id="org.eclipse.jpt.common.core.propertyTester.FacetedReferencingProjectsPropertyTester"
+ id="org.eclipse.jpt.common.core.propertyTester.Resource"
type="org.eclipse.core.resources.IResource"
namespace="org.eclipse.jpt.common.core"
- properties="anyFacetedReferencingProjects"
- class="org.eclipse.jpt.common.core.internal.bundleexclude.FacetedReferencingProjectsPropertyTester"/>
+ properties="anyReferencingProjectHasFacet"
+ class="org.eclipse.jpt.common.core.internal.bundleexclude.ResourcePropertyTester"/>
</extension>
-
-
- <extension
- point="org.eclipse.emf.ecore.generated_package">
-
+
+
+ <!-- ***** EMF ecore package registry ***** -->
+
+ <extension
+ point="org.eclipse.emf.ecore.generated_package">
+
<package
uri="http://www.eclipse.org/dali/common"
class="org.eclipse.jpt.common.core.resource.xml.CommonPackage"
genModel="model/common.genmodel"/>
</extension>
-
-
- <!-- ***** Dali extensions (eat our own dogfood) ***** -->
-
+
+
+ <!-- ***** resource locators (eat our own dogfood) ***** -->
+
<extension
point="org.eclipse.jpt.common.core.resourceLocators">
-
+
<resourceLocator
id="simpleJavaResourceLocator"
class="org.eclipse.jpt.common.core.internal.resource.SimpleJavaResourceLocator"
priority="lowest">
<enablement>
<with variable="project">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="java"
- forcePluginActivation="true"/>
+ <reference definitionId="org.eclipse.jpt.expression.hasJavaFacet"/>
</with>
</enablement>
</resourceLocator>
-
+
<resourceLocator
id="moduleResourceLocator"
class="org.eclipse.jpt.common.core.internal.resource.ModuleResourceLocator"
@@ -180,64 +214,54 @@
<enablement>
<with variable="project">
<and>
- <test
- property="org.eclipse.core.resources.projectNature"
+ <test property="org.eclipse.core.resources.projectNature"
value="org.eclipse.wst.common.modulecore.ModuleCoreNature"
forcePluginActivation="true"/>
- <not>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="wst.web"
- forcePluginActivation="true"/>
- </not>
+ <not><reference definitionId="org.eclipse.jpt.expression.hasStaticWebFacet"/></not>
</and>
</with>
</enablement>
</resourceLocator>
-
+
<resourceLocator
id="webModuleResourceLocator"
class="org.eclipse.jpt.common.core.internal.resource.WebModuleResourceLocator"
priority="low">
<enablement>
<with variable="project">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.web"
- forcePluginActivation="true"/>
+ <reference definitionId="org.eclipse.jpt.expression.hasDynamicWebFacet"/>
</with>
</enablement>
</resourceLocator>
-
+
<resourceLocator
id="pluginResourceLocator"
class="org.eclipse.jpt.common.core.internal.resource.PluginResourceLocator"
priority="normal">
<enablement>
<with variable="project">
- <test
- property="org.eclipse.core.resources.projectNature"
+ <test property="org.eclipse.core.resources.projectNature"
value="org.eclipse.pde.PluginNature"
forcePluginActivation="true"/>
</with>
</enablement>
</resourceLocator>
-
+
</extension>
-
-
- <!-- ***** WTP Library Provider Framework Integration ***** -->
+
+
+ <!-- ***** WTP library providers ***** -->
<extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
-
+
<provider
id="jpt-no-op-library-provider"
extends="no-op-library-provider"
abstract="true">
<param name="warning" value="%NO_OP_LIBRARY_PROVIDER_WARNING"/>
</provider>
-
+
</extension>
-
+
</plugin>
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/FacetedReferencingProjectsPropertyTester.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/FacetedReferencingProjectsPropertyTester.java
deleted file mode 100644
index b20239df93..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/FacetedReferencingProjectsPropertyTester.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.bundleexclude;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-
-public final class FacetedReferencingProjectsPropertyTester
- extends PropertyTester
-{
- private static final String ANY_FACETED_REFERENCING_PROJECTS_PROPERTY = "anyFacetedReferencingProjects"; //$NON-NLS-1$
-
- //partially copied from org.eclipse.wst.common.project.facet.core.internal.FacetedProjectPropertyTester
- public boolean test(final Object receiver, final String property, final Object[] args, final Object value) {
- if (property.equals(ANY_FACETED_REFERENCING_PROJECTS_PROPERTY)) {
- final String val = (String) value;
- final int colonIndex = val.indexOf(':');
- final String facetId;
- final String versionExpression;
- if (colonIndex == -1 || colonIndex == val.length() - 1) {
- facetId = val;
- versionExpression = null;
- }
- else {
- facetId = val.substring(0, colonIndex);
- versionExpression = val.substring(colonIndex + 1);
- }
- if (receiver instanceof IResource) {
- try {
- if (FacetedProjectFramework.hasProjectFacet(((IResource) receiver).getProject() , facetId, versionExpression)) {
- return true;
- }
- for (IProject project : ((IResource) receiver).getProject().getReferencingProjects()) {
- if (FacetedProjectFramework.hasProjectFacet(project, facetId, versionExpression)) {
- return true;
- }
- }
- }
- catch (CoreException e) {
- JptCommonCorePlugin.instance().logError(e);
- }
- }
- }
- return false;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/IndeterminateContentDescriber.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/IndeterminateContentDescriber.java
index 4cea4722a6..818f76a1cf 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/IndeterminateContentDescriber.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/IndeterminateContentDescriber.java
@@ -18,7 +18,8 @@ import org.eclipse.core.runtime.content.ITextContentDescriber;
/**
* This describer returns {@link #INDETERMINATE} for any content.
* <p>
- * This is in its own package so it can be excluded from bundle
+ * <strong>NB:</strong>
+ * This class is in a package that is excluded from bundle
* activation in the <code>META-INF/MANIFEST.MF</code> file.
* To be excluded, content describers must be self-contained and
* not trigger bundle auto-activation.
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/ResourcePropertyTester.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/ResourcePropertyTester.java
new file mode 100644
index 0000000000..37801261a2
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/bundleexclude/ResourcePropertyTester.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.common.core.internal.bundleexclude;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
+
+/**
+ * <strong>NB:</strong>
+ * This class is in a package that is excluded from bundle
+ * activation in the <code>META-INF/MANIFEST.MF</code> file.
+ * To be excluded, it must be self-contained and
+ * not trigger bundle auto-activation.
+ * @see org.eclipse.wst.common.project.facet.core.internal.FacetedProjectPropertyTester
+ */
+public final class ResourcePropertyTester
+ extends PropertyTester
+{
+ private static final String ANY_REFERENCING_PROJECT_HAS_FACET_PROPERTY = "anyReferencingProjectHasFacet"; //$NON-NLS-1$
+
+ public boolean test(Object receiver, String property, Object[] args, Object value) {
+ if (receiver instanceof IResource) {
+ return this.test((IResource) receiver, property, value);
+ }
+ return false;
+ }
+
+ private boolean test(IResource resource, String property, Object value) {
+ if (property.equals(ANY_REFERENCING_PROJECT_HAS_FACET_PROPERTY)) {
+ return this.anyReferencingProjectHasFacet(resource.getProject(), (String) value);
+ }
+ return false;
+ }
+
+ private boolean anyReferencingProjectHasFacet(IProject project, String facetVersionExpression) {
+ int colon = facetVersionExpression.indexOf(':');
+ String facetID;
+ String versionExpression;
+ if ((colon == -1) || (colon == facetVersionExpression.length() - 1)) {
+ facetID = facetVersionExpression;
+ versionExpression = null;
+ } else {
+ facetID = facetVersionExpression.substring(0, colon);
+ versionExpression = facetVersionExpression.substring(colon + 1);
+ }
+ try {
+ return this.anyReferencingProjectHasFacet(project, facetID, versionExpression);
+ } catch (CoreException ex) {
+ // ignore - so we don't load the plug-in unnecessarily
+ return false;
+ }
+ }
+
+ private boolean anyReferencingProjectHasFacet(IProject project, String facetID, String versionExpression) throws CoreException {
+ if (FacetedProjectFramework.hasProjectFacet(project, facetID, versionExpression)) {
+ return true;
+ }
+ for (IProject refProject : project.getReferencingProjects()) {
+ if (FacetedProjectFramework.hasProjectFacet(refProject, facetID, versionExpression)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml b/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml
index baada2d660..da5000620d 100644
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml
+++ b/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml
@@ -9,69 +9,67 @@
Contributors:
Oracle - initial API and implementation
-->
-
+
<plugin>
-
+
<!--
******************************************
* Library Provider Framework Integration *
******************************************
-->
-
+
<extension point="org.eclipse.jst.common.project.facet.core.downloadableLibraries">
-
+
<import-definitions
url="http://www.eclipse.org/webtools/dali/dev/eclipselink/eclipselink-downloadable-libs.xml">
<enablement>
<with variable="requestingProjectFacet">
<or>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
value="jpt.jaxb"
forcePluginActivation="true"/>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
value="jpt.jpa"
forcePluginActivation="true"/>
</or>
</with>
</enablement>
</import-definitions>
-
+
</extension>
-
-
+
+
<!--
******************************************
* EclipseLink schemas *
******************************************
-->
-
+
<extension
point="org.eclipse.wst.xml.core.catalogContributions">
-
+
<catalogContribution id="default">
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_0.xsd"
uri="schemas/eclipselink_orm_1_0.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_1.xsd"
uri="schemas/eclipselink_orm_1_1.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_2.xsd"
uri="schemas/eclipselink_orm_1_2.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_0.xsd"
uri="schemas/eclipselink_orm_2_0.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_1.xsd"
uri="schemas/eclipselink_orm_2_1.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_2.xsd"
uri="schemas/eclipselink_orm_2_2.xsd"/>
@@ -91,39 +89,39 @@
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_0.xsd"
uri="schemas/eclipselink_oxm_2_0.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_1.xsd"
uri="schemas/eclipselink_oxm_2_1.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_2.xsd"
- uri="schemas/eclipselink_oxm_2_2.xsd"/>
<uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_3.xsd"
- uri="schemas/eclipselink_oxm_2_3.xsd"/>
+ name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_2.xsd"
+ uri="schemas/eclipselink_oxm_2_2.xsd"/>
+
+ <uri
+ name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_3.xsd"
+ uri="schemas/eclipselink_oxm_2_3.xsd"/>
<uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_4.xsd"
- uri="schemas/eclipselink_oxm_2_4.xsd"/>
+ name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_4.xsd"
+ uri="schemas/eclipselink_oxm_2_4.xsd"/>
<uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_5.xsd"
- uri="platform:/plugin/org.eclipse.persistence.moxy/org/eclipse/persistence/jaxb/eclipselink_oxm_2_5.xsd"/>
+ name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_5.xsd"
+ uri="platform:/plugin/org.eclipse.persistence.moxy/org/eclipse/persistence/jaxb/eclipselink_oxm_2_5.xsd"/>
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_1.0.xsd"
uri="platform:/plugin/org.eclipse.persistence.core/org/eclipse/persistence/eclipselink_persistence_map_1.0.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_1.1.xsd"
uri="schemas/eclipselink_persistence_map_1.1.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_1.2.xsd"
uri="schemas/eclipselink_persistence_map_1.2.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_2.0.xsd"
uri="schemas/eclipselink_persistence_map_2.0.xsd"/>
@@ -131,19 +129,19 @@
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_2.3.xsd"
uri="platform:/plugin/org.eclipse.persistence.core/org/eclipse/persistence/eclipselink_persistence_map_2.3.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_1.0.xsd"
uri="schemas/eclipselink_sessions_1.0.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_1.1.xsd"
uri="schemas/eclipselink_sessions_1.1.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_1.2.xsd"
uri="schemas/eclipselink_sessions_1.2.xsd"/>
-
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_2.0.xsd"
uri="schemas/eclipselink_sessions_2.0.xsd"/>
@@ -151,9 +149,9 @@
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_2.1.xsd"
uri="platform:/plugin/org.eclipse.persistence.core/org/eclipse/persistence/eclipselink_sessions_2.1.xsd"/>
-
+
</catalogContribution>
-
- </extension>
-
+
+ </extension>
+
</plugin>

Back to the top