org.eclipse.jpt.core
Class JptCorePlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.jpt.core.JptCorePlugin
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class JptCorePlugin
extends org.eclipse.core.runtime.Plugin

The JPT plug-in lifecycle implementation. A number of globally-available constants and methods. Provisional API: This class is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Field Summary
static java.lang.String CONTENT_PREFIX
           
static java.lang.String CONTENT_PREFIX_
           
static org.eclipse.core.runtime.QualifiedName DATA_SOURCE_CONNECTION_PROFILE_NAME
          The key for storing a JPA project's data source connection profile name in the Eclipse project's persistent properties.
static java.lang.String DEFAULT_ORM_XML_FILE_PATH
           
static java.lang.String DEFAULT_PERSISTENCE_XML_FILE_PATH
           
static java.lang.String DISCOVER_ANNOTATED_CLASSES
          The key for storing a JPA project's "discover" flag in the Eclipse project's preferences.
static java.lang.String FACET_ID
          The identifier for the JPA facet (value "jpt.jpa").
static org.eclipse.core.runtime.content.IContentType JAR_CONTENT_TYPE
          The content type for Java archives (JARs).
static org.eclipse.core.runtime.content.IContentType JAVA_SOURCE_CONTENT_TYPE
          The content type for Java source code files.
static java.lang.String JPA_PLATFORM
          The key for storing a JPA project's platform in the Eclipse project's preferences.
static org.eclipse.core.runtime.content.IContentType MAPPING_FILE_CONTENT_TYPE
           
static org.eclipse.core.runtime.content.IContentType ORM_XML_CONTENT_TYPE
          The content type for orm.xml mappings files.
static org.eclipse.core.runtime.content.IContentType PERSISTENCE_XML_CONTENT_TYPE
          Ditto for persistence.xml.
static java.lang.String PLUGIN_ID
          The plug-in identifier of the persistence support (value "org.eclipse.jpt.core").
static java.lang.String PLUGIN_ID_
           
static org.eclipse.core.runtime.QualifiedName USER_OVERRIDE_DEFAULT_CATALOG_NAME
          The key for storing a JPA project's user overridden default catalog name in the Eclipse project's persistent properties.
static org.eclipse.core.runtime.QualifiedName USER_OVERRIDE_DEFAULT_SCHEMA_NAME
          The key for storing a JPA project's user overridden default schema name in the Eclipse project's persistent properties.
static java.lang.String VALIDATOR_ID
          The identifier for the JPA validator (value "org.eclipse.jpt.core.jpaValidator").
static java.lang.String WEB_PROJECT_DEPLOY_PREFIX
          Web projects have some special exceptions.
static java.lang.String WEB_PROJECT_FACET_ID
          Web projects have some special exceptions.
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
JptCorePlugin()
           
 
Method Summary
static boolean discoverAnnotatedClasses(org.eclipse.core.resources.IProject project)
          Return the JPA "discover" flag associated with the specified Eclipse project.
static java.lang.String getConnectionProfileName(org.eclipse.core.resources.IProject project)
          Return the name of the connection profile associated with the specified Eclipse project.
static java.lang.String getDefaultJpaPlatformId()
          Return the default JPA platform ID for creating new JPA projects
static java.lang.String getDefaultOrmXmlDeploymentURI(org.eclipse.core.resources.IProject project)
          Return the default mapping file (specified as "META-INF/orm.xml") deployment URI for the specified project.
static org.eclipse.core.runtime.preferences.IEclipsePreferences getDefaultPreferences()
          Return the default JPA preferences
static java.lang.String getDeploymentURI(org.eclipse.core.resources.IProject project, java.lang.String defaultURI)
          Tweak the specified deployment URI if the specified project has a web facet.
static org.eclipse.core.runtime.IPath getJarDeploymentRootPath(org.eclipse.core.resources.IProject project)
          Return the deployment path to which jars are relatively specified for the given project (Web projects have a different deployment structure than non-web projects)
static JpaFile getJpaFile(org.eclipse.core.resources.IFile file)
          Return the JPA file corresponding to the specified Eclipse file, or null if unable to associate the specified file with a JPA file.
static JpaFile getJpaFile(org.eclipse.core.resources.IProject project, java.lang.String defaultURI)
           
static JpaModel getJpaModel()
          Return the singular JPA model corresponding to the current workspace.
static JpaPlatform getJpaPlatform(org.eclipse.core.resources.IProject project)
          Return the JPA platform associated with the specified Eclipse project.
