public interface ITargetLocation extends 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.
Modifier and Type | Method and Description |
---|---|
TargetBundle[] |
getBundles()
Returns the bundles in this location or
null if this location is not resolved
Some of the returned bundles may have non-OK statuses. |
TargetFeature[] |
getFeatures()
Returns all features available in this location or
null if this location is
not resolved. |
String |
getLocation(boolean resolve)
Returns a path in the local file system to the root of the target location.
|
IStatus |
getStatus()
Returns the status of the last bundle resolution or
null if
this location has not been resolved. |
String |
getType()
Returns a string that identifies the implementation of this target location.
|
String[] |
getVMArguments()
Returns VM Arguments that are specified in the bundle location or
null if none. |
boolean |
isResolved()
Returns whether this location has resolved all of its contents.
|
IStatus |
resolve(ITargetDefinition definition,
IProgressMonitor monitor)
Resolves all contents of this location in the context of the specified
target.
|
String |
serialize()
Returns a serialized XML string that stores information about this location so it can
be restored later using a
ITargetLocationFactory . |
getAdapter
IStatus resolve(ITargetDefinition definition, IProgressMonitor monitor)
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()
definition
- target being resolved formonitor
- progress monitor or null
boolean isResolved()
getStatus()
.resolve(ITargetDefinition, IProgressMonitor)
IStatus getStatus()
null
if
this location has not been resolved. If there was a problem during the
resolution, the status returned by resolve(ITargetDefinition, IProgressMonitor)
will be returned.null
String getType()
org.eclipse.pde.core.targetLocations
extension.String getLocation(boolean resolve) throws CoreException
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.
resolve
- whether to resolve variables in the pathCoreException
- if unable to resolve the locationTargetBundle[] getBundles()
null
if this location is not resolved
Some 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 use getStatus()
to
get the complete set of problems.
null
TargetFeature[] getFeatures()
null
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()
null
String[] getVMArguments()
null
if none.null
if none availableString serialize()
ITargetLocationFactory
. May return null
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"?>
.
null
Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.