Interface IBundleProjectDescription
IProject via IBundleProjectService.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
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for the PDE Plug-in project nature, value is"org.eclipse.pde.PluginNature".static final StringIdentifies bundles developed for Eclipse 3.0, value is"3.0".static final StringIdentifies bundles developed for Eclipse 3.1, value is"3.1".static final StringIdentifies bundles developed for Eclipse 3.2, value is"3.2".static final StringIdentifies bundles developed for Eclipse 3.3, value is"3.3".static final StringIdentifies bundles developed for Eclipse 3.4, value is"3.4".static final StringIdentifies bundles developed for Eclipse 3.5, value is"3.5".static final StringIdentifies bundles developed for Eclipse 3.6, value is"3.6".static final StringIdentifies bundles developed for Eclipse 3.7, value is"3.7".static final StringIdentifies bundles developed for Eclipse 3.8, value is"3.8". -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(IProgressMonitor monitor) Creates or modifies a bundle project and associated artifacts based current settings.Returns this bundle's activation policy ornullif unspecified.Returns the value of the Bundle-Activator header for the described bundle, ornullif none.IPath[]Returns the file and folder entries to be included on thebin.includesentry of thebuild.propertiesfile of the described bundle project.Returns the entries on the Bundle-Classpath header of the described bundle, ornullif unspecified.Returns the value of the Bundle-Name header for the described bundle ornullif unspecified.Returns the location within the project that is the root of the bundle related artifacts, ornullto indicate the default location (project folder).Returns the value of the Bundle-Vendor header for the described bundle ornullif unspecified.Returns the value of the Bundle-Version header for the described bundle.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[]Returns the required execution environments for the described bundle, ornullif unspecified.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 the value of the specified header from the bundle manifest, ornullif unspecified.getHost()Returns the host bundle for the described fragment, ornullif this description does not describe a fragment.String[]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 the value of the Bundle-Localization header for the described bundle ornullif unspecified.Returns the location URI for the described project.String[]Returns the list of natures associated with the described project.Returns the value of the Export-Package header ornullif unspecified.Returns the value of the Import-Package header ornullif unspecified.Returns the project associated with the described bundle.Returns the value of the Require-Bundle header ornullif unspecified.Returns the symbolic name of the described bundle ornullif unspecified.Returns the version of Eclipse the described bundle is targeted for, ornullif unspecified.booleanReturns whether the project nature specified by the given nature extension id has been added to the described project.booleanReturns whether the described bundle is targeted for the Equinox OSGi framework.booleanReturns whether this bundle supports extension points and extensions viaIExtensionRegistrysupport.booleanReturns 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.voidSets 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.voidSets 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 Details
-
VERSION_3_0
Identifies bundles developed for Eclipse 3.0, value is"3.0".- See Also:
-
VERSION_3_1
Identifies bundles developed for Eclipse 3.1, value is"3.1".- See Also:
-
VERSION_3_2
Identifies bundles developed for Eclipse 3.2, value is"3.2".- See Also:
-
VERSION_3_3
Identifies bundles developed for Eclipse 3.3, value is"3.3".- See Also:
-
VERSION_3_4
Identifies bundles developed for Eclipse 3.4, value is"3.4".- See Also:
-
VERSION_3_5
Identifies bundles developed for Eclipse 3.5, value is"3.5".- See Also:
-
VERSION_3_6
Identifies bundles developed for Eclipse 3.6, value is"3.6".- See Also:
-
VERSION_3_7
Identifies bundles developed for Eclipse 3.7, value is"3.7".- Since:
- 3.7
- See Also:
-
VERSION_3_8
Identifies bundles developed for Eclipse 3.8, value is"3.8".- Since:
- 3.8
- See Also:
-
PLUGIN_NATURE
Constant for the PDE Plug-in project nature, value is"org.eclipse.pde.PluginNature".- See Also:
-
-
Method Details
-
apply
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
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
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
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:
-
setBundleName
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
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
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
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
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:
-
hasNature
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:
-
setHost
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
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
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.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
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:
-
setActivator
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
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:
-
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:
-
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
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:
-
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
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
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
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
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
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
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
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
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
-
getHeader
Returns the value of the specified header from the bundle manifest, ornullif unspecified. Note that an empty string is returned for a header that has an empty value.- Parameters:
header- header name- Returns:
- header value or
null
-
setBundleClasspath(IBundleClasspathEntry[])