Interface ITargetLocation
- All Superinterfaces:
IAdaptable
Clients are allowed to provide their own implementations. For the target definition
to be persisted correctly, clients must provide a factory through the
org.eclipse.pde.core.targetLocations
extension point.
It is recommended that implementors override Object.equals(Object)
to return
true
if the content of two containers are equal. This allows PDE
to determine if two different target definitions have equivalent content.
To display an implementation in the PDE UI, clients may do the following:
- Implement ITargetLocationWizard
and contribute to the org.eclipse.pde.ui.targetLocationProvisioners
extension point.
- Have their target location adapt to org.eclipse.jface.viewers.ILabelProvider
to provide text and icon labels in the target definition wizard and editor.
- Have their target location adapt to org.eclipse.jface.viewers.ITreeContentProvider
to provide children items in the target definition wizard and editor. The children must adapt to
ILabelProvider
to get text and icon labels in the tree.
- Have their target location adapt to org.eclipse.pde.ui.target.ITargetLocationEditor
to open an edit wizard when the edit button is pressed on the target definition wizard and editor.
- Have their target location adapt to org.eclipse.pde.ui.target.ITargetLocationUpdater
to run an update job on the location when the update button is pressed on the target definition
wizard and editor.
- Since:
- 3.8
-
Method Summary
Modifier and TypeMethodDescriptionReturns the bundles in this location ornull
if this location is not resolvedReturns all features available in this location ornull
if this location is not resolved.getLocation
(boolean resolve) Returns a path in the local file system to the root of the target location.Returns the status of the last bundle resolution ornull
if this location has not been resolved.getType()
Returns a string that identifies the implementation of this target location.String[]
Returns VM Arguments that are specified in the bundle location ornull
if none.boolean
Returns whether this location has resolved all of its contents.resolve
(ITargetDefinition definition, IProgressMonitor monitor) Resolves all contents of this location in the context of the specified target.Returns a serialized XML string that stores information about this location so it can be restored later using aITargetLocationFactory
.Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
Method Details
-
resolve
Resolves all contents of this location in the context of the specified target. Returns a status describing the resolution.If resolution is successful an OK status is returned. If a problem occurs while resolving a non-OK status will be returned. If the progress monitor is cancelled a CANCEL status will be returned. The returned status can be accessed later using
getStatus()
.This location will be considered resolved even if a problem occurs while resolving. See
isResolved()
- Parameters:
definition
- target being resolved formonitor
- progress monitor ornull
- Returns:
- resolution status
-
isResolved
boolean isResolved()Returns whether this location has resolved all of its contents. If there was a problem during the resolution the location will still be considered resolved, seegetStatus()
.- Returns:
- whether this location has resolved all of its contents
- See Also:
-
getStatus
IStatus getStatus()Returns the status of the last bundle resolution ornull
if this location has not been resolved. If there was a problem during the resolution, the status returned byresolve(ITargetDefinition, IProgressMonitor)
will be returned.- Returns:
- resolution status or
null
-
getType
String getType()Returns a string that identifies the implementation of this target location. For target definitions to be persisted correctly, this must match the type in a contributedorg.eclipse.pde.core.targetLocations
extension.- Returns:
- string identifier for the type of target location.
-
getLocation
Returns a path in the local file system to the root of the target location.The current target platform framework requires a local file location but this requirement may be removed in the future. This method should not be referenced.
- Parameters:
resolve
- whether to resolve variables in the path- Returns:
- home location
- Throws:
CoreException
- if unable to resolve the location- Restriction:
- This method is not intended to be referenced by clients.
-
getBundles
TargetBundle[] getBundles()Returns the bundles in this location ornull
if this location is not resolvedSome of the returned bundles may have non-OK statuses. These bundles may be missing some information (location, version, source target). To get a bundle's status call
TargetBundle.getStatus()
. You can also usegetStatus()
to get the complete set of problems.- Returns:
- resolved bundles or
null
-
getFeatures
TargetFeature[] getFeatures()Returns all features available in this location ornull
if this location is not resolved.This method may return no features, even if the location has multiple bundles. For all returned features, the bundles that the features reference should be returned in the list returned by
getBundles()
- Returns:
- features or
null
-
getVMArguments
String[] getVMArguments()Returns VM Arguments that are specified in the bundle location ornull
if none.- Returns:
- list of VM Arguments or
null
if none available
-
serialize
String serialize()Returns a serialized XML string that stores information about this location so it can be restored later using aITargetLocationFactory
. May returnnull
to have this location ignored when saving a target definition.The returned xml must contain a single root element named
location
. The root element may have attributes set and children. The xml should not be prefixed by a XML declaration such as<?xml version="1.0" encoding="UTF-8"?>
.- Returns:
- an XML string storing all location information or
null
-