static java.lang.String getJpaPlatformId(org.eclipse.core.resources.IProject project)
          Return the JPA platform ID associated with the specified Eclipse project.
static JpaProject getJpaProject(org.eclipse.core.resources.IProject project)
          Return the JPA project corresponding to the specified Eclipse project, or null if unable to associate the specified project with a JPA project.
static java.lang.String getOrmXmlDeploymentURI(org.eclipse.core.resources.IProject project, java.lang.String mappingFileName)
          Return the mapping file (specified as "META-INF/") deployment URI for the specified project.
static java.lang.String getPersistenceXmlDeploymentURI(org.eclipse.core.resources.IProject project)
          Return the persistence.xml (specified as "META-INF/persistence.xml") deployment URI for the specified project.
static org.eclipse.core.resources.IFile getPlatformFile(org.eclipse.core.resources.IProject project, java.lang.String defaultURI)
           
static org.eclipse.core.runtime.preferences.IEclipsePreferences getProjectPreferences(org.eclipse.core.resources.IProject project)
          Return the JPA preferences for the specified Eclipse project.
static java.lang.String getUserOverrideDefaultCatalogName(org.eclipse.core.resources.IProject project)
          Return the default catalog name associated with the specified Eclipse project.
static java.lang.String getUserOverrideDefaultSchemaName(org.eclipse.core.resources.IProject project)
          Return the default schema name associated with the specified Eclipse project.
static org.eclipse.core.runtime.preferences.IEclipsePreferences getWorkspacePreferences()
          Return the JPA preferences for the current workspace instance.
static JptCorePlugin instance()
          Return the singleton JPT plug-in.
static void log(org.eclipse.core.runtime.IStatus status)
          Log the specified status.
static void log(java.lang.String msg)
          Log the specified message.
static void log(java.lang.Throwable throwable)
          Log the specified exception or error.
static boolean projectHasJpaFacet(org.eclipse.core.resources.IProject project)
          Return whether the specified Eclipse project has a JPA facet.
static boolean projectHasWebFacet(org.eclipse.core.resources.IProject project)
          Return whether the specified Eclipse project has a JPA facet.
static void setConnectionProfileName(org.eclipse.core.resources.IProject project, java.lang.String connectionProfileName)
          Set the name of the connection profile associated with the specified Eclipse project.
static void setDefaultJpaPlatformId(java.lang.String platformId)
          Set the default JPA platform ID for creating new JPA projects
static void setDiscoverAnnotatedClasses(org.eclipse.core.resources.IProject project, boolean discoverAnnotatedClasses)
          Set the JPA "discover" flag associated with the specified Eclipse project.
static void setJpaPlatformId(org.eclipse.core.resources.IProject project, java.lang.String jpaPlatformId)
          Set the JPA platform ID associated with the specified Eclipse project.
static void setUserOverrideDefaultCatalogName(org.eclipse.core.resources.IProject project, java.lang.String defaultCatalogName)
          Set the default catalog name associated with the specified Eclipse project.
static void setUserOverrideDefaultSchemaName(org.eclipse.core.resources.IProject project, java.lang.String defaultSchemaName)
          Set the default schema name associated with the specified Eclipse project.
 void start(org.osgi.framework.BundleContext context)
           
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final java.lang.String PLUGIN_ID
The plug-in identifier of the persistence support (value "org.eclipse.jpt.core").

See Also:
Constant Field Values

PLUGIN_ID_

public static final java.lang.String PLUGIN_ID_
See Also:
Constant Field Values

FACET_ID

public static final java.lang.String FACET_ID
The identifier for the JPA facet (value "jpt.jpa").

See Also:
Constant Field Values

JPA_PLATFORM

public static final java.lang.String JPA_PLATFORM
The key for storing a JPA project's platform in the Eclipse project's preferences.

See Also:
Constant Field Values

DISCOVER_ANNOTATED_CLASSES

public static final java.lang.String DISCOVER_ANNOTATED_CLASSES
The key for storing a JPA project's "discover" flag in the Eclipse project's preferences.

See Also:
Constant Field Values

DATA_SOURCE_CONNECTION_PROFILE_NAME

public static final org.eclipse.core.runtime.QualifiedName DATA_SOURCE_CONNECTION_PROFILE_NAME
The key for storing a JPA project's data source connection profile name in the Eclipse project's persistent properties.


USER_OVERRIDE_DEFAULT_CATALOG_NAME

public static final org.eclipse.core.runtime.QualifiedName USER_OVERRIDE_DEFAULT_CATALOG_NAME
The key for storing a JPA project's user overridden default catalog name in the Eclipse project's persistent properties.


