public class PluginRegistry extends Object
This class provides static methods only; it is not intended to be instantiated or subclassed by clients.
Modifier and Type | Class and Description |
---|---|
static class |
PluginRegistry.PluginFilter
Filter used when searching for plug-in models.
|
Constructor and Description |
---|
PluginRegistry() |
Modifier and Type | Method and Description |
---|---|
static IBuildModel |
createBuildModel(IPluginModelBase model)
Creates and returns a model associated with the
build.properties of a bundle
in the workspace or null if none. |
static ModelEntry |
findEntry(String id)
Returns a model entry containing all workspace and target plug-ins by the given ID
|
static IPluginModelBase |
findModel(BundleDescription desc)
Returns a plug-in model associated with the given bundle description
|
static IPluginModelBase |
findModel(IProject project)
Returns the plug-in model corresponding to the given project, or
null
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(String id)
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)
Returns a model matching the given id, version, match rule, and optional filter,
or
null if none. |
static IPluginModelBase |
findModel(String id,
VersionRange range,
PluginRegistry.PluginFilter filter)
Returns a model matching the given id, version range, and optional filter,
or
null if none. |
static IPluginModelBase[] |
findModels(String id,
String version,
int match,
PluginRegistry.PluginFilter filter)
Returns all models matching the given id, version, match rule, and optional filter.
|
static IPluginModelBase[] |
findModels(String id,
VersionRange range,
PluginRegistry.PluginFilter filter)
Returns all models matching the given id, version range, and optional filter.
|
static IPluginModelBase[] |
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.
|
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[] |
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.
|
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[] |
getExternalModels()
Return the model manager that keeps track of plug-ins in the target platform
|
static IPluginModelBase[] |
getWorkspaceModels()
Returns all plug-in models in the workspace
|
public static ModelEntry findEntry(String id)
id
- the plug-in IDpublic static IPluginModelBase findModel(String id)
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.
id
- the plug-in IDpublic static IPluginModelBase findModel(IProject project)
null
if the project does not represent a plug-in project or if it contains a manifest file
that is malformed or missing vital information.project
- the projectnull
if the project
is not a plug-in projectpublic static IPluginModelBase findModel(BundleDescription desc)
desc
- the bundle descriptionnull
if none existspublic static IPluginModelBase[] getActiveModels()
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)
public static IPluginModelBase[] getActiveModels(boolean includeFragments)
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
includeFragments
- a boolean indicating if fragments are desired in the returned
resultpublic static IPluginModelBase[] getAllModels()
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)
public static IPluginModelBase[] getAllModels(boolean includeFragments)
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
includeFragments
- a boolean indicating if fragments are desired in the returned
resultpublic static IPluginModelBase[] getWorkspaceModels()
public static IPluginModelBase[] getExternalModels()
public static IPluginModelBase findModel(String id, String version, int match, PluginRegistry.PluginFilter filter)
null
if none.
p>
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.
id
- symbolic name of a plug-in to findversion
- minimum version, or null
to only match on symbolic namematch
- one of IMatchRules.COMPATIBLE
, IMatchRules.EQUIVALENT
,
IMatchRules.GREATER_OR_EQUAL
, IMatchRules.PERFECT
, or IMatchRules.NONE
when a version is unspecifiedfilter
- a plug-in filter or null
null
public static IPluginModelBase[] findModels(String id, String version, int match, PluginRegistry.PluginFilter filter)
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.
id
- symbolic name of a plug-ins to findversion
- minimum version, or null
to only match on symbolic namematch
- one of IMatchRules.COMPATIBLE
, IMatchRules.EQUIVALENT
,
IMatchRules.GREATER_OR_EQUAL
, IMatchRules.PERFECT
, or IMatchRules.NONE
when a version is unspecifiedfilter
- a plug-in filter or null
public static IPluginModelBase findModel(String id, VersionRange range, PluginRegistry.PluginFilter filter)
null
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.
id
- symbolic name of plug-in to findrange
- acceptable version range to match, or null
for any rangefilter
- a plug-in filter or null
null
public static IPluginModelBase[] findModels(String id, VersionRange range, PluginRegistry.PluginFilter filter)
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.
id
- symbolic name of plug-ins to findrange
- acceptable version range to match, or null
for any rangefilter
- a plug-in filter or null
public static IBuildModel createBuildModel(IPluginModelBase model) throws CoreException
build.properties
of a bundle
in the workspace or null
if none.model
- plug-in model basebuild.properties
or
null
if none. Returns null
for external plug-in models (i.e.
models that are not based on workspace projects).CoreException
- if unable to create a build model
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.