Eclipse PDE
Release 3.4

org.eclipse.pde.core.plugin
Class PluginRegistry

java.lang.Object
  extended byorg.eclipse.pde.core.plugin.PluginRegistry

public class PluginRegistry
extends Object

The central access point for models representing plug-ins found in the workspace and in the targret platform.

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.

Constructor Summary
PluginRegistry()
           
 
Method Summary
static ModelEntry findEntry(String id)
          Returns a model entry containing all workspace and target plug-ins by the given ID
static IPluginModelBase findModel(org.eclipse.osgi.service.resolver.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[] 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginRegistry

public PluginRegistry()
Method Detail

findEntry

public static ModelEntry findEntry(String id)
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

public static IPluginModelBase findModel(String id)
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

public 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.

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

public static IPluginModelBase findModel(org.eclipse.osgi.service.resolver.BundleDescription desc)
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

getActiveModels

public 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.

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

public 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.

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

public 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.

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

public 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.

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

public static IPluginModelBase[] getWorkspaceModels()
Returns all plug-in models in the workspace

Returns:
all plug-in models in the workspace

getExternalModels

public static IPluginModelBase[] 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

Eclipse PDE
Release 3.4

Copyright (c) IBM Corp. and others 2000, 2008. All Rights Reserved.