Interface ITargetDefinition
-
public interface ITargetDefinitionDefines a target platform. A target platform is a collection of bundles and features configured for a specific environment.- Since:
- 3.8
- See Also:
Use the target platform service to work with target definitions- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TargetBundle[]getAllBundles()Returns a list of all resolved bundles in this target definition ornull.TargetFeature[]getAllFeatures()Returns the list of feature models available in this target ornullif this target has not been resolved.StringgetArch()Returns the identifier of the architecture this target is configured for, ornullto default to the running architecture.TargetBundle[]getBundles()Returns all bundles included in this target definition ornullif this container is not resolved.DocumentgetDocument()Returns the Document that represents this target, ornullif noneITargetHandlegetHandle()Returns a handle to this target definition.NameVersionDescriptor[]getImplicitDependencies()Returns the implicit dependencies set on this target ornullif none.NameVersionDescriptor[]getIncluded()Returns a list of descriptors that filter the resolved plug-ins in this target.IPathgetJREContainer()Returns JRE container path that this target definition should be built against, ornullif the workspace default JRE should be used.StringgetName()Returns the name of this target, ornullif noneStringgetNL()Returns the identifier of the locale this target is configured for, ornullfor default.StringgetOS()Returns the identifier of the operating system this target is configured for, possiblynull.StringgetProgramArguments()Returns any program arguments that should be used when launching this target ornullif none.IStatusgetStatus()Returns aMultiStatuscontaining all problems with this target.ITargetLocation[]getTargetLocations()Returns the locations defined by this target, possiblenull.StringgetVMArguments()Returns any VM arguments that should be used when launching this target ornullif none.StringgetWS()Returns the identifier of the window system this target is configured for, possiblynull.booleanisResolved()Returns whether allITargetLocations in this target currently in a resolved state.IStatusresolve(IProgressMonitor monitor)Resolves all contents of this target definition by resolving eachITargetLocationin this target definition.voidsetArch(String arch)Sets the architecture this target is configured for, ornullto default to the running architecture.voidsetDocument(Document document)Sets the XML document that stores the state of this target.voidsetImplicitDependencies(NameVersionDescriptor[] bundles)Sets implicit dependencies for this target.voidsetIncluded(NameVersionDescriptor[] included)Sets a list of descriptors to filter the resolved plug-ins in this target.voidsetJREContainer(IPath containerPath)Sets the JRE that this target definition should be built against, ornullto use the workspace default JRE.voidsetName(String name)Sets the name of this target.voidsetNL(String nl)Sets the locale this target is configured for ornullfor default.voidsetOS(String os)Sets the operating system this target is configured for ornullto default to the running operating system.voidsetProgramArguments(String args)Sets any program arguments that should be used when launching this target ornullif none.voidsetTargetLocations(ITargetLocation[] containers)Sets the locations in this target definition ornullif none.voidsetVMArguments(String args)Sets any VM arguments that should be used when launching this target ornullif none.voidsetWS(String ws)Sets the window system this target is configured for ornullto default to the running window system.
-
-
-
Method Detail
-
resolve
IStatus resolve(IProgressMonitor monitor)
Resolves all contents of this target definition by resolving eachITargetLocationin this target definition.Returns a
MultiStatuscontaining any non-OK statuses produced when resolving eachITargetLocation. An OK status will be returned if no non-OK statuses are returned from the locations. A CANCEL status will be returned if the monitor is cancelled.For more information on how a target resolves, see
ITargetLocation.resolve(ITargetDefinition, IProgressMonitor)- Parameters:
monitor- progress monitor ornull- Returns:
- resolution multi-status
-
isResolved
boolean isResolved()
Returns whether allITargetLocations in this target currently in a resolved state.- Returns:
trueif all locations are currently resolved
-
setDocument
void setDocument(Document document)
Sets the XML document that stores the state of this target. The document is updated with each setter that has an affect on the target file source.- Parameters:
document- xml document ornull- Since:
- 3.12
-
getDocument
Document getDocument()
Returns the Document that represents this target, ornullif none- Returns:
- document or
null - Since:
- 3.12
-
getBundles
TargetBundle[] getBundles()
Returns all bundles included in this target definition ornullif this container is not resolved. Takes all the bundles available from the set target locations (returned bygetAllBundles()and applies the filters (returned bygetIncluded()) to determine the final list of bundles in this target.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(). CallinggetStatus()will return all problems in this target definition.- Returns:
- resolved bundles or
null
-
getAllBundles
TargetBundle[] getAllBundles()
Returns a list of all resolved bundles in this target definition ornull. Does not filter based on any filters (getIncluded(). Returnsnullif this target has not been resolved. UsegetBundles()to get the filtered list of bundles.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(). CallinggetStatus()will return all problems in this target definition.- Returns:
- collection of resolved bundles or
null
-
getAllFeatures
TargetFeature[] getAllFeatures()
Returns the list of feature models available in this target ornullif this target has not been resolved.- Returns:
- collection of feature models or
null
-
getStatus
IStatus getStatus()
Returns aMultiStatuscontaining all problems with this target. Returns an OK status if there are no problems. Returnsnullif this target has not been resolved.The returned status will include all non-OK statuses returned by
resolve(IProgressMonitor)as well as any non-OK statuses found inTargetBundles returned bygetBundles(). For more information on the statuses that can be returned seeITargetLocation.getStatus()andTargetBundle.getStatus().- Returns:
MultiStatuscontaining all problems with this target ornull
-
getHandle
ITargetHandle getHandle()
Returns a handle to this target definition.- Returns:
- target handle
-
getName
String getName()
Returns the name of this target, ornullif none- Returns:
- name or
null
-
setName
void setName(String name)
Sets the name of this target.- Parameters:
name- target name ornull
-
getTargetLocations
ITargetLocation[] getTargetLocations()
Returns the locations defined by this target, possiblenull.- Returns:
- target locations or
null
-
setTargetLocations
void setTargetLocations(ITargetLocation[] containers)
Sets the locations in this target definition ornullif none.- Parameters:
containers- target locations ornull
-
getIncluded
NameVersionDescriptor[] getIncluded()
Returns a list of descriptors that filter the resolved plug-ins in this target. The list may include both plug-ins and features. The returned descriptors will have an id, may have a version and will have eitherNameVersionDescriptor.TYPE_FEATUREorNameVersionDescriptor.TYPE_PLUGINas their type. If the target is set to include all units (no filtering is being done), this method will returnnull.- Returns:
- list of name version descriptors or
null - See Also:
getBundles(),setIncluded(NameVersionDescriptor[])
-
setIncluded
void setIncluded(NameVersionDescriptor[] included)
Sets a list of descriptors to filter the resolved plug-ins in this target. The list may include both plug-ins and features. To include all plug-ins in the target, passnullas the argument.The descriptions passed to this method must have an ID set. The version may be
nullto include any version of the matches the ID. Only descriptors with a type ofNameVersionDescriptor.TYPE_FEATUREorNameVersionDescriptor.TYPE_PLUGINwill be considered.- Parameters:
included- list of descriptors to include in the target ornullto include all plug-ins- See Also:
getBundles(),getIncluded()
-
getJREContainer
IPath getJREContainer()
Returns JRE container path that this target definition should be built against, ornullif the workspace default JRE should be used. JavaRuntime can be used to resolve JRE's and execution environments from a container path.- Returns:
- JRE container path or
null - See Also:
JavaRuntime
-
setJREContainer
void setJREContainer(IPath containerPath)
Sets the JRE that this target definition should be built against, ornullto use the workspace default JRE. JavaRuntime should be used to generate and parse JRE container paths.- Parameters:
containerPath- JRE container path- See Also:
JavaRuntime
-
getOS
String getOS()
Returns the identifier of the operating system this target is configured for, possiblynull.- Returns:
- operating system identifier or
nullto default to the running operating system
-
setOS
void setOS(String os)
Sets the operating system this target is configured for ornullto default to the running operating system.- Parameters:
os- operating system identifier - one of the operating system constants defined byConstantsornullto default to the running operating system
-
getWS
String getWS()
Returns the identifier of the window system this target is configured for, possiblynull.- Returns:
- window system identifier - one of the window system constants
defined by
Constants, ornullto default to the running window system
-
setWS
void setWS(String ws)
Sets the window system this target is configured for ornullto default to the running window system.- Parameters:
ws- window system identifier ornullto default to the running window system
-
getArch
String getArch()
Returns the identifier of the architecture this target is configured for, ornullto default to the running architecture.- Returns:
- architecture identifier - one of the architecture constants
defined by
Constantsornullto default to the running architecture
-
setArch
void setArch(String arch)
Sets the architecture this target is configured for, ornullto default to the running architecture.- Parameters:
arch- architecture identifier ornullto default to the running architecture.
-
getNL
String getNL()
Returns the identifier of the locale this target is configured for, ornullfor default.- Returns:
- locale identifier or
nullfor default
-
setNL
void setNL(String nl)
Sets the locale this target is configured for ornullfor default.- Parameters:
nl- locale identifier ornullfor default
-
getProgramArguments
String getProgramArguments()
Returns any program arguments that should be used when launching this target ornullif none.- Returns:
- program arguments or
nullif none
-
setProgramArguments
void setProgramArguments(String args)
Sets any program arguments that should be used when launching this target ornullif none.- Parameters:
args- program arguments ornull
-
getVMArguments
String getVMArguments()
Returns any VM arguments that should be used when launching this target ornullif none.- Returns:
- VM arguments or
nullif none
-
setVMArguments
void setVMArguments(String args)
Sets any VM arguments that should be used when launching this target ornullif none.- Parameters:
args- VM arguments ornull
-
setImplicitDependencies
void setImplicitDependencies(NameVersionDescriptor[] bundles)
Sets implicit dependencies for this target. Bundles in this collection are always considered by PDE when computing plug-in dependencies. Only symbolic names need to be specified in the given descriptors.- Parameters:
bundles- implicit dependencies ornullif none
-
getImplicitDependencies
NameVersionDescriptor[] getImplicitDependencies()
Returns the implicit dependencies set on this target ornullif none.- Returns:
- implicit dependencies or
null
-
-