Class PluginRegistry
This class provides static methods only; it is not intended to be instantiated or subclassed by clients.
- Since:
- 3.3
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic IBuildModel
createBuildModel
(IPluginModelBase model) Creates and returns a model associated with thebuild.properties
of a bundle in the workspace ornull
if none.static ModelEntry
Returns a model entry containing all workspace and target plug-ins by the given IDstatic IPluginModelBase
Returns the plug-in model for the best match plug-in with the given ID.static IPluginModelBase
findModel
(String id, String version, int match, PluginRegistry.PluginFilter filter) Deprecated, for removal: This API element is subject to removal in a future version.If no filter is passed usefindModel(String, String, VersionMatchRule)
, else filter theStream
returned byfindModels(String, String, VersionMatchRule)
.static IPluginModelBase
findModel
(String id, String version, VersionMatchRule matchRule) Returns a model matching the given id, version, match rule, ornull
if none.static IPluginModelBase
findModel
(String id, VersionRange range, PluginRegistry.PluginFilter filter) Deprecated, for removal: This API element is subject to removal in a future version.If no filter is passed usefindModel(String, VersionRange)
, else filter theStream
returned byfindModels(String, VersionRange)
.static IPluginModelBase
findModel
(String id, VersionRange range) Returns a model matching the given id, version range, ornull
if none.static IPluginModelBase
Returns the plug-in model corresponding to the given project, ornull
if the project does not represent a plug-in project or if it contains a manifest file that is malformed or missing vital information.static IPluginModelBase
findModel
(BundleDescription desc) Deprecated, for removal: This API element is subject to removal in a future version.Instead usefindModel(Resource)
static IPluginModelBase
Returns a plug-in model associated with the given resourcestatic IPluginModelBase[]
findModels
(String id, String version, int match, PluginRegistry.PluginFilter filter) Deprecated, for removal: This API element is subject to removal in a future version.Instead usefindModels(String, String, VersionMatchRule)
and filter the returnedStream
if a filter is passed.static Stream
<IPluginModelBase> findModels
(String id, String version, VersionMatchRule matchRule) Returns all models matching the given id, version and match rule sorted by descending version.static IPluginModelBase[]
findModels
(String id, VersionRange range, PluginRegistry.PluginFilter filter) Deprecated, for removal: This API element is subject to removal in a future version.Instead usefindModels(String, VersionRange)
and filter the returnedStream
if a filter is passed.static Stream
<IPluginModelBase> findModels
(String id, VersionRange range) Returns all models matching the given id and version range sorted by descending version.static IPluginModelBase[]
Returns all plug-ins and fragments in the workspace as well as all plug-ins and fragments that are checked on the Target Platform preference page.static IPluginModelBase[]
getActiveModels
(boolean includeFragments) Returns all plug-ins and (possibly) fragments in the workspace as well as all plug-ins and (possibly) fragments that are checked on the Target Platform preference page.static IPluginModelBase[]
Returns all plug-ins and fragments in the workspace as well as all target plug-ins and fragments, regardless whether or not they are checked or not on the Target Platform preference page.static IPluginModelBase[]
getAllModels
(boolean includeFragments) Returns all plug-ins and (possibly) fragments in the workspace as well as all plug-ins and (possibly) fragments, regardless whether or not they are checked on the Target Platform preference page.static IPluginModelBase[]
Return the model manager that keeps track of plug-ins in the target platformstatic IPluginModelBase[]
Returns all plug-in models in the workspace
-
Method Details
-
findEntry
Returns a model entry containing all workspace and target plug-ins by the given ID- Parameters:
id
- the plug-in ID- Returns:
- a model entry containing all workspace and target plug-ins by the given ID
-
findModel
Returns the plug-in model for the best match plug-in with the given ID. A null value is returned if no such bundle is found in the workspace or target platform.A workspace plug-in is always preferably returned over a target plug-in. A plug-in that is checked/enabled on the Target Platform preference page is always preferably returned over a target plug-in that is unchecked/disabled.
In the case of a tie among workspace plug-ins or among target plug-ins, the plug-in with the highest version is returned.
In the case of a tie among more than one suitable plug-in that have the same version, one of those plug-ins is randomly returned.
- Parameters:
id
- the plug-in ID- Returns:
- the plug-in model for the best match plug-in with the given ID
-
findModel
Returns the plug-in model corresponding to the given project, ornull
if the project does not represent a plug-in project or if it contains a manifest file that is malformed or missing vital information.- Parameters:
project
- the project- Returns:
- a plug-in model corresponding to the project or
null
if the project is not a plug-in project
-
findModel
@Deprecated(forRemoval=true, since="3.18 (removal in 2026-06 or later)") public static IPluginModelBase findModel(BundleDescription desc) Deprecated, for removal: This API element is subject to removal in a future version.Instead usefindModel(Resource)
Returns a plug-in model associated with the given bundle description- Parameters:
desc
- the bundle description- Returns:
- a plug-in model associated with the given bundle description or
null
if none exists
-
findModel
Returns a plug-in model associated with the given resource- Parameters:
resource
- the (OSGi) resource to find a model for- Returns:
- a plug-in model associated with the given bundle description or
null
if none exists - Since:
- 3.18
-
getActiveModels
Returns all plug-ins and fragments in the workspace as well as all plug-ins and fragments that are checked on the Target Platform preference page.If a workspace plug-in/fragment has the same ID as a target plug-in/fragment, the target counterpart is skipped and not included.
Equivalent to
getActiveModels(true)
- Returns:
- all plug-ins and fragments in the workspace as well as all plug-ins and fragments that are checked on the Target Platform preference page.
-
getActiveModels
Returns all plug-ins and (possibly) fragments in the workspace as well as all plug-ins and (possibly) fragments that are checked on the Target Platform preference page.If a workspace plug-in/fragment has the same ID as a target plug-in, the target counterpart is skipped and not included.
The returned result includes fragments only if
includeFragments
is set to true- Parameters:
includeFragments
- a boolean indicating if fragments are desired in the returned result- Returns:
- all plug-ins and (possibly) fragments in the workspace as well as all plug-ins and (possibly) fragments that are checked on the Target Platform preference page.
-
getAllModels
Returns all plug-ins and fragments in the workspace as well as all target plug-ins and fragments, regardless whether or not they are checked or not on the Target Platform preference page.If a workspace plug-in/fragment has the same ID as a target plug-in, the target counterpart is skipped and not included.
Equivalent to
getAllModels(true)
- Returns:
- all plug-ins and fragments in the workspace as well as all target plug-ins and fragments, regardless whether or not they are checked on the Target Platform preference page.
-
getAllModels
Returns all plug-ins and (possibly) fragments in the workspace as well as all plug-ins and (possibly) fragments, regardless whether or not they are checked on the Target Platform preference page.If a workspace plug-in/fragment has the same ID as a target plug-in/fragment, the target counterpart is skipped and not included.
The returned result includes fragments only if
includeFragments
is set to true- Parameters:
includeFragments
- a boolean indicating if fragments are desired in the returned result- Returns:
- ll plug-ins and (possibly) fragments in the workspace as well as all plug-ins and (possibly) fragments, regardless whether or not they are checked on the Target Platform preference page.
-
getWorkspaceModels
Returns all plug-in models in the workspace- Returns:
- all plug-in models in the workspace
-
getExternalModels
Return the model manager that keeps track of plug-ins in the target platform- Returns:
- the model manager that keeps track of plug-ins in the target platform
-
findModel
Returns a model matching the given id, version, match rule, ornull
if none.A workspace plug-in is always preferably returned over a target plug-in. A plug-in that is checked/enabled on the Target Platform preference page is always preferably returned over a target plug-in that is unchecked/disabled.
In the case of a tie among workspace plug-ins or among target plug-ins, the plug-in with the highest version is returned.
In the case of a tie among more than one suitable plug-in that have the same version, one of those plug-ins is randomly returned.
- Parameters:
id
- symbolic name of a plug-in to findversion
- minimum version, ornull
to only match on symbolic namematchRule
- therule
a plug-in's version must match with respect to the specified reference version in order to be selected.- Returns:
- a matching model or
null
- Since:
- 3.19
-
findModel
@Deprecated(forRemoval=true, since="3.19 (removal in 2026-09 or later)") public static IPluginModelBase findModel(String id, String version, int match, PluginRegistry.PluginFilter filter) Deprecated, for removal: This API element is subject to removal in a future version.If no filter is passed usefindModel(String, String, VersionMatchRule)
, else filter theStream
returned byfindModels(String, String, VersionMatchRule)
.- Since:
- 3.6
- See Also:
-
findModels
public static Stream<IPluginModelBase> findModels(String id, String version, VersionMatchRule matchRule) Returns all models matching the given id, version and match rule sorted by descending version.Target (external) plug-ins/fragments with the same ID as workspace counterparts are not considered.
Returns plug-ins regardless of whether they are checked/enabled or unchecked/disabled on the Target Platform preference page.
- Parameters:
id
- symbolic name of a plug-ins to findversion
- minimum version, ornull
to only match on symbolic namematchRule
- therule
a plug-in's version must match with respect to the specified reference version in order to be selected.- Returns:
- a stream of all matching models sorted by descending version, possibly empty.
- Since:
- 3.19
-
findModels
@Deprecated(forRemoval=true, since="3.19 (removal in 2026-09 or later)") public static IPluginModelBase[] findModels(String id, String version, int match, PluginRegistry.PluginFilter filter) Deprecated, for removal: This API element is subject to removal in a future version.Instead usefindModels(String, String, VersionMatchRule)
and filter the returnedStream
if a filter is passed.- Since:
- 3.6
- See Also:
-
findModel
Returns a model matching the given id, version range, ornull
if none.A workspace plug-in is always preferably returned over a target plug-in. A plug-in that is checked/enabled on the Target Platform preference page is always preferably returned over a target plug-in that is unchecked/disabled.
In the case of a tie among workspace plug-ins or among target plug-ins, the plug-in with the highest version is returned.
In the case of a tie among more than one suitable plug-in that have the same version, one of those plug-ins is randomly returned.
- Parameters:
id
- symbolic name of plug-in to findrange
- acceptable version range to match, ornull
for any range- Returns:
- a matching model or
null
- Since:
- 3.19
-
findModel
@Deprecated(forRemoval=true, since="3.19 (removal in 2026-09 or later)") public static IPluginModelBase findModel(String id, VersionRange range, PluginRegistry.PluginFilter filter) Deprecated, for removal: This API element is subject to removal in a future version.If no filter is passed usefindModel(String, VersionRange)
, else filter theStream
returned byfindModels(String, VersionRange)
.- Since:
- 3.6
- See Also:
-
findModels
Returns all models matching the given id and version range sorted by descending version.Target (external) plug-ins/fragments with the same ID as workspace counterparts are not considered.
Returns plug-ins regardless of whether they are checked/enabled or unchecked/disabled on the Target Platform preference page.
- Parameters:
id
- symbolic name of plug-ins to findrange
- acceptable version range to match, ornull
for any range- Returns:
- a stream of all matching models sorted by descending version, possibly empty.
- Since:
- 3.19
-
findModels
@Deprecated(forRemoval=true, since="3.19 (removal in 2026-09 or later)") public static IPluginModelBase[] findModels(String id, VersionRange range, PluginRegistry.PluginFilter filter) Deprecated, for removal: This API element is subject to removal in a future version.Instead usefindModels(String, VersionRange)
and filter the returnedStream
if a filter is passed.- Since:
- 3.6
- See Also:
-
createBuildModel
Creates and returns a model associated with thebuild.properties
of a bundle in the workspace ornull
if none.- Parameters:
model
- plug-in model base- Returns:
- a build model initialized from the plug-in's
build.properties
ornull
if none. Returnsnull
for external plug-in models (i.e. models that are not based on workspace projects). - Throws:
CoreException
- if unable to create a build model- Since:
- 3.7
-
Predicate
and filter the stream returned byfindModels(String, String, VersionMatchRule)
orfindModels(String, VersionRange)