Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/InternalJptResourceTypeManager.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/JptResourceTypeReferencePropertyTester.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/InternalLibraryValidatorManager.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorConfig.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/AbstractJptFileCreationDataModelProvider.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/InternalResourceLocatorManager.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ModuleResourceLocator.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/PluginResourceLocator.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorConfig.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/SimpleJavaResourceLocator.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceTypeCompilationUnit.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ConfigurationElementTools.java54
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ContentTypeTools.java107
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ExtensionPointTools.java164
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PathTools.java64
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java227
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java31
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformDefinition.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformConfig.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformManager.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/InternalJaxbPlatformUiManager.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/GenericJpaPlatform.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JarDefinition.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaSourceFileDefinition.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/PackageInfoDefinition.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmXmlDefinition.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlDefinition.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationOperation.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationOperation.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformConfig.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformManager.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/InternalJpaPlatformUiManager.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/JpaPlatformUiConfig.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/operation/NewEntityClassOperation.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java5
47 files changed, 453 insertions, 380 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/InternalJptResourceTypeManager.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/InternalJptResourceTypeManager.java
index 2bec149af8..3903d1b0a3 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/InternalJptResourceTypeManager.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/InternalJptResourceTypeManager.java
@@ -25,7 +25,7 @@ import org.eclipse.jpt.common.core.JptCommonCoreMessages;
import org.eclipse.jpt.common.core.JptResourceType;
import org.eclipse.jpt.common.core.JptResourceTypeManager;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.ConfigurationElementTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.SimpleAssociation;
import org.eclipse.jpt.common.utility.internal.StringTools;
@@ -260,7 +260,7 @@ public class InternalJptResourceTypeManager
}
private void logMissingAttribute(IConfigurationElement element, String attributeName) {
- this.getPlugin().logError(ConfigurationElementTools.buildMissingAttributeMessage(element, attributeName));
+ this.getPlugin().logError(ExtensionPointTools.buildMissingAttributeMessage(element, attributeName));
}
private void logInvalidContentType(IConfigurationElement element, String resourceTypeID, String contentTypeID) {
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/JptResourceTypeReferencePropertyTester.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/JptResourceTypeReferencePropertyTester.java
index 9a5138089f..42eaa1d750 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/JptResourceTypeReferencePropertyTester.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/JptResourceTypeReferencePropertyTester.java
@@ -15,7 +15,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceType;
import org.eclipse.jpt.common.core.JptResourceTypeReference;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
/**
* Property tester for {@link JptResourceTypeReference}.
@@ -73,7 +73,7 @@ public class JptResourceTypeReferencePropertyTester
}
private boolean resourceTypeIsKindOf(JptResourceTypeReference ref, IContentType contentType, String version) {
- JptResourceType resourceType = PlatformTools.getResourceType(contentType, version);
+ JptResourceType resourceType = ContentTypeTools.getResourceType(contentType, version);
return (resourceType != null) && ref.getResourceType().isKindOf(resourceType);
}
}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/InternalLibraryValidatorManager.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/InternalLibraryValidatorManager.java
index 046dd51eac..2ea9a8a1c5 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/InternalLibraryValidatorManager.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/InternalLibraryValidatorManager.java
@@ -20,7 +20,7 @@ import org.eclipse.core.runtime.RegistryFactory;
import org.eclipse.jpt.common.core.JptCommonCoreMessages;
import org.eclipse.jpt.common.core.internal.InternalJptWorkspace;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.ConfigurationElementTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
import org.eclipse.jpt.common.core.libval.LibraryValidator;
import org.eclipse.jpt.common.core.libval.LibraryValidatorManager;
@@ -197,7 +197,7 @@ public class InternalLibraryValidatorManager
}
private void logMissingAttribute(IConfigurationElement element, String attributeName) {
- this.getPlugin().logError(ConfigurationElementTools.buildMissingAttributeMessage(element, attributeName));
+ this.getPlugin().logError(ExtensionPointTools.buildMissingAttributeMessage(element, attributeName));
}
private void logMultipleEnablements(IConfigurationElement element) {
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorConfig.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorConfig.java
index 7810163b03..780edc42d0 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorConfig.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorConfig.java
@@ -14,7 +14,7 @@ import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
import org.eclipse.jpt.common.core.libval.LibraryValidator;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
@@ -100,7 +100,7 @@ class LibraryValidatorConfig {
}
private LibraryValidator buildLibraryValidator() {
- return PlatformTools.instantiate(this.pluginID, this.manager.getExtensionPointName(), this.className, LibraryValidator.class);
+ return ExtensionPointTools.instantiate(this.pluginID, this.manager.getExtensionPointName(), this.className, LibraryValidator.class);
}
@Override
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/AbstractJptFileCreationDataModelProvider.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/AbstractJptFileCreationDataModelProvider.java
index 265eaa422e..44ea96a541 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/AbstractJptFileCreationDataModelProvider.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/AbstractJptFileCreationDataModelProvider.java
@@ -18,7 +18,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jpt.common.core.JptCommonCoreMessages;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.PathTools;
import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
@@ -105,7 +105,7 @@ public abstract class AbstractJptFileCreationDataModelProvider
protected IContainer getContainer() {
IPath containerPath = getContainerPath();
- return (containerPath == null) ? null : PlatformTools.getContainer(containerPath);
+ return (containerPath == null) ? null : PathTools.getContainer(containerPath);
}
protected IProject getProject() {
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/InternalResourceLocatorManager.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/InternalResourceLocatorManager.java
index ad5e66257a..6f77af1434 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/InternalResourceLocatorManager.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/InternalResourceLocatorManager.java
@@ -23,7 +23,7 @@ import org.eclipse.jpt.common.core.JptCommonCoreMessages;
import org.eclipse.jpt.common.core.internal.InternalJptWorkspace;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.internal.resource.ResourceLocatorConfig.Priority;
-import org.eclipse.jpt.common.core.internal.utility.ConfigurationElementTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.core.resource.ResourceLocator;
import org.eclipse.jpt.common.core.resource.ResourceLocatorManager;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
@@ -221,7 +221,7 @@ public class InternalResourceLocatorManager
}
private void logMissingAttribute(IConfigurationElement element, String attributeName) {
- this.getPlugin().logError(ConfigurationElementTools.buildMissingAttributeMessage(element, attributeName));
+ this.getPlugin().logError(ExtensionPointTools.buildMissingAttributeMessage(element, attributeName));
}
private void logInvalidPriority(IConfigurationElement element, String priority) {
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ModuleResourceLocator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ModuleResourceLocator.java
index 592922eae2..b48fbf7261 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ModuleResourceLocator.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ModuleResourceLocator.java
@@ -15,7 +15,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.PathTools;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
@@ -40,7 +40,7 @@ public class ModuleResourceLocator
@Override
public IPath getRuntimePath(IProject project, IPath resourcePath) {
IVirtualFolder rootFolder = this.getRootFolder(project);
- IFile file = PlatformTools.getFile(resourcePath);
+ IFile file = PathTools.getFile(resourcePath);
IVirtualFile vFile = this.getVirtualFile(rootFolder, file);
if (vFile != null) {
return vFile.getRuntimePath().makeRelative();
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/PluginResourceLocator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/PluginResourceLocator.java
index 35deeae644..a792eb32e6 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/PluginResourceLocator.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/PluginResourceLocator.java
@@ -15,7 +15,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.PathTools;
import org.eclipse.pde.core.project.IBundleProjectService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -47,7 +47,7 @@ public class PluginResourceLocator
public IPath getRuntimePath(IProject project, IPath resourcePath) {
IContainer bundleRoot = this.getBundleRoot(project);
if (bundleRoot != null) {
- IFile file = PlatformTools.getFile(resourcePath);
+ IFile file = PathTools.getFile(resourcePath);
if (bundleRoot.contains(file)) {
return resourcePath.makeRelativeTo(bundleRoot.getFullPath());
}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorConfig.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorConfig.java
index 7215ef0984..d3e1abf7ae 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorConfig.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorConfig.java
@@ -16,7 +16,7 @@ import org.eclipse.core.expressions.Expression;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.core.resource.ResourceLocator;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.predicate.CriterionPredicate;
@@ -107,7 +107,7 @@ class ResourceLocatorConfig
}
private ResourceLocator buildResourceLocator() {
- return PlatformTools.instantiate(this.pluginID, this.manager.getExtensionPointName(), this.className, ResourceLocator.class);
+ return ExtensionPointTools.instantiate(this.pluginID, this.manager.getExtensionPointName(), this.className, ResourceLocator.class);
}
@Override
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/SimpleJavaResourceLocator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/SimpleJavaResourceLocator.java
index 8d4932adea..3de43174db 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/SimpleJavaResourceLocator.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/SimpleJavaResourceLocator.java
@@ -24,7 +24,7 @@ import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.internal.utility.PackageFragmentRootTools;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.PathTools;
import org.eclipse.jpt.common.core.resource.ResourceLocator;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.TransformationIterable;
@@ -165,7 +165,7 @@ public class SimpleJavaResourceLocator
}
protected IPath getRuntimePath_(IProject project, IPath resourcePath) throws JavaModelException {
- IFile file = PlatformTools.getFile(resourcePath);
+ IFile file = PathTools.getFile(resourcePath);
for (IContainer sourceFolder : this.getSourceFolders(project)) {
if (sourceFolder.contains(file)) {
return resourcePath.makeRelativeTo(sourceFolder.getFullPath());
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java
index 9ca8e4f44c..350edf21d6 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryModel.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.common.core.internal.resource.java.binary;
import org.eclipse.jpt.common.core.AnnotationProvider;
import org.eclipse.jpt.common.core.JptResourceModelListener;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceModel;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragmentRoot;
import org.eclipse.jpt.common.utility.internal.ListenerList;
@@ -69,7 +69,7 @@ abstract class RootBinaryModel
// ********** JptResourceModel implementation **********
public JptResourceType getResourceType() {
- return PlatformTools.getResourceType(JavaResourcePackageFragmentRoot.JAR_CONTENT_TYPE);
+ return ContentTypeTools.getResourceType(JavaResourcePackageFragmentRoot.JAR_CONTENT_TYPE);
}
public void addResourceModelListener(JptResourceModelListener listener) {
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
index e02a89cfc3..7e663edb02 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
@@ -14,7 +14,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.PackageDeclaration;
import org.eclipse.jpt.common.core.AnnotationProvider;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
@@ -64,7 +64,7 @@ public final class SourcePackageInfoCompilationUnit
// ********** JptResourceModel implementation **********
public JptResourceType getResourceType() {
- return PlatformTools.getResourceType(PACKAGE_INFO_CONTENT_TYPE);
+ return ContentTypeTools.getResourceType(PACKAGE_INFO_CONTENT_TYPE);
}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceTypeCompilationUnit.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceTypeCompilationUnit.java
index 3f86747b94..d9f402dfe6 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceTypeCompilationUnit.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceTypeCompilationUnit.java
@@ -18,7 +18,7 @@ import org.eclipse.jdt.core.dom.EnumDeclaration;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jpt.common.core.AnnotationProvider;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.AstNodeType;
import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
@@ -88,7 +88,7 @@ public final class SourceTypeCompilationUnit
// ********** JpaResourceModel implementation **********
public JptResourceType getResourceType() {
- return PlatformTools.getResourceType(CONTENT_TYPE);
+ return ContentTypeTools.getResourceType(CONTENT_TYPE);
}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ConfigurationElementTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ConfigurationElementTools.java
deleted file mode 100644
index c43aa37dcd..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ConfigurationElementTools.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 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.utility;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jpt.common.core.JptCommonCoreMessages;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * {@link IConfigurationElement} utility methods.
- */
-public class ConfigurationElementTools {
- /**
- * Return a helpful message indicating the specified attribute is missing
- * from the specified element.
- */
- public static String buildMissingAttributeMessage(IConfigurationElement element, String attributeName) {
- return bind(JptCommonCoreMessages.REGISTRY_MISSING_ATTRIBUTE,
- attributeName,
- element.getName(),
- element.getDeclaringExtension().getExtensionPointUniqueIdentifier(),
- element.getContributor().getName()
- );
- }
-
- /**
- * Return a helpful message indicating the specified attribute
- * from the specified element has an invalid value.
- */
- public static String buildInvalidValueMessage(IConfigurationElement element, String attributeName, String invalidValue) {
- return bind(JptCommonCoreMessages.REGISTRY_INVALID_VALUE,
- invalidValue,
- attributeName,
- element.getDeclaringExtension().getExtensionPointUniqueIdentifier(),
- element.getContributor().getName()
- );
- }
-
- private static String bind(String msg, Object... args) {
- return NLS.bind(msg, args);
- }
-
- private ConfigurationElementTools() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ContentTypeTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ContentTypeTools.java
new file mode 100644
index 0000000000..50aa988f5b
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ContentTypeTools.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 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.utility;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.core.runtime.content.IContentTypeManager;
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.core.JptWorkspace;
+import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
+
+/**
+ * {@link IContentType} utility methods
+ */
+public class ContentTypeTools {
+
+
+ // ********** resource type **********
+
+ /**
+ * Return the resource type corresponding to the specified content type.
+ */
+ public static JptResourceType getResourceType(IContentType contentType) {
+ JptWorkspace jptWorkspace = getJptWorkspace();
+ return (jptWorkspace == null) ? null : jptWorkspace.getResourceTypeManager().getResourceType(contentType);
+ }
+
+ /**
+ * Return the resource type corresponding to the specified content type
+ * and version.
+ */
+ public static JptResourceType getResourceType(IContentType contentType, String version) {
+ JptWorkspace jptWorkspace = getJptWorkspace();
+ return (jptWorkspace == null) ? null : jptWorkspace.getResourceTypeManager().getResourceType(contentType, version);
+ }
+
+ private static JptWorkspace getJptWorkspace() {
+ return PlatformTools.getAdapter(PathTools.getWorkspace(), JptWorkspace.class);
+ }
+
+
+ // ********** file content type **********
+
+ /**
+ * Return the specified file's content type,
+ * using the Eclipse platform's content type manager.
+ */
+ public static IContentType contentType(IFile file) {
+ String fileName = file.getName();
+ InputStream fileContents = null;
+ try {
+ fileContents = file.getContents();
+ } catch (CoreException ex) {
+ // seems like we can ignore any exception that might occur here;
+ // e.g. we get a FNFE if the workspace is out of sync with the O/S file system
+ // JptCorePlugin.log(ex);
+
+ // look for content type based on the file name only(?)
+ return findContentTypeFor(fileName);
+ }
+
+ IContentType contentType = null;
+ try {
+ contentType = findContentTypeFor(fileContents, fileName);
+ } catch (IOException ex) {
+ JptCommonCorePlugin.instance().logError(ex);
+ } finally {
+ try {
+ fileContents.close();
+ } catch (IOException ex) {
+ JptCommonCorePlugin.instance().logError(ex);
+ }
+ }
+ return contentType;
+ }
+
+ private static IContentType findContentTypeFor(InputStream fileContents, String fileName) throws IOException {
+ return getContentTypeManager().findContentTypeFor(fileContents, fileName);
+ }
+
+ private static IContentType findContentTypeFor(String fileName) {
+ return getContentTypeManager().findContentTypeFor(fileName);
+ }
+
+ private static IContentTypeManager getContentTypeManager() {
+ return Platform.getContentTypeManager();
+ }
+
+
+ // ********** disabled constructor **********
+
+ private ContentTypeTools() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ExtensionPointTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ExtensionPointTools.java
new file mode 100644
index 0000000000..de7b53b667
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ExtensionPointTools.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 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.utility;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jpt.common.core.JptCommonCoreMessages;
+import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
+import org.eclipse.osgi.util.NLS;
+import org.osgi.framework.Bundle;
+
+/**
+ * {@link IConfigurationElement} utility methods.
+ */
+public class ExtensionPointTools {
+
+ // ********** instantiation **********
+
+ /**
+ * Load the specified class, using the specified bundle, and, if it is a
+ * sub-type of the specified interface, instantiate it and return the resulting
+ * object, cast appropriately.
+ * Log an error and return <code>null</code> for any of the following
+ * conditions:<ul>
+ * <li>the bundle cannot be resolved
+ * <li>the class fails to load
+ * <li>the loaded class is not a sub-type of the specified interface
+ * <li>the loaded class cannot be instantiated
+ * </ul>
+ */
+ public static <T> T instantiate(String pluginID, String extensionPoint, String className, Class<T> interfaze) {
+ Class<T> clazz = loadClass(pluginID, extensionPoint, className, interfaze);
+ return (clazz == null) ? null : instantiate(pluginID, extensionPoint, clazz);
+ }
+
+ /**
+ * Load the specified class, using the specified bundle, and cast it to the
+ * specified interface before returning it.
+ * Log an error and return <code>null</code> for any of the following
+ * conditions:<ul>
+ * <li>the bundle cannot be resolved
+ * <li>the class fails to load
+ * <li>the loaded class is not a sub-type of the specified interface
+ * </ul>
+ */
+ private static <T> Class<T> loadClass(String pluginID, String extensionPoint, String className, Class<T> interfaze) {
+ Bundle bundle = Platform.getBundle(pluginID);
+ if (bundle == null) {
+ logError(JptCommonCoreMessages.REGISTRY_MISSING_BUNDLE, pluginID);
+ return null;
+ }
+
+ Class<?> clazz;
+ try {
+ clazz = bundle.loadClass(className);
+ } catch (Exception ex) {
+ logFailedClassLoad(ex, pluginID, extensionPoint, className);
+ return null;
+ }
+
+ if ( ! interfaze.isAssignableFrom(clazz)) {
+ logFailedInterfaceAssignment(pluginID, extensionPoint, clazz, interfaze);
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ Class<T> clazzT = (Class<T>) clazz;
+ return clazzT;
+ }
+
+ private static void logFailedClassLoad(Exception ex, String pluginID, String extensionPoint, String className) {
+ logError(ex, JptCommonCoreMessages.REGISTRY_FAILED_CLASS_LOAD,
+ className,
+ extensionPoint,
+ pluginID
+ );
+ }
+
+ private static void logFailedInterfaceAssignment(String pluginID, String extensionPoint, Class<?> clazz, Class<?> interfaze) {
+ logError(JptCommonCoreMessages.REGISTRY_FAILED_INTERFACE_ASSIGNMENT,
+ clazz.getName(),
+ extensionPoint,
+ pluginID,
+ interfaze.getName()
+ );
+ }
+
+ /**
+ * Instantiate the specified class.
+ * Log an error and return <code>null</code> if the instantiation fails.
+ */
+ private static <T> T instantiate(String pluginID, String extensionPoint, Class<T> clazz) {
+ try {
+ return clazz.newInstance();
+ } catch (Exception ex) {
+ logFailedInstantiation(ex, pluginID, extensionPoint, clazz);
+ return null;
+ }
+ }
+
+ private static void logFailedInstantiation(Exception ex, String pluginID, String extensionPoint, Class<?> clazz) {
+ logError(ex, JptCommonCoreMessages.REGISTRY_FAILED_INSTANTIATION,
+ clazz.getName(),
+ extensionPoint,
+ pluginID
+ );
+ }
+
+ private static void logError(String msg, Object... args) {
+ JptCommonCorePlugin.instance().logError(msg, args);
+ }
+
+ private static void logError(Throwable ex, String msg, Object... args) {
+ JptCommonCorePlugin.instance().logError(ex, msg, args);
+ }
+
+
+ // ********** error messages **********
+
+ /**
+ * Return a helpful message indicating the specified attribute is missing
+ * from the specified element.
+ */
+ public static String buildMissingAttributeMessage(IConfigurationElement element, String attributeName) {
+ return bind(JptCommonCoreMessages.REGISTRY_MISSING_ATTRIBUTE,
+ attributeName,
+ element.getName(),
+ element.getDeclaringExtension().getExtensionPointUniqueIdentifier(),
+ element.getContributor().getName()
+ );
+ }
+
+ /**
+ * Return a helpful message indicating the specified attribute
+ * from the specified element has an invalid value.
+ */
+ public static String buildInvalidValueMessage(IConfigurationElement element, String attributeName, String invalidValue) {
+ return bind(JptCommonCoreMessages.REGISTRY_INVALID_VALUE,
+ invalidValue,
+ attributeName,
+ element.getDeclaringExtension().getExtensionPointUniqueIdentifier(),
+ element.getContributor().getName()
+ );
+ }
+
+ private static String bind(String msg, Object... args) {
+ return NLS.bind(msg, args);
+ }
+
+
+ // ********** disabled constructor **********
+
+ private ExtensionPointTools() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PathTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PathTools.java
new file mode 100644
index 0000000000..b4cda34bef
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PathTools.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 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.utility;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * {@link IPath} utility methods
+ */
+public class PathTools {
+
+ // ********** paths **********
+
+ /**
+ * Return the {@link IContainer} with the workspace-relative "full" path
+ */
+ public static IContainer getContainer(IPath fullContainerPath) {
+ // changed to handle non-workspace projects
+ String projectName = fullContainerPath.segment(0).toString();
+ IPath projectRelativePath = fullContainerPath.removeFirstSegments(1);
+ IProject project = getWorkspaceRoot().getProject(projectName);
+ return (projectRelativePath.isEmpty()) ? project : project.getFolder(projectRelativePath);
+ }
+
+ /**
+ * Return the {@link IFile} with the workspace relative "full" path
+ */
+ public static IFile getFile(IPath fullFilePath) {
+ // changed to handle non-workspace projects
+ String projectName = fullFilePath.segment(0).toString();
+ IPath projectRelativePath = fullFilePath.removeFirstSegments(1);
+ IProject project = getWorkspaceRoot().getProject(projectName);
+ return project.getFile(projectRelativePath);
+ }
+
+ private static IWorkspaceRoot getWorkspaceRoot() {
+ return getWorkspace().getRoot();
+ }
+
+ static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+
+ // ********** disabled constructor **********
+
+ private PathTools() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java
index 54db2d6716..a87e0bfd18 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java
@@ -9,30 +9,13 @@
******************************************************************************/
package org.eclipse.jpt.common.core.internal.utility;
-import java.io.IOException;
-import java.io.InputStream;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jpt.common.core.JptCommonCoreMessages;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.JptWorkspace;
-import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.osgi.framework.Bundle;
/**
- * A collection of utilities for dealing with the Eclipse platform API.
+ * {@link Platform} utility methods
*/
public class PlatformTools {
@@ -48,214 +31,16 @@ public class PlatformTools {
}
- // ********** resources **********
-
- /**
- * Return the {@link IContainer} with the workspace-relative "full" path
- */
- public static IContainer getContainer(IPath fullContainerPath) {
- // changed to handle non-workspace projects
- String projectName = fullContainerPath.segment(0).toString();
- IPath projectRelativePath = fullContainerPath.removeFirstSegments(1);
- IProject project = getWorkspaceRoot().getProject(projectName);
- return (projectRelativePath.isEmpty()) ? project : project.getFolder(projectRelativePath);
- }
-
- /**
- * Return the {@link IFile} with the workspace relative "full" path
- */
- public static IFile getFile(IPath fullFilePath) {
- // changed to handle non-workspace projects
- String projectName = fullFilePath.segment(0).toString();
- IPath projectRelativePath = fullFilePath.removeFirstSegments(1);
- IProject project = getWorkspaceRoot().getProject(projectName);
- return project.getFile(projectRelativePath);
- }
-
- private static IWorkspaceRoot getWorkspaceRoot() {
- return getWorkspace().getRoot();
- }
-
- private static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
-
- // ********** resource type **********
-
- public static JptResourceType getResourceType(IContentType contentType) {
- JptWorkspace jptWorkspace = getJptWorkspace();
- return (jptWorkspace == null) ? null : jptWorkspace.getResourceTypeManager().getResourceType(contentType);
- }
-
- public static JptResourceType getResourceType(IContentType contentType, String version) {
- JptWorkspace jptWorkspace = getJptWorkspace();
- return (jptWorkspace == null) ? null : jptWorkspace.getResourceTypeManager().getResourceType(contentType, version);
- }
-
- private static JptWorkspace getJptWorkspace() {
- return getAdapter(getWorkspace(), JptWorkspace.class);
- }
-
-
- // ********** content type **********
-
- /**
- * Return the specified file's content type,
- * using the Eclipse platform's content type manager.
- */
- public static IContentType getContentType(IFile file) {
- String fileName = file.getName();
- InputStream fileContents = null;
- try {
- fileContents = file.getContents();
- } catch (CoreException ex) {
- // seems like we can ignore any exception that might occur here;
- // e.g. we get a FNFE if the workspace is out of sync with the O/S file system
- // JptCorePlugin.log(ex);
-
- // look for content type based on the file name only(?)
- return findContentTypeFor(fileName);
- }
-
- IContentType contentType = null;
- try {
- contentType = findContentTypeFor(fileContents, fileName);
- } catch (IOException ex) {
- JptCommonCorePlugin.instance().logError(ex);
- } finally {
- try {
- fileContents.close();
- } catch (IOException ex) {
- JptCommonCorePlugin.instance().logError(ex);
- }
- }
- return contentType;
- }
-
- private static IContentType findContentTypeFor(InputStream fileContents, String fileName) throws IOException {
- return getContentTypeManager().findContentTypeFor(fileContents, fileName);
- }
-
- private static IContentType findContentTypeFor(String fileName) {
- return getContentTypeManager().findContentTypeFor(fileName);
- }
-
- private static IContentTypeManager getContentTypeManager() {
- return Platform.getContentTypeManager();
- }
-
-
- // ********** instantiation **********
-
- /**
- * Load the specified class, using the specified bundle, and, if it is a
- * sub-type of the specified interface, instantiate it and return the resulting
- * object, cast appropriately.
- * Log an error and return <code>null</code> for any of the following
- * conditions:<ul>
- * <li>the bundle cannot be resolved
- * <li>the class fails to load
- * <li>the loaded class is not a sub-type of the specified interface
- * <li>the loaded class cannot be instantiated
- * </ul>
- */
- public static <T> T instantiate(String pluginID, String extensionPoint, String className, Class<T> interfaze) {
- Class<T> clazz = loadClass(pluginID, extensionPoint, className, interfaze);
- return (clazz == null) ? null : instantiate(pluginID, extensionPoint, clazz);
- }
-
- /**
- * Load the specified class, using the specified bundle, and cast it to the
- * specified interface before returning it.
- * Log an error and return <code>null</code> for any of the following
- * conditions:<ul>
- * <li>the bundle cannot be resolved
- * <li>the class fails to load
- * <li>the loaded class is not a sub-type of the specified interface
- * </ul>
- */
- private static <T> Class<T> loadClass(String pluginID, String extensionPoint, String className, Class<T> interfaze) {
- Bundle bundle = Platform.getBundle(pluginID);
- if (bundle == null) {
- logError(JptCommonCoreMessages.REGISTRY_MISSING_BUNDLE, pluginID);
- return null;
- }
-
- Class<?> clazz;
- try {
- clazz = bundle.loadClass(className);
- } catch (Exception ex) {
- logFailedClassLoad(ex, pluginID, extensionPoint, className);
- return null;
- }
-
- if ( ! interfaze.isAssignableFrom(clazz)) {
- logFailedInterfaceAssignment(pluginID, extensionPoint, clazz, interfaze);
- return null;
- }
-
- @SuppressWarnings("unchecked")
- Class<T> clazzT = (Class<T>) clazz;
- return clazzT;
- }
-
- private static void logFailedClassLoad(Exception ex, String pluginID, String extensionPoint, String className) {
- logError(ex, JptCommonCoreMessages.REGISTRY_FAILED_CLASS_LOAD,
- className,
- extensionPoint,
- pluginID
- );
- }
-
- private static void logFailedInterfaceAssignment(String pluginID, String extensionPoint, Class<?> clazz, Class<?> interfaze) {
- logError(JptCommonCoreMessages.REGISTRY_FAILED_INTERFACE_ASSIGNMENT,
- clazz.getName(),
- extensionPoint,
- pluginID,
- interfaze.getName()
- );
- }
-
- /**
- * Instantiate the specified class.
- * Log an error and return <code>null</code> if the instantiation fails.
- */
- private static <T> T instantiate(String pluginID, String extensionPoint, Class<T> clazz) {
- try {
- return clazz.newInstance();
- } catch (Exception ex) {
- logFailedInstantiation(ex, pluginID, extensionPoint, clazz);
- return null;
- }
- }
-
- private static void logFailedInstantiation(Exception ex, String pluginID, String extensionPoint, Class<?> clazz) {
- logError(ex, JptCommonCoreMessages.REGISTRY_FAILED_INSTANTIATION,
- clazz.getName(),
- extensionPoint,
- pluginID
- );
- }
-
- private static void logError(String msg, Object... args) {
- JptCommonCorePlugin.instance().logError(msg, args);
- }
-
- private static void logError(Throwable ex, String msg, Object... args) {
- JptCommonCorePlugin.instance().logError(ex, msg, args);
- }
-
-
// ********** workspace preferences **********
public static String getNewTextFileLineDelimiter() {
IScopeContext[] contexts = new IScopeContext[] { DefaultScope.INSTANCE };
return Platform.getPreferencesService().getString(
- Platform.PI_RUNTIME,
- Platform.PREF_LINE_SEPARATOR,
- StringTools.CR,
- contexts);
+ Platform.PI_RUNTIME,
+ Platform.PREF_LINE_SEPARATOR,
+ StringTools.CR,
+ contexts
+ );
}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java
index 774d1f4198..d6d4cdf297 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java
@@ -167,24 +167,27 @@ public final class TypeTools {
}
public static boolean hasPublicZeroArgConstructor(IType type) {
- boolean hasDefinedConstructor = false;
try {
- for (IMethod method : type.getMethods()) {
- if (method.isConstructor()) {
- if ((method.getNumberOfParameters() == 0) && (Flags.isPublic(method.getFlags()))) {
- return true;
- }
- hasDefinedConstructor = true;
- }
- }
- //When there's no defined constructor, the default constructor is in place.
- if (!hasDefinedConstructor) {
- return true;
- }
+ return hasPublicZeroArgConstructor_(type);
} catch (JavaModelException ex) {
JptCommonCorePlugin.instance().logError(ex);
+ return false;
}
- return false;
+ }
+
+ private static boolean hasPublicZeroArgConstructor_(IType type) throws JavaModelException {
+ boolean ctorDefined = false;
+ for (IMethod method : type.getMethods()) {
+ if (method.isConstructor()) {
+ if ((method.getNumberOfParameters() == 0) && (Flags.isPublic(method.getFlags()))) {
+ return true;
+ }
+ ctorDefined = true;
+ }
+ }
+ // if there are no constructors defined in the source,
+ // the compiler generates a default constructor
+ return ! ctorDefined;
}
public static final Predicate<IType> IS_INTERFACE = new IsInterface();
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java
index ea3c64e154..689631aebc 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/xml/JptXmlResource.java
@@ -28,7 +28,7 @@ import org.eclipse.jpt.common.core.JptResourceModel;
import org.eclipse.jpt.common.core.JptResourceModelListener;
import org.eclipse.jpt.common.core.JptResourceType;
import org.eclipse.jpt.common.core.internal.plugin.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.utility.internal.ListenerList;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jst.j2ee.internal.xml.J2EEXmlDtDEntityResolver;
@@ -97,7 +97,7 @@ public class JptXmlResource
}
protected JptResourceType getResourceType(String version) {
- return (this.contentType == null) ? null : PlatformTools.getResourceType(this.contentType, version);
+ return (this.contentType == null) ? null : ContentTypeTools.getResourceType(this.contentType, version);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
index f675f6b1bc..1a7126e9e2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
@@ -41,7 +41,7 @@ import org.eclipse.jpt.common.core.JptResourceModel;
import org.eclipse.jpt.common.core.JptResourceModelListener;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryTypeCache;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceTypeCompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.internal.utility.ValidationMessageTools;
import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
@@ -408,7 +408,7 @@ public abstract class AbstractJaxbProject
/* file is .java or .jar */
protected boolean isJavaFile(IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
+ IContentType contentType = ContentTypeTools.contentType(file);
return contentType != null
&& (contentType.isKindOf(JavaResourceCompilationUnit.CONTENT_TYPE)
|| contentType.isKindOf(JavaResourcePackageFragmentRoot.JAR_CONTENT_TYPE));
@@ -577,7 +577,7 @@ public abstract class AbstractJaxbProject
return EmptyIterable.instance();
}
- IContentType contentType = PlatformTools.getContentType(file);
+ IContentType contentType = ContentTypeTools.contentType(file);
if (contentType == null) {
return EmptyIterable.instance();
}
@@ -1261,7 +1261,7 @@ public abstract class AbstractJaxbProject
return this.addJaxbFile(file);
}
- if (jaxbFile.getContentType().equals(PlatformTools.getContentType(file))) {
+ if (jaxbFile.getContentType().equals(ContentTypeTools.contentType(file))) {
// content has not changed - ignore
return false;
}
@@ -1327,7 +1327,7 @@ public abstract class AbstractJaxbProject
}
protected boolean externalFileAdded(IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
+ IContentType contentType = ContentTypeTools.contentType(file);
if (contentType == null) {
return false;
}
@@ -1341,7 +1341,7 @@ public abstract class AbstractJaxbProject
}
protected boolean externalFileRemoved(IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
+ IContentType contentType = ContentTypeTools.contentType(file);
if (contentType == null) {
return false;
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformDefinition.java
index 59fdd9825d..3503bb3bee 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformDefinition.java
@@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
@@ -124,10 +124,10 @@ public abstract class GenericJaxbPlatformDefinition
public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
if (contentType.equals(JavaResourceCompilationUnit.CONTENT_TYPE)) {
- return PlatformTools.getResourceType(JavaResourceCompilationUnit.CONTENT_TYPE);
+ return ContentTypeTools.getResourceType(JavaResourceCompilationUnit.CONTENT_TYPE);
}
if (contentType.equals(JavaResourceCompilationUnit.PACKAGE_INFO_CONTENT_TYPE)) {
- return PlatformTools.getResourceType(JavaResourceCompilationUnit.PACKAGE_INFO_CONTENT_TYPE);
+ return ContentTypeTools.getResourceType(JavaResourceCompilationUnit.PACKAGE_INFO_CONTENT_TYPE);
}
throw new IllegalArgumentException(contentType.toString());
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
index a25a3d27c0..0764bfdc4c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
@@ -10,7 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.context.java;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.jaxb.core.JaxbNode;
import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode;
@@ -28,6 +28,6 @@ public abstract class AbstractJavaContextNode
@Override
public JptResourceType getResourceType() {
- return PlatformTools.getResourceType(JavaResourceCompilationUnit.CONTENT_TYPE);
+ return ContentTypeTools.getResourceType(JavaResourceCompilationUnit.CONTENT_TYPE);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformConfig.java
index c117791c51..d266e88f80 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformConfig.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformConfig.java
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.platform;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.jaxb.core.JaxbProject;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformConfig;
@@ -107,7 +107,7 @@ class InternalJaxbPlatformConfig
}
private JaxbPlatformDefinitionFactory buildJaxbPlatformDefinitionFactory() {
- return PlatformTools.instantiate(this.pluginId, this.jaxbPlatformManager.getExtensionPointName(), this.factoryClassName, JaxbPlatformDefinitionFactory.class);
+ return ExtensionPointTools.instantiate(this.pluginId, this.jaxbPlatformManager.getExtensionPointName(), this.factoryClassName, JaxbPlatformDefinitionFactory.class);
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformManager.java
index 04d3fa0922..8002cbc8d1 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformManager.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformManager.java
@@ -19,7 +19,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.RegistryFactory;
import org.eclipse.jpt.common.core.JptCommonCoreMessages;
-import org.eclipse.jpt.common.core.internal.utility.ConfigurationElementTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.SuperIterableWrapper;
@@ -385,11 +385,11 @@ public class InternalJaxbPlatformManager
}
private void logMissingAttribute(IConfigurationElement element, String attributeName) {
- this.getPlugin().logError(ConfigurationElementTools.buildMissingAttributeMessage(element, attributeName));
+ this.getPlugin().logError(ExtensionPointTools.buildMissingAttributeMessage(element, attributeName));
}
private void logInvalidValue(IConfigurationElement element, String nodeName, String invalidValue) {
- this.getPlugin().logError(ConfigurationElementTools.buildInvalidValueMessage(element, nodeName, invalidValue));
+ this.getPlugin().logError(ExtensionPointTools.buildInvalidValueMessage(element, nodeName, invalidValue));
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
index 1d0b69e82d..bf0a00276c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
@@ -14,6 +14,7 @@ import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.AnnotationProvider;
import org.eclipse.jpt.common.core.JptResourceModel;
import org.eclipse.jpt.common.core.internal.SimpleAnnotationProvider;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
import org.eclipse.jpt.common.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
@@ -63,7 +64,7 @@ public final class JaxbPlatformImpl
// ********** JAXB file/resource models **********
public JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
+ IContentType contentType = ContentTypeTools.contentType(file);
return (contentType == null) ? null : this.buildJaxbFile(jaxbProject, file, contentType);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
index d0f3860461..c7e795d6a9 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.jaxb.core.resource.jaxbindex;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceModel;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jaxb.core.internal.plugin.JptJaxbCorePlugin;
@@ -28,7 +28,7 @@ public interface JaxbIndexResource
/**
* The resource type for <code>jaxb.index</code> files.
*/
- JptResourceType RESOURCE_TYPE = PlatformTools.getResourceType(CONTENT_TYPE);
+ JptResourceType RESOURCE_TYPE = ContentTypeTools.getResourceType(CONTENT_TYPE);
String getPackageName();
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
index 0cdd9bc4c1..120edbf90a 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.jaxb.core.resource.jaxbprops;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceModel;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.jaxb.core.internal.plugin.JptJaxbCorePlugin;
@@ -27,7 +27,7 @@ public interface JaxbPropertiesResource
/**
* The resource type for <code>jaxb.properties</code> files.
*/
- JptResourceType RESOURCE_TYPE = PlatformTools.getResourceType(CONTENT_TYPE);
+ JptResourceType RESOURCE_TYPE = ContentTypeTools.getResourceType(CONTENT_TYPE);
String getPackageName();
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java
index 3235ec9b67..6fb1fc979a 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java
@@ -11,7 +11,7 @@ package org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.jaxb.eclipselink.core.internal.plugin.JptJaxbEclipseLinkCorePlugin;
public interface Oxm {
@@ -23,22 +23,22 @@ public interface Oxm {
String SCHEMA_VERSION_2_1 = "2.1";
String SCHEMA_LOCATION_2_1 = "http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_1.xsd";
- JptResourceType RESOURCE_TYPE_2_1 = PlatformTools.getResourceType(CONTENT_TYPE, SCHEMA_VERSION_2_1);
+ JptResourceType RESOURCE_TYPE_2_1 = ContentTypeTools.getResourceType(CONTENT_TYPE, SCHEMA_VERSION_2_1);
String SCHEMA_VERSION_2_2 = "2.2";
String SCHEMA_LOCATION_2_2 = "http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_2.xsd";
- JptResourceType RESOURCE_TYPE_2_2 = PlatformTools.getResourceType(CONTENT_TYPE, SCHEMA_VERSION_2_2);
+ JptResourceType RESOURCE_TYPE_2_2 = ContentTypeTools.getResourceType(CONTENT_TYPE, SCHEMA_VERSION_2_2);
String SCHEMA_VERSION_2_3 = "2.3";
String SCHEMA_LOCATION_2_3 = "http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_3.xsd";
- JptResourceType RESOURCE_TYPE_2_3 = PlatformTools.getResourceType(CONTENT_TYPE, SCHEMA_VERSION_2_3);
+ JptResourceType RESOURCE_TYPE_2_3 = ContentTypeTools.getResourceType(CONTENT_TYPE, SCHEMA_VERSION_2_3);
String SCHEMA_VERSION_2_4 = "2.4";
String SCHEMA_LOCATION_2_4 = "http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_4.xsd";
- JptResourceType RESOURCE_TYPE_2_4 = PlatformTools.getResourceType(CONTENT_TYPE, SCHEMA_VERSION_2_4);
+ JptResourceType RESOURCE_TYPE_2_4 = ContentTypeTools.getResourceType(CONTENT_TYPE, SCHEMA_VERSION_2_4);
// Oxm specific nodes
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
index db35a1e76d..50930a6172 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
@@ -24,6 +24,7 @@ import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.common.utility.internal.StringTools;
@@ -102,7 +103,7 @@ public class JaxbJavaCompletionProposalComputer
private List<ICompletionProposal> computeCompletionProposals_(JavaContentAssistInvocationContext context) {
ICompilationUnit cu = context.getCompilationUnit();
IFile file = (cu != null) ? getCorrespondingResource(cu) : null;
- IContentType contentType = (file != null) ? PlatformTools.getContentType(file) : null;
+ IContentType contentType = (file != null) ? ContentTypeTools.contentType(file) : null;
if (contentType == null || ! contentType.isKindOf(JavaResourceCompilationUnit.CONTENT_TYPE)) {
return Collections.emptyList();
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/InternalJaxbPlatformUiManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/InternalJaxbPlatformUiManager.java
index a5725fbe8f..b4e7a16eca 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/InternalJaxbPlatformUiManager.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/InternalJaxbPlatformUiManager.java
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.RegistryFactory;
import org.eclipse.jpt.common.core.JptCommonCoreMessages;
-import org.eclipse.jpt.common.core.internal.utility.ConfigurationElementTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.jaxb.core.JaxbWorkspace;
@@ -182,7 +182,7 @@ public class InternalJaxbPlatformUiManager
}
private void logMissingAttribute(IConfigurationElement element, String attributeName) {
- this.getPlugin().logError(ConfigurationElementTools.buildMissingAttributeMessage(element, attributeName));
+ this.getPlugin().logError(ExtensionPointTools.buildMissingAttributeMessage(element, attributeName));
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java
index f8bc002d8e..00ca61c8e9 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.platform;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
@@ -64,7 +64,7 @@ class JaxbPlatformUiConfig {
}
private JaxbPlatformUi buildJaxbPlatformUi() {
- return PlatformTools.instantiate(this.pluginID, this.manager.getExtensionPointName(), this.className, JaxbPlatformUi.class);
+ return ExtensionPointTools.instantiate(this.pluginID, this.manager.getExtensionPointName(), this.className, JaxbPlatformUi.class);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/GenericJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/GenericJpaPlatform.java
index 4fc37334bb..f8cdea7f58 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/GenericJpaPlatform.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/GenericJpaPlatform.java
@@ -15,6 +15,7 @@ import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.AnnotationProvider;
import org.eclipse.jpt.common.core.JptResourceModel;
import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
import org.eclipse.jpt.common.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
@@ -27,8 +28,8 @@ import org.eclipse.jpt.jpa.core.JpaPlatform;
import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
import org.eclipse.jpt.jpa.core.JpaResourceDefinition;
+import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
import org.eclipse.jpt.jpa.core.context.java.JavaManagedTypeDefinition;
@@ -120,7 +121,7 @@ public class GenericJpaPlatform
}
/**
- * Performance hook: {@link PlatformTools#getContentType(IFile)} gets the
+ * Performance hook: {@link ContentTypeTools#contentType(IFile)} gets the
* file contents <em>every</em> time. Many of our files are Java files and
* it is possible to determine a Java file's content type from the file
* name; so do that here, before using {@link PlatformTools}.
@@ -132,7 +133,7 @@ public class GenericJpaPlatform
return contentType;
}
}
- return PlatformTools.getContentType(file);
+ return ContentTypeTools.contentType(file);
}
protected JpaFile buildJpaFile(JpaProject jpaProject, IFile file, IContentType contentType) {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JarDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JarDefinition.java
index 281c4f76aa..e4ba9ddcce 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JarDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JarDefinition.java
@@ -11,7 +11,7 @@ package org.eclipse.jpt.jpa.core.internal.context.java;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragmentRoot;
import org.eclipse.jpt.jpa.core.JpaResourceDefinition;
@@ -44,7 +44,7 @@ public class JarDefinition
// ********** misc **********
protected JptResourceType getResourceType(IContentType contentType) {
- return PlatformTools.getResourceType(contentType);
+ return ContentTypeTools.getResourceType(contentType);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaSourceFileDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaSourceFileDefinition.java
index bfa097f652..f0baa40de0 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaSourceFileDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaSourceFileDefinition.java
@@ -11,7 +11,7 @@ package org.eclipse.jpt.jpa.core.internal.context.java;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.jpa.core.JpaResourceDefinition;
@@ -44,7 +44,7 @@ public class JavaSourceFileDefinition
// ********** misc **********
protected JptResourceType getResourceType(IContentType contentType) {
- return PlatformTools.getResourceType(contentType);
+ return ContentTypeTools.getResourceType(contentType);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/PackageInfoDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/PackageInfoDefinition.java
index a9487b2fa0..7c024275cf 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/PackageInfoDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/PackageInfoDefinition.java
@@ -11,7 +11,7 @@ package org.eclipse.jpt.jpa.core.internal.context.java;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.jpa.core.JpaResourceDefinition;
@@ -47,7 +47,7 @@ public class PackageInfoDefinition
// ********** misc **********
protected JptResourceType getResourceType(IContentType contentType) {
- return PlatformTools.getResourceType(contentType);
+ return ContentTypeTools.getResourceType(contentType);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmXmlDefinition.java
index ae96c8d33f..4867670e1c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmXmlDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmXmlDefinition.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.jpa.core.internal.context.orm;
import java.util.ArrayList;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
@@ -177,7 +177,7 @@ public abstract class AbstractOrmXmlDefinition
// ********** misc **********
protected JptResourceType getResourceType(IContentType contentType, String version) {
- return PlatformTools.getResourceType(contentType, version);
+ return ContentTypeTools.getResourceType(contentType, version);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlDefinition.java
index f0ecb2c5a6..a8e8999622 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlDefinition.java
@@ -11,7 +11,7 @@ package org.eclipse.jpt.jpa.core.internal.context.persistence;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlContextModelFactory;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlDefinition;
@@ -43,7 +43,7 @@ public abstract class AbstractPersistenceXmlDefinition
// ********** misc **********
protected JptResourceType getResourceType(IContentType contentType, String version) {
- return PlatformTools.getResourceType(contentType, version);
+ return ContentTypeTools.getResourceType(contentType, version);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java
index 65806d0d4a..c50e2fad10 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java
@@ -13,7 +13,7 @@ import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ContentTypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.AstNodeType;
@@ -79,7 +79,7 @@ public class GenericJarFile
@Override
public JptResourceType getResourceType() {
- return PlatformTools.getResourceType(JavaResourcePackageFragmentRoot.JAR_CONTENT_TYPE);
+ return ContentTypeTools.getResourceType(JavaResourcePackageFragmentRoot.JAR_CONTENT_TYPE);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationOperation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationOperation.java
index 505518b70d..033b4d91d8 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationOperation.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationOperation.java
@@ -26,7 +26,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.PathTools;
import org.eclipse.jpt.common.core.resource.xml.JptXmlResourceProvider;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
@@ -63,7 +63,7 @@ public abstract class AbstractJpaFileCreationOperation
protected IContainer getContainer() throws ExecutionException {
IPath containerPath = (IPath) getDataModel().getProperty(CONTAINER_PATH);
- IContainer container = PlatformTools.getContainer(containerPath);
+ IContainer container = PathTools.getContainer(containerPath);
if (container == null) {
throw new ExecutionException("No container path specified"); //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationOperation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationOperation.java
index 630f902111..79e2b66571 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationOperation.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationOperation.java
@@ -18,7 +18,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.PathTools;
import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
import org.eclipse.jpt.common.core.resource.xml.JptXmlResourceProvider;
import org.eclipse.jpt.jpa.core.JpaProject;
@@ -81,7 +81,7 @@ public class OrmFileCreationOperation
IPath containerPath = (IPath) getDataModel().getProperty(CONTAINER_PATH);
String fileName = getDataModel().getStringProperty(FILE_NAME);
- IContainer container = PlatformTools.getContainer(containerPath);
+ IContainer container = PathTools.getContainer(containerPath);
IPath filePath = container.getFullPath().append(fileName);
IProject project = container.getProject();
ProjectResourceLocator locator = (ProjectResourceLocator) project.getAdapter(ProjectResourceLocator.class);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformConfig.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformConfig.java
index 43c8655434..4a6e1b9b5e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformConfig.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformConfig.java
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.internal.platform;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.predicate.CriterionPredicate;
import org.eclipse.jpt.jpa.core.JpaPlatform;
@@ -126,7 +126,7 @@ class InternalJpaPlatformConfig
}
private JpaPlatformFactory buildJpaPlatformFactory() {
- return PlatformTools.instantiate(this.pluginId, this.jpaPlatformManager.getExtensionPointName(), this.factoryClassName, JpaPlatformFactory.class);
+ return ExtensionPointTools.instantiate(this.pluginId, this.jpaPlatformManager.getExtensionPointName(), this.factoryClassName, JpaPlatformFactory.class);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformManager.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformManager.java
index 1ae753de3e..4a6afaea6f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformManager.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/platform/InternalJpaPlatformManager.java
@@ -19,7 +19,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.RegistryFactory;
import org.eclipse.jpt.common.core.JptCommonCoreMessages;
-import org.eclipse.jpt.common.core.internal.utility.ConfigurationElementTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.SuperIterableWrapper;
@@ -395,11 +395,11 @@ public class InternalJpaPlatformManager
}
private void logMissingAttribute(IConfigurationElement element, String attributeName) {
- this.getPlugin().logError(ConfigurationElementTools.buildMissingAttributeMessage(element, attributeName));
+ this.getPlugin().logError(ExtensionPointTools.buildMissingAttributeMessage(element, attributeName));
}
private void logInvalidValue(IConfigurationElement element, String nodeName, String invalidValue) {
- this.getPlugin().logError(ConfigurationElementTools.buildInvalidValueMessage(element, nodeName, invalidValue));
+ this.getPlugin().logError(ExtensionPointTools.buildInvalidValueMessage(element, nodeName, invalidValue));
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/InternalJpaPlatformUiManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/InternalJpaPlatformUiManager.java
index 5fcb66746a..e357e16745 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/InternalJpaPlatformUiManager.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/InternalJpaPlatformUiManager.java
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.RegistryFactory;
import org.eclipse.jpt.common.core.JptCommonCoreMessages;
-import org.eclipse.jpt.common.core.internal.utility.ConfigurationElementTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.jpa.core.JpaPlatform;
@@ -181,7 +181,7 @@ public class InternalJpaPlatformUiManager
}
private void logMissingAttribute(IConfigurationElement element, String attributeName) {
- this.getPlugin().logError(ConfigurationElementTools.buildMissingAttributeMessage(element, attributeName));
+ this.getPlugin().logError(ExtensionPointTools.buildMissingAttributeMessage(element, attributeName));
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/JpaPlatformUiConfig.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/JpaPlatformUiConfig.java
index 1402ef6c2e..5aaad8b37d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/JpaPlatformUiConfig.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/JpaPlatformUiConfig.java
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jpa.ui.internal.platform;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.ExtensionPointTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
@@ -70,7 +70,7 @@ class JpaPlatformUiConfig {
}
private JpaPlatformUiFactory buildJpaPlatformUiFactory() {
- return PlatformTools.instantiate(this.pluginID, this.manager.getExtensionPointName(), this.factoryClassName, JpaPlatformUiFactory.class);
+ return ExtensionPointTools.instantiate(this.pluginID, this.manager.getExtensionPointName(), this.factoryClassName, JpaPlatformUiFactory.class);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/operation/NewEntityClassOperation.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/operation/NewEntityClassOperation.java
index ec6544679f..443773fbc0 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/operation/NewEntityClassOperation.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/operation/NewEntityClassOperation.java
@@ -43,7 +43,7 @@ import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.internal.utility.PathTools;
import org.eclipse.jpt.common.core.resource.xml.JptXmlResource;
import org.eclipse.jpt.common.ui.internal.utility.SynchronousUiCommandContext;
import org.eclipse.jpt.common.utility.command.Command;
@@ -377,7 +377,7 @@ public class NewEntityClassOperation extends AbstractDataModelOperation {
protected final IContainer createJavaSourceContainer() {
// Get the source folder name from the data model
String containerFullPath = model.getStringProperty(INewJavaClassDataModelProperties.SOURCE_FOLDER);
- IContainer container = PlatformTools.getContainer(new Path(containerFullPath));
+ IContainer container = PathTools.getContainer(new Path(containerFullPath));
// If container does not exist, create the folder with the specified path
if (! container.exists()) {
try {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java
index 6245d6d14a..f93efeb2bd 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java
@@ -33,6 +33,7 @@ import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
import org.eclipse.jpt.common.core.internal.utility.ProjectTools;
+import org.eclipse.jpt.common.core.internal.utility.PathTools;
import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.context.JpaContextModel;
@@ -319,7 +320,7 @@ public class MappingFileWizard extends Wizard
try {
IPath containerPath = (IPath) getDataModel().getProperty(CONTAINER_PATH);
String fileName = getDataModel().getStringProperty(FILE_NAME);
- IContainer container = PlatformTools.getContainer(containerPath);
+ IContainer container = PathTools.getContainer(containerPath);
IFile file = container.getFile(new Path(fileName));
openEditor(file);
}
@@ -363,7 +364,7 @@ public class MappingFileWizard extends Wizard
if (dialog.open() == Window.OK) {
IPath containerPath = (IPath) wizard.getDataModel().getProperty(CONTAINER_PATH);
String fileName = wizard.getDataModel().getStringProperty(FILE_NAME);
- IContainer container = PlatformTools.getContainer(containerPath);
+ IContainer container = PathTools.getContainer(containerPath);
IPath filePath = container.getFullPath().append(fileName);
IProject project = container.getProject();
ProjectResourceLocator locator = (ProjectResourceLocator) project.getAdapter(ProjectResourceLocator.class);

Back to the top