Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ProjectAdapterFactory.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ProjectAdapterFactory.java62
1 files changed, 0 insertions, 62 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ProjectAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ProjectAdapterFactory.java
deleted file mode 100644
index fa80271fb8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ProjectAdapterFactory.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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.core.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- * [Double-duty] factory to build adapters for either standard projects or
- * Java projects:
- * - JPA project
- *
- * See org.eclipse.jpt.core plugin.xml.
- */
-public class ProjectAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JpaProject.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("unchecked") Class adapterType) {
- if (adaptableObject instanceof IProject) {
- return this.getAdapter((IProject) adaptableObject, adapterType);
- }
- if (adaptableObject instanceof IJavaProject) {
- return this.getAdapter((IJavaProject) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IProject project, Class <?>adapterType) {
- if (adapterType == JpaProject.class) {
- return this.getJpaProject(project);
- }
- return null;
- }
-
- private Object getAdapter(IJavaProject javaProject, Class <?>adapterType) {
- if (adapterType == JpaProject.class) {
- return this.getJpaProject(javaProject.getProject());
- }
- return null;
- }
-
- private JpaProject getJpaProject(IProject project) {
- return JptCorePlugin.getJpaProject(project);
- }
-
-}

Back to the top