public interface ITargetPlatformService
Modifier and Type | Field and Description |
---|---|
static int |
STATUS_MISSING_FROM_TARGET_DEFINITION
Status code indicating that a bundle in the current target platform
state is not contained in a target definition (a bundle has been
deleted from the file system that the target platform does not
know about).
|
static int |
STATUS_MISSING_FROM_TARGET_PLATFORM
Status code indicating that a bundle in a target definition is not
contained in the current target platform state (a bundle has been
added to the file system that the target platform does not know
about).
|
Modifier and Type | Method and Description |
---|---|
IStatus |
compareWithTargetPlatform(ITargetDefinition target)
Returns a status describing whether the given target definition is synchronized with
workspace's target platform state.
|
void |
copyTargetDefinition(ITargetDefinition from,
ITargetDefinition to)
Copies all attributes from one target definition to another.
|
void |
deleteTarget(ITargetHandle handle)
Deletes the target definition associated with the given handle.
|
ITargetHandle |
getTarget(IFile file)
Returns a handle to a target definition backed by the underlying file.
|
ITargetHandle |
getTarget(String memento)
Creates and returns a target handle from the given memento.
|
ITargetHandle |
getTarget(URI uri)
Returns a handle to a target definition backed by the underlying
URI . |
ITargetHandle[] |
getTargets(IProgressMonitor monitor)
Returns handles to all target definitions known in the workspace.
|
ITargetDefinition |
getWorkspaceTargetDefinition()
Returns a
ITargetDefinition that corresponds to the active target platform. |
ITargetHandle |
getWorkspaceTargetHandle()
Returns a handle to the target definition that corresponds to the active target platform
or
null if none. |
void |
loadTargetDefinition(ITargetDefinition definition,
String targetExtensionId)
Sets the content of the given target definition based on the target file supplied
by an
org.eclipse.pde.core.targets extension with the specified identifier. |
ITargetDefinition |
newDefaultTarget()
Returns a new target definition with default settings.
|
ITargetLocation |
newDirectoryLocation(String path)
Creates and returns a target location that contains all bundles in the
specified directory which may contain string substitution variables.
|
ITargetLocation |
newFeatureLocation(String home,
String featureId,
String version)
Creates and returns a target location that contains all bundles referenced by
the feature at the specified location.
|
ITargetLocation |
newIULocation(IInstallableUnit[] units,
URI[] repositories,
int resolutionFlags)
Creates and returns a target location that contains all bundles contained in
the specified installable units (IU's) in the given repositories.
|
ITargetLocation |
newIULocation(String[] unitIds,
String[] versions,
URI[] repositories,
int resolutionFlags)
Creates and returns a target location that contains all bundles contained in
the specified installable units (IU's) in the given repositories.
|
ITargetLocation |
newProfileLocation(String home,
String configurationLocation)
Creates and returns a target location that contains all bundles installed in
a profile at the specified location with the specified configuration area.
|
ITargetDefinition |
newTarget()
Returns a new target definition to be stored with local metadata.
|
void |
saveTargetDefinition(ITargetDefinition definition)
Persists the given target definition.
|
static final int STATUS_MISSING_FROM_TARGET_PLATFORM
static final int STATUS_MISSING_FROM_TARGET_DEFINITION
ITargetHandle[] getTargets(IProgressMonitor monitor)
ITargetHandle getTarget(IFile file)
file
- target definition file that may or may not existITargetHandle getTarget(URI uri)
URI
.
The target definition may or may not exist. If the URI
is valid
then this is a new target definition which becomes one of the known
external target definitions.uri
- target definition URI
that may or may not existITargetDefinition newTarget()
void saveTargetDefinition(ITargetDefinition definition) throws CoreException
The target is persisted in a location determined by its handle. A handle
may refer to an IFile
or a workspace metadata location. Any existing
target definition at the same location is overwritten.
definition
- definition to persistCoreException
- if unable to persist the definitionvoid deleteTarget(ITargetHandle handle) throws CoreException
handle
- target handleCoreException
- if the associated target does not exist or deletion failsITargetHandle getTarget(String memento) throws CoreException
ITargetHandle.getMemento()
.memento
- a target handle mementoCoreException
- if the target handle format is invalidITargetLocation newDirectoryLocation(String path)
path
- absolute path in the local file system, may contain string variablesITargetLocation newProfileLocation(String home, String configurationLocation)
home
- absolute path in the local file system to the root of an installed profile
which may contain string substitution variablesconfigurationLocation
- absolute path in the local file system to the
configuration area for the specified installation which may contain string substitution
variables or null
to use the default locationITargetLocation newIULocation(IInstallableUnit[] units, URI[] repositories, int resolutionFlags)
units
- installable unitsrepositories
- URI's describing repository locations or null
to use
default repositoriesresolutionFlags
- bitmask of flags to control IU resolution, possible flags are IUBundleContainer.INCLUDE_ALL_ENVIRONMENTS
, IUBundleContainer.INCLUDE_REQUIRED
, IUBundleContainer.INCLUDE_SOURCE
, IUBundleContainer.INCLUDE_CONFIGURE_PHASE
ITargetLocation newIULocation(String[] unitIds, String[] versions, URI[] repositories, int resolutionFlags)
unitIds
- installable unit identifiersversions
- version identifiersrepositories
- URI's describing repository locations or null
to use
default repositoriesresolutionFlags
- bitmask of flags to control IU resolution, possible flags are IUBundleContainer.INCLUDE_ALL_ENVIRONMENTS
, IUBundleContainer.INCLUDE_REQUIRED
, IUBundleContainer.INCLUDE_SOURCE
, IUBundleContainer.INCLUDE_CONFIGURE_PHASE
ITargetLocation newFeatureLocation(String home, String featureId, String version)
home
- installation location containing a features directory which may contain
string substitution variablesfeatureId
- feature symbolic nameversion
- feature version identifier or null
to use most recent availableITargetHandle getWorkspaceTargetHandle() throws CoreException
null
if none.null
if noneCoreException
- if an error occurs generating the handleITargetDefinition getWorkspaceTargetDefinition() throws CoreException
ITargetDefinition
that corresponds to the active target platform. Will
return an empty target definition if no target platform has been specified. Will return
a target definition based on deprecated preference settings if no target definition has
been created before. Will throw a CoreException
if the backing target file
does not exist or if there is a problem reading it.
The returned target definition may have been resolved previously, but this is not
guaranteed. It is recommended clients use this method over getWorkspaceTargetHandle()
.
CoreException
- if an error occurs loading the workspace target definitionIStatus compareWithTargetPlatform(ITargetDefinition target) throws CoreException
null
.
An OK
status is returned when in synch. A multi-status is returned
when there are synchronization issues. Null
is returned if the target
has not been resolved. Each status contains one of the following codes
and the name of the associated bundle as a message:
target
- resolved target definition to compare with target platform stateCoreException
- if comparison failsvoid copyTargetDefinition(ITargetDefinition from, ITargetDefinition to) throws CoreException
from
- attributes are copied from this definitionto
- attributes are copied to this definitionCoreException
- in copy failsvoid loadTargetDefinition(ITargetDefinition definition, String targetExtensionId) throws CoreException
org.eclipse.pde.core.targets
extension with the specified identifier.definition
- target definition to loadtargetExtensionId
- identifier of a targets extensionCoreException
- if the extension is not found or an error occurs reading the target
file or loading the target definitionITargetDefinition newDefaultTarget()
Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.