USER_OVERRIDE_DEFAULT_SCHEMA_NAME

public static final org.eclipse.core.runtime.QualifiedName USER_OVERRIDE_DEFAULT_SCHEMA_NAME
The key for storing a JPA project's user overridden default schema name in the Eclipse project's persistent properties.


VALIDATOR_ID

public static final java.lang.String VALIDATOR_ID
The identifier for the JPA validator (value "org.eclipse.jpt.core.jpaValidator").

See Also:
Constant Field Values

JAVA_SOURCE_CONTENT_TYPE

public static final org.eclipse.core.runtime.content.IContentType JAVA_SOURCE_CONTENT_TYPE
The content type for Java source code files.


MAPPING_FILE_CONTENT_TYPE

public static final org.eclipse.core.runtime.content.IContentType MAPPING_FILE_CONTENT_TYPE

ORM_XML_CONTENT_TYPE

public static final org.eclipse.core.runtime.content.IContentType ORM_XML_CONTENT_TYPE
The content type for orm.xml mappings files. Use this to add new orm.xml-like extensions to this content type.


PERSISTENCE_XML_CONTENT_TYPE

public static final org.eclipse.core.runtime.content.IContentType PERSISTENCE_XML_CONTENT_TYPE
Ditto for persistence.xml.

See Also:
ORM_XML_CONTENT_TYPE

JAR_CONTENT_TYPE

public static final org.eclipse.core.runtime.content.IContentType JAR_CONTENT_TYPE
The content type for Java archives (JARs).


WEB_PROJECT_FACET_ID

public static final java.lang.String WEB_PROJECT_FACET_ID
Web projects have some special exceptions.

See Also:
Constant Field Values

WEB_PROJECT_DEPLOY_PREFIX

public static final java.lang.String WEB_PROJECT_DEPLOY_PREFIX
Web projects have some special exceptions.

See Also:
Constant Field Values

DEFAULT_PERSISTENCE_XML_FILE_PATH

public static final java.lang.String DEFAULT_PERSISTENCE_XML_FILE_PATH
See Also:
Constant Field Values

DEFAULT_ORM_XML_FILE_PATH

public static final java.lang.String DEFAULT_ORM_XML_FILE_PATH
See Also:
Constant Field Values

CONTENT_PREFIX

public static final java.lang.String CONTENT_PREFIX
See Also:
Constant Field Values

CONTENT_PREFIX_

public static final java.lang.String CONTENT_PREFIX_
See Also:
Constant Field Values
Constructor Detail

JptCorePlugin

public JptCorePlugin()
Method Detail

instance

public static JptCorePlugin instance()
Return the singleton JPT plug-in.


getJpaModel

public static JpaModel getJpaModel()
Return the singular JPA model corresponding to the current workspace.


getJpaProject

public static JpaProject getJpaProject(org.eclipse.core.resources.IProject project)
Return the JPA project corresponding to the specified Eclipse project, or null if unable to associate the specified project with a JPA project.


getJpaFile

public static JpaFile getJpaFile(org.eclipse.core.resources.IFile file)
Return the JPA file corresponding to the specified Eclipse file, or null if unable to associate the specified file with a JPA file.


projectHasJpaFacet

public static boolean projectHasJpaFacet(org.eclipse.core.resources.IProject project)
Return whether the specified Eclipse project has a JPA facet.


projectHasWebFacet

public static boolean projectHasWebFacet(org.eclipse.core.resources.IProject project)
Return whether the specified Eclipse project has a JPA facet.


getPersistenceXmlDeploymentURI

public static java.lang.String getPersistenceXmlDeploymentURI(org.eclipse.core.resources.IProject project)
Return the persistence.xml (specified as "META-INF/persistence.xml") deployment URI for the specified project.


getDefaultOrmXmlDeploymentURI

public static java.lang.String getDefaultOrmXmlDeploymentURI(org.eclipse.core.resources.IProject project)
Return the default mapping file (specified as "META-INF/orm.xml") deployment URI for the specified project.


getOrmXmlDeploymentURI

public static java.lang.String getOrmXmlDeploymentURI(org.eclipse.core.resources.IProject project,
                                                      java.lang.String mappingFileName)
Return the mapping file (specified as "META-INF/") deployment URI for the specified project.


getDeploymentURI

public static java.lang.String getDeploymentURI(org.eclipse.core.resources.IProject project,
                                                java.lang.String defaultURI)
