Interface IBundleProjectDescription
-
public interface IBundleProjectDescriptionDescribes a project representing an OSGi bundle. Used to create or modify artifacts associated with a bundle project. A bundle project description can be created for anIProjectviaIBundleProjectService.getDescription(IProject).- Since:
- 3.6
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPLUGIN_NATUREConstant for the PDE Plug-in project nature, value is"org.eclipse.pde.PluginNature".static StringVERSION_3_0Identifies bundles developed for Eclipse 3.0, value is"3.0".static StringVERSION_3_1Identifies bundles developed for Eclipse 3.1, value is"3.1".static StringVERSION_3_2Identifies bundles developed for Eclipse 3.2, value is"3.2".static StringVERSION_3_3Identifies bundles developed for Eclipse 3.3, value is"3.3".static StringVERSION_3_4Identifies bundles developed for Eclipse 3.4, value is"3.4".static StringVERSION_3_5Identifies bundles developed for Eclipse 3.5, value is"3.5".static StringVERSION_3_6Identifies bundles developed for Eclipse 3.6, value is"3.6".static StringVERSION_3_7Identifies bundles developed for Eclipse 3.7, value is"3.7".static StringVERSION_3_8Identifies bundles developed for Eclipse 3.8, value is"3.8".
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidapply(IProgressMonitor monitor)Creates or modifies a bundle project and associated artifacts based current settings.StringgetActivationPolicy()Returns this bundle's activation policy ornullif unspecified.StringgetActivator()Returns the value of the Bundle-Activator header for the described bundle, ornullif none.IPath[]getBinIncludes()Returns the file and folder entries to be included on thebin.includesentry of thebuild.propertiesfile of the described bundle project.IBundleClasspathEntry[]getBundleClasspath()Returns the entries on the Bundle-Classpath header of the described bundle, ornullif unspecified.StringgetBundleName()Returns the value of the Bundle-Name header for the described bundle ornullif unspecified.IPathgetBundleRoot()Returns the location within the project that is the root of the bundle related artifacts, ornullto indicate the default location (project folder).StringgetBundleVendor()Returns the value of the Bundle-Vendor header for the described bundle ornullif unspecified.VersiongetBundleVersion()Returns the value of the Bundle-Version header for the described bundle.IPathgetDefaultOutputFolder()Returns a project relative path for the described bundle's default output folder used on the Java build path, ornullto indicate the default output location is used.String[]getExecutionEnvironments()Returns the required execution environments for the described bundle, ornullif unspecified.StringgetExportWizardId()Returns the identifier of theorg.eclipse.ui.exportWizardsextension used in the manifest editor for exporting the project associated with these settings, ornullif the default export wizard should be used.StringgetHeader(String header)Returns the value of the specified header from the bundle manifest, ornullif unspecified.IHostDescriptiongetHost()Returns the host bundle for the described fragment, ornullif this description does not describe a fragment.String[]getLaunchShortcuts()Returns identifiers oforg.eclipse.debug.ui.launchShortcutsreferenced byorg.eclipse.pde.ui.launchShortcutsextensions that will be displayed in the manifest editor for the project associated with these settings, ornullif default shortcuts are being used.IPathgetLocalization()Returns the value of the Bundle-Localization header for the described bundle ornullif unspecified.URIgetLocationURI()Returns the location URI for the described project.String[]getNatureIds()Returns the list of natures associated with the described project.IPackageExportDescription[]getPackageExports()Returns the value of the Export-Package header ornullif unspecified.IPackageImportDescription[]getPackageImports()Returns the value of the Import-Package header ornullif unspecified.IProjectgetProject()Returns the project associated with the described bundle.IRequiredBundleDescription[]getRequiredBundles()Returns the value of the Require-Bundle header ornullif unspecified.StringgetSymbolicName()Returns the symbolic name of the described bundle ornullif unspecified.StringgetTargetVersion()Returns the version of Eclipse the described bundle is targeted for, ornullif unspecified.booleanhasNature(String natureId)Returns whether the project nature specified by the given nature extension id has been added to the described project.booleanisEquinox()Returns whether the described bundle is targeted for the Equinox OSGi framework.booleanisExtensionRegistry()Returns whether this bundle supports extension points and extensions viaIExtensionRegistrysupport.booleanisSingleton()Returns whether the described bundle is a singleton.voidsetActivationPolicy(String policy)Sets this bundle's activation policy.voidsetActivator(String className)Sets the value of the Bundle-Activator header for the described bundle, ornullif none.voidsetBinIncludes(IPath[] paths)Sets file and folder entries on thebin.includesentry of thebuild.propertiesfile of the described bundle project.voidsetBundleClassath(IBundleClasspathEntry[] entries)Deprecated.voidsetBundleClasspath(IBundleClasspathEntry[] entries)Sets the entries for the Bundle-Classpath header of the described bundle, ornullif unspecified.voidsetBundleName(String name)Sets the value of the Bundle-Name header for the described bundle.voidsetBundleRoot(IPath path)Sets the location within the project where the root of the bundle and its associated artifacts will reside, ornullto indicate the default bundle root location should be used (project folder).voidsetBundleVendor(String name)Sets the value of the Bundle-Vendor header for the described bundle.voidsetBundleVersion(Version version)Sets the value of the Bundle-Version header for the described bundle.voidsetDefaultOutputFolder(IPath output)Sets a project relative path for the default output folder used on the Java build path for the described bundle.voidsetEquinox(boolean equinox)Sets whether the described bundle is targeted for the Equinox OSGi framework.voidsetExecutionEnvironments(String[] environments)Sets the required execution environments for the described bundle, possiblenull.voidsetExportWizardId(String id)Sets the identifier of theorg.eclipse.ui.exportWizardsextension used in the manifest editor for exporting the project associated with these settings, ornullif the default export wizard should be used.voidsetExtensionRegistry(boolean supportExtensions)Sets whether this bundle supports extension points and extensions viaIExtensionRegistrysupport.voidsetHeader(String header, String value)Sets the value of the specified header in the bundle manifest to the given value or removes the header if the value isnull.voidsetHost(IHostDescription host)Sets the the Fragment-Host header for the described fragment.voidsetLaunchShortcuts(String[] ids)Sets the identifiers oforg.eclipse.debug.ui.launchShortcutsreferenced byorg.eclipse.pde.ui.launchShortcutsextensions to be displayed in the manifest editor for the project associated with these settings, ornullto indicate default shortcuts should be used.voidsetLocalization(IPath path)Sets the value of the Bundle-Localization header for the described bundle.voidsetLocationURI(URI location)Sets the location for the described project.voidsetNatureIds(String[] natures)Sets the list of natures associated with the described project.voidsetPackageExports(IPackageExportDescription[] exports)Sets the value of the Export-Package header for the described bundle.voidsetPackageImports(IPackageImportDescription[] imports)Sets the value of the Import-Package header for the described bundle.voidsetRequiredBundles(IRequiredBundleDescription[] bundles)Sets the value of the Require-Bundle header for the described bundle.voidsetSingleton(boolean singleton)Sets whether the described bundle is a singleton.voidsetSymbolicName(String name)Sets the symbolic name of the described bundle.voidsetTargetVersion(String version)Sets the version of Eclipse the described bundle is to targeted for.
-
-
-
Field Detail
-
VERSION_3_0
static final String VERSION_3_0
Identifies bundles developed for Eclipse 3.0, value is"3.0".- See Also:
- Constant Field Values
-
VERSION_3_1
static final String VERSION_3_1
Identifies bundles developed for Eclipse 3.1, value is"3.1".- See Also:
- Constant Field Values
-
VERSION_3_2
static final String VERSION_3_2
Identifies bundles developed for Eclipse 3.2, value is"3.2".- See Also:
- Constant Field Values
-
VERSION_3_3
static final String VERSION_3_3
Identifies bundles developed for Eclipse 3.3, value is"3.3".- See Also:
- Constant Field Values
-
VERSION_3_4
static final String VERSION_3_4
Identifies bundles developed for Eclipse 3.4, value is"3.4".- See Also:
- Constant Field Values
-
VERSION_3_5
static final String VERSION_3_5
Identifies bundles developed for Eclipse 3.5, value is"3.5".- See Also:
- Constant Field Values
-
VERSION_3_6
static final String VERSION_3_6
Identifies bundles developed for Eclipse 3.6, value is"3.6".- See Also:
- Constant Field Values
-
VERSION_3_7
static final String VERSION_3_7
Identifies bundles developed for Eclipse 3.7, value is"3.7".- Since:
- 3.7
- See Also:
- Constant Field Values
-
VERSION_3_8
static final String VERSION_3_8
Identifies bundles developed for Eclipse 3.8, value is"3.8".- Since:
- 3.8
- See Also:
- Constant Field Values
-
PLUGIN_NATURE
static final String PLUGIN_NATURE
Constant for the PDE Plug-in project nature, value is"org.eclipse.pde.PluginNature".- See Also:
- Constant Field Values
-
-
Method Detail
-
apply
void apply(IProgressMonitor monitor) throws CoreException
Creates or modifies a bundle project and associated artifacts based current settings.- Parameters:
monitor- progress monitor ornull- Throws:
CoreException- if project creation or modification fails
-
setSymbolicName
void setSymbolicName(String name)
Sets the symbolic name of the described bundle.A symbolic name must be specified.
- Parameters:
name- bundle symbolic name
-
getSymbolicName
String getSymbolicName()
Returns the symbolic name of the described bundle ornullif unspecified.- Returns:
- bundle symbolic name or
null
-
setLocationURI
void setLocationURI(URI location)
Sets the location for the described project. Ifnullis specified, the default location is used.Setting the location on a description for a project which already exists has no effect; the new project location is ignored when the description is applied to the already existing project. This method is intended for use on descriptions for new projects.
This operation maps the root folder of the project to the exact location provided. For example, if the location for project named "P" is set to the URI file://c:/my_plugins/Project1, the file resource at workspace path /P/index.html would be stored in the local file system at file://c:/my_plugins/Project1/index.html.
- Parameters:
location- the location for the described project ornull- See Also:
getLocationURI(),IProjectDescription.setLocationURI(URI)
-
getLocationURI
URI getLocationURI()
Returns the location URI for the described project.nullis returned if the default location should be used.- Returns:
- the location for the described project or
null - See Also:
setLocationURI(URI)
-
setBundleName
void setBundleName(String name)
Sets the value of the Bundle-Name header for the described bundle. Whennull, the bundle name defaults to the bundle symbolic name.- Parameters:
name- bundle name
-
getBundleName
String getBundleName()
Returns the value of the Bundle-Name header for the described bundle ornullif unspecified.For new projects, the bundle name defaults to the bundle symbolic name.
- Returns:
- bundle name or
null
-
setBundleVendor
void setBundleVendor(String name)
Sets the value of the Bundle-Vendor header for the described bundle.- Parameters:
name- bundle vendor name
-
getBundleVendor
String getBundleVendor()
Returns the value of the Bundle-Vendor header for the described bundle ornullif unspecified.- Returns:
- bundle vendor name or
null
-
setBundleVersion
void setBundleVersion(Version version)
Sets the value of the Bundle-Version header for the described bundle. Whennull, the bundle version defaults to1.0.0.qualifier.- Parameters:
version- bundle version
-
getBundleVersion
Version getBundleVersion()
Returns the value of the Bundle-Version header for the described bundle.For new projects, the bundle version is
1.0.0.qualifierunless otherwise specified.- Returns:
- bundle version or
nullif unspecified
-
setSingleton
void setSingleton(boolean singleton)
Sets whether the described bundle is a singleton.- Parameters:
singleton- whether the described bundle is a singleton
-
isSingleton
boolean isSingleton()
Returns whether the described bundle is a singleton.A bundle description for a new project is not a singleton, by default.
- Returns:
- whether the described bundle is a singleton
-
setLocalization
void setLocalization(IPath path)
Sets the value of the Bundle-Localization header for the described bundle.- Parameters:
path- bundle root relative path ornull
-
getLocalization
IPath getLocalization()
Returns the value of the Bundle-Localization header for the described bundle ornullif unspecified.- Returns:
- bundle relative path or
null
-
getNatureIds
String[] getNatureIds()
Returns the list of natures associated with the described project. Returns an empty array if there are no natures on this description.- Returns:
- the list of natures for the described project
- See Also:
setNatureIds(String[]),IProjectDescription.setNatureIds(String[])
-
setNatureIds
void setNatureIds(String[] natures)
Sets the list of natures associated with the described project. A project created with this description will have these natures added to it in the given order when this description is applied.When creating a new project, plug-in and Java natures (
PLUGIN_NATUREandJavaCore.NATURE_ID) will be added by default when unspecified.- Parameters:
natures- the list of natures- See Also:
getNatureIds(),IProjectDescription.getNatureIds()
-
hasNature
boolean hasNature(String natureId)
Returns whether the project nature specified by the given nature extension id has been added to the described project.- Parameters:
natureId- the nature extension identifier- Returns:
trueif the described project has the given nature- See Also:
IProjectDescription.hasNature(String)
-
setHost
void setHost(IHostDescription host)
Sets the the Fragment-Host header for the described fragment. When a non-nullvalue is specified, this bundle description describes a fragment.- Parameters:
host- host specification ornull
-
getHost
IHostDescription getHost()
Returns the host bundle for the described fragment, ornullif this description does not describe a fragment.- Returns:
- host specification or
null
-
setDefaultOutputFolder
void setDefaultOutputFolder(IPath output)
Sets a project relative path for the default output folder used on the Java build path for the described bundle.nullindicates the Java project's default output location should be used.- Parameters:
output- project relative path to default output location ornull
-
getDefaultOutputFolder
IPath getDefaultOutputFolder()
Returns a project relative path for the described bundle's default output folder used on the Java build path, ornullto indicate the default output location is used.- Returns:
- default project relative output folder path or
null
-
setExecutionEnvironments
void setExecutionEnvironments(String[] environments)
Sets the required execution environments for the described bundle, possiblenull. When more than one environment specified, the first will be used to configure compiler compliance and build path settings.- Parameters:
environments- execution environment identifiers ornull
-
getExecutionEnvironments
String[] getExecutionEnvironments()
Returns the required execution environments for the described bundle, ornullif unspecified. When more than one environment is specified, the first will be used to configure compiler compliance and build path settings.- Returns:
- execution environment identifiers or
null
-
setBundleClassath
@Deprecated void setBundleClassath(IBundleClasspathEntry[] entries)
Deprecated.Sets the entries for the Bundle-Classpath header of the described bundle, ornullif unspecified. Specifies the relationship between source and/or binary folders with bundle classpath entries. Whennullis specified, no Bundle-Classpath header will be produced.- Parameters:
entries- Bundle-Classpath header entries ornull
-
setBundleClasspath
void setBundleClasspath(IBundleClasspathEntry[] entries)
Sets the entries for the Bundle-Classpath header of the described bundle, ornullif unspecified. Specifies the relationship between source and/or binary folders with bundle classpath entries. Whennullis specified, no Bundle-Classpath header will be produced.- Parameters:
entries- Bundle-Classpath header entries ornull- Since:
- 3.7
-
getBundleClasspath
IBundleClasspathEntry[] getBundleClasspath()
Returns the entries on the Bundle-Classpath header of the described bundle, ornullif unspecified.- Returns:
- bundle class path entries or
nullif unspecified - See Also:
setBundleClasspath(IBundleClasspathEntry[])
-
setActivator
void setActivator(String className)
Sets the value of the Bundle-Activator header for the described bundle, ornullif none.- Parameters:
className- activator class name ornull
-
getActivator
String getActivator()
Returns the value of the Bundle-Activator header for the described bundle, ornullif none.- Returns:
- bundle activator class name or
null
-
setTargetVersion
void setTargetVersion(String version)
Sets the version of Eclipse the described bundle is to targeted for. This affects the values generated for Equinox specific headers. Has no effect whenisEquinox()isfalse. WhenisEquinox()istrue, and a target version is unspecified or set tonull, the newest available target version of Eclipse is used.- Parameters:
version- one of the version constant values defined by this class ornull- See Also:
setEquinox(boolean)
-
getTargetVersion
String getTargetVersion()
Returns the version of Eclipse the described bundle is targeted for, ornullif unspecified. When unspecified, the project is targeted to the newest available version of Eclipse whenisEquinox()istrue.- Returns:
- target version or
null
-
setEquinox
void setEquinox(boolean equinox)
Sets whether the described bundle is targeted for the Equinox OSGi framework.An Equniox specific lazy-start header will be generated in the associated manifest when
truebased on the target version and activation policy. For new projects the value isfalse, by default.This following headers are affected when
true, based on thegetTargetVersion()andgetActivationPolicy(). The headers are removed whengetActivationPolicy()is unspecified (null).Eclipse-AutoStartis set totruewhen the target version is 3.1 andgetActivationPolicy()isConstants.ACTIVATION_LAZYEclipse-LazyStartis set totruewhen the target version is 3.2 or 3.3 andgetActivationPolicy()isConstants.ACTIVATION_LAZYBundle-ActivationPolicyis set tolazywhen the target version is 3.4 or greater andgetActivationPolicy()isConstants.ACTIVATION_LAZY
- Parameters:
equinox- whether targeted for the Equinox OSGi framework- See Also:
getTargetVersion()
-
isEquinox
boolean isEquinox()
Returns whether the described bundle is targeted for the Equinox OSGi framework. Affects the Equinox lazy-start header generated in the manifest.- Returns:
- whether the described bundle is targeted for the Equinox OSGi framework
-
setActivationPolicy
void setActivationPolicy(String policy)
Sets this bundle's activation policy. Legal values areConstants.ACTIVATION_LAZYornull(unspecified). Any other values are ignored (equivalent tonull). When unspecified, a corresponding header is not generated. By default the value is unspecified for newly created projects.An Equniox specific lazy-start header will be generated in the associated manifest based on the
getTargetVersion()and the specified policy. The headers are removed when the policy is unspecified (null).Eclipse-AutoStartis set totruewhen the target version is 3.1 and policy isConstants.ACTIVATION_LAZYEclipse-LazyStartis set totruewhen the target version is 3.2 or 3.3 and policy isConstants.ACTIVATION_LAZYBundle-ActivationPolicyis set tolazywhen the target version is 3.4 or greater and policy isConstants.ACTIVATION_LAZY
- Parameters:
policy- activation policy ornull- See Also:
getTargetVersion()
-
getActivationPolicy
String getActivationPolicy()
Returns this bundle's activation policy ornullif unspecified.- Returns:
- activation policy or
null
-
setExtensionRegistry
void setExtensionRegistry(boolean supportExtensions)
Sets whether this bundle supports extension points and extensions viaIExtensionRegistrysupport. By default, this value isfalsefor new projects.- Parameters:
supportExtensions- whether extension points and extensions are supported
-
isExtensionRegistry
boolean isExtensionRegistry()
Returns whether this bundle supports extension points and extensions viaIExtensionRegistrysupport. By default, this value isfalsefor new projects.- Returns:
- whether extension points and extensions are supported
-
setRequiredBundles
void setRequiredBundles(IRequiredBundleDescription[] bundles)
Sets the value of the Require-Bundle header for the described bundle.- Parameters:
bundles- required bundle descriptions ornullif none
-
getRequiredBundles
IRequiredBundleDescription[] getRequiredBundles()
Returns the value of the Require-Bundle header ornullif unspecified.- Returns:
- required bundle descriptions or
null
-
setPackageImports
void setPackageImports(IPackageImportDescription[] imports)
Sets the value of the Import-Package header for the described bundle.- Parameters:
imports- package import descriptions ornullif none
-
getPackageImports
IPackageImportDescription[] getPackageImports()
Returns the value of the Import-Package header ornullif unspecified.- Returns:
- package import descriptions or
null
-
setPackageExports
void setPackageExports(IPackageExportDescription[] exports)
Sets the value of the Export-Package header for the described bundle.- Parameters:
exports- package export descriptions ornullif none
-
getPackageExports
IPackageExportDescription[] getPackageExports()
Returns the value of the Export-Package header ornullif unspecified.- Returns:
- package export descriptions or
null
-
getProject
IProject getProject()
Returns the project associated with the described bundle.- Returns:
- associated project
-
setBinIncludes
void setBinIncludes(IPath[] paths)
Sets file and folder entries on thebin.includesentry of thebuild.propertiesfile of the described bundle project.By default, the
MANIFEST/folder and any entries on the Bundle-Classpath will be included. This sets any additional entries that are to be included.- Parameters:
paths- bundle root relative paths of files and folders to include ornullif none
-
getBinIncludes
IPath[] getBinIncludes()
Returns the file and folder entries to be included on thebin.includesentry of thebuild.propertiesfile of the described bundle project.By default, the
MANIFEST/folder and any entries on the Bundle-Classpath will be included. This returns any additional entries that are to be included.- Returns:
- bundle root relative paths of files and folders on the
bin.includesentry ornull
-
setBundleRoot
void setBundleRoot(IPath path)
Sets the location within the project where the root of the bundle and its associated artifacts will reside, ornullto indicate the default bundle root location should be used (project folder).This has no effect on existing projects. This method is intended for use on descriptions for new projects. To modify the bundle root of an existing project use
IBundleProjectService.setBundleRoot(IProject, IPath).The bundle root is the folder containing the
META-INF/folder. When a project does not yet exist, bundle files will be created relative to the bundle root. When a project already exists and the bundle root location is modified, existing bundle artifacts at the old root are not moved or modified. Instead, the modify operation will update any existing bundle files at the new root location, or create them if not yet present.- Parameters:
path- project relative path to bundle root artifacts in the project ornull
-
getBundleRoot
IPath getBundleRoot()
Returns the location within the project that is the root of the bundle related artifacts, ornullto indicate the default location (project folder).- Returns:
- project relative bundle root path or
null
-
getLaunchShortcuts
String[] getLaunchShortcuts()
Returns identifiers oforg.eclipse.debug.ui.launchShortcutsreferenced byorg.eclipse.pde.ui.launchShortcutsextensions that will be displayed in the manifest editor for the project associated with these settings, ornullif default shortcuts are being used.- Returns:
- identifiers of the
org.eclipse.debug.ui.launchShortcutsextensions ornull
-
setLaunchShortcuts
void setLaunchShortcuts(String[] ids)
Sets the identifiers oforg.eclipse.debug.ui.launchShortcutsreferenced byorg.eclipse.pde.ui.launchShortcutsextensions to be displayed in the manifest editor for the project associated with these settings, ornullto indicate default shortcuts should be used.When default shortcuts are used, all
org.eclipse.pde.ui.launchShortcutsextensions are considered. When specific shortcuts are specified, the available shortcuts will be limited to those specified.Important: When specifying shortcuts, both
org.eclipse.debug.ui.launchShortcutsandorg.eclipse.pde.ui.launchShortcutsmust exist. Labels for shortcuts in the editor are derived from theorg.eclipse.pde.ui.launchShortcuts.- Parameters:
ids- identifiers oforg.eclipse.debug.ui.launchShortcutsextensions ornull
-
getExportWizardId
String getExportWizardId()
Returns the identifier of theorg.eclipse.ui.exportWizardsextension used in the manifest editor for exporting the project associated with these settings, ornullif the default export wizard should be used.- Returns:
- identifier of an
org.eclipse.ui.exportWizardsextension ornull
-
setExportWizardId
void setExportWizardId(String id)
Sets the identifier of theorg.eclipse.ui.exportWizardsextension used in the manifest editor for exporting the project associated with these settings, ornullif the default export wizard should be used.- Parameters:
id- identifier of anorg.eclipse.ui.exportWizardsextension ornull
-
setHeader
void setHeader(String header, String value)
Sets the value of the specified header in the bundle manifest to the given value or removes the header if the value isnull.Using this method will override the value of a header generated by other methods in this interface. For example, using the method
setBundleName(String)will generate a value for theBundle-Nameheader, but callingsetHeader(String, String)for theBundle-Nameheader will override any value set viasetBundleName(String). This method is intended to be used to set the value of a header that does not have explicit API.To include an empty header
value.trim().length()must equal zero (i.e an empty string or a string of whitespace).- Parameters:
header- header namevalue- header value ornullto remove
-
-