Tweak the specified deployment URI if the specified project has a web facet.


getJarDeploymentRootPath

public static org.eclipse.core.runtime.IPath getJarDeploymentRootPath(org.eclipse.core.resources.IProject project)
Return the deployment path to which jars are relatively specified for the given project (Web projects have a different deployment structure than non-web projects)


getPlatformFile

public static org.eclipse.core.resources.IFile getPlatformFile(org.eclipse.core.resources.IProject project,
                                                               java.lang.String defaultURI)

getJpaFile

public static JpaFile getJpaFile(org.eclipse.core.resources.IProject project,
                                 java.lang.String defaultURI)

getDefaultPreferences

public static org.eclipse.core.runtime.preferences.IEclipsePreferences getDefaultPreferences()
Return the default JPA preferences

See Also:
JpaPreferenceInitializer

getWorkspacePreferences

public static org.eclipse.core.runtime.preferences.IEclipsePreferences getWorkspacePreferences()
Return the JPA preferences for the current workspace instance.


getProjectPreferences

public static org.eclipse.core.runtime.preferences.IEclipsePreferences getProjectPreferences(org.eclipse.core.resources.IProject project)
Return the JPA preferences for the specified Eclipse project.


getDefaultJpaPlatformId

public static java.lang.String getDefaultJpaPlatformId()
Return the default JPA platform ID for creating new JPA projects


setDefaultJpaPlatformId

public static void setDefaultJpaPlatformId(java.lang.String platformId)
Set the default JPA platform ID for creating new JPA projects


getJpaPlatform

public static JpaPlatform getJpaPlatform(org.eclipse.core.resources.IProject project)
Return the JPA platform associated with the specified Eclipse project.


getJpaPlatformId

public static java.lang.String getJpaPlatformId(org.eclipse.core.resources.IProject project)
Return the JPA platform ID associated with the specified Eclipse project.


setJpaPlatformId

public static void setJpaPlatformId(org.eclipse.core.resources.IProject project,
                                    java.lang.String jpaPlatformId)
Set the JPA platform ID associated with the specified Eclipse project.


discoverAnnotatedClasses

public static boolean discoverAnnotatedClasses(org.eclipse.core.resources.IProject project)
Return the JPA "discover" flag associated with the specified Eclipse project.


setDiscoverAnnotatedClasses

public static void setDiscoverAnnotatedClasses(org.eclipse.core.resources.IProject project,
                                               boolean discoverAnnotatedClasses)
Set the JPA "discover" flag associated with the specified Eclipse project.


getConnectionProfileName

public static java.lang.String getConnectionProfileName(org.eclipse.core.resources.IProject project)
Return the name of the connection profile associated with the specified Eclipse project.


setConnectionProfileName

public static void setConnectionProfileName(org.eclipse.core.resources.IProject project,
                                            java.lang.String connectionProfileName)
Set the name of the connection profile associated with the specified Eclipse project.


getUserOverrideDefaultCatalogName

public static java.lang.String getUserOverrideDefaultCatalogName(org.eclipse.core.resources.IProject project)
Return the default catalog name associated with the specified Eclipse project.

See Also:
JpaProject#getUserOverrideDefaultCatalogName()

setUserOverrideDefaultCatalogName

public static void setUserOverrideDefaultCatalogName(org.eclipse.core.resources.IProject project,
                                                     java.lang.String defaultCatalogName)
Set the default catalog name associated with the specified Eclipse project.

See Also:
JpaProject#setUserOverrideDefaultCatalogName()

getUserOverrideDefaultSchemaName

public static java.lang.String getUserOverrideDefaultSchemaName(org.eclipse.core.resources.IProject project)
Return the default schema name associated with the specified Eclipse project.

See Also:
JpaProject#getUserOverrideDefaultSchemaName()

setUserOverrideDefaultSchemaName

public static void setUserOverrideDefaultSchemaName(org.eclipse.core.resources.IProject project,
                                                    java.lang.String defaultSchemaName)
Set the default schema name associated with the specified Eclipse project.

See Also:
JpaProject#setUserOverrideDefaultSchemaName()

log

public static void log(org.eclipse.core.runtime.IStatus status)
Log the specified status.


log

public static void log(java.lang.String msg)
Log the specified message.


log

public static void log(java.lang.Throwable throwable)
Log the specified exception or error.


start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class org.eclipse.core.runtime.Plugin
Throws:
java.lang.Exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws java.lang.Exception
Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class org.eclipse.core.runtime.Plugin
Throws:
java.lang.Exception