Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
berry::IExtensionRegistry Struct Referenceabstract

#include <berryIExtensionRegistry.h>

Public Member Functions

virtual ~IExtensionRegistry ()
 
virtual QList< SmartPointer< IConfigurationElement > > GetConfigurationElementsFor (const QString &extensionPointId) const =0
 
virtual QList< SmartPointer< IConfigurationElement > > GetConfigurationElementsFor (const QString &namespaze, const QString &extensionPointName) const =0
 
virtual QList< SmartPointer< IConfigurationElement > > GetConfigurationElementsFor (const QString &namespaze, const QString &extensionPointName, const QString &extensionId) const =0
 
virtual SmartPointer< IExtensionGetExtension (const QString &extensionId) const =0
 
virtual SmartPointer< IExtensionGetExtension (const QString &extensionPointId, const QString &extensionId) const =0
 
virtual SmartPointer< IExtensionGetExtension (const QString &namespaze, const QString &extensionPointName, const QString &extensionId) const =0
 
virtual SmartPointer< IExtensionPointGetExtensionPoint (const QString &extensionPointId) const =0
 
virtual SmartPointer< IExtensionPointGetExtensionPoint (const QString &namespaze, const QString &extensionPointName) const =0
 
virtual QList< SmartPointer< IExtensionPoint > > GetExtensionPoints () const =0
 
virtual QList< SmartPointer< IExtensionPoint > > GetExtensionPoints (const QString &namespaze) const =0
 
virtual QList< SmartPointer< IExtensionPoint > > GetExtensionPoints (const SmartPointer< IContributor > &contributor) const =0
 
virtual QList< SmartPointer< IExtension > > GetExtensions (const QString &namespaze) const =0
 
virtual QList< SmartPointer< IExtension > > GetExtensions (const SmartPointer< IContributor > &contributor) const =0
 
virtual QList< QString > GetNamespaces () const =0
 
virtual bool AddContribution (QIODevice *is, const SmartPointer< IContributor > &contributor, bool persist, const QString &name, QTranslator *translationBundle, QObject *token)=0
 
virtual bool RemoveExtension (const SmartPointer< IExtension > &extension, QObject *token)=0
 
virtual bool RemoveExtensionPoint (const SmartPointer< IExtensionPoint > &extensionPoint, QObject *token)=0
 
virtual void Stop (QObject *token)=0
 
virtual void AddListener (IRegistryEventListener *listener, const QString &extensionPointId=QString())=0
 
virtual void AddListener (IRegistryEventListener *listener, const IExtensionPointFilter &filter)=0
 
virtual void RemoveListener (IRegistryEventListener *listener)=0
 
virtual bool IsMultiLanguage () const =0
 

Detailed Description

The extension registry holds the master list of all discovered namespaces, extension points and extensions.

The extension registry can be queried, by name, for extension points and extensions.

The various objects that describe the contents of the extension registry (IExtensionPoint, IExtension, and IConfigurationElement) are intended for relatively short-term use. Clients that deal with these objects must be aware that they may become invalid if the declaring plug-in is updated or uninstalled. If this happens, all methods on these object except isValid() will throw InvalidRegistryObjectException. Code in a plug-in that has declared that it is not dynamic aware (or not declared anything) can safely ignore this issue, since the registry would not be modified while it is active. However, code in a plug-in that declares that it is dynamic aware must be careful if it accesses extension registry objects, because it's at risk if plug-in are removed. Similarly, tools that analyze or display the extension registry are vulnerable. Client code can pre-test for invalid objects by calling isValid(), which never throws this exception. However, pre-tests are usually not sufficient because of the possibility of the extension registry object becoming invalid as a result of a concurrent activity. At-risk clients must treat InvalidRegistryObjectException as if it were a checked exception. Also, such clients should probably register a listener with the extension registry so that they receive notification of any changes to the registry.

Extensions and extension points are declared by generic entities called namespaces . The only fact known about namespaces is that they have unique string-based identifiers. One example of a namespace is a plug-in, for which the namespace id is the plug-in id.

This interface is not intended to be implemented by clients.

Definition at line 71 of file berryIExtensionRegistry.h.

Constructor & Destructor Documentation

◆ ~IExtensionRegistry()

virtual berry::IExtensionRegistry::~IExtensionRegistry ( )
virtual

Member Function Documentation

◆ AddContribution()

virtual bool berry::IExtensionRegistry::AddContribution ( QIODevice *  is,
const SmartPointer< IContributor > &  contributor,
bool  persist,
const QString &  name,
QTranslator *  translationBundle,
QObject *  token 
)
pure virtual

Adds to this extension registry an extension point(s), extension(s), or a combination of those described by the XML file. The information in the XML file should be supplied in the same format as the plugin.xml; in fact, Plug-in Manifest editor can be used to prepare the XML file. The top token of the contribution (normally, "plugin" or "fragment" in the Plug-in Manifest editor) is ignored by this method.

This method is an access controlled method. Proper token (master token or user token) should be passed as an argument. Two registry keys are set in the registry constructor: master token and a user token. Master token allows all operations; user token allows non-persisted registry elements to be modified.

Parameters
isstream open on the XML file. The XML file can contain an extension point(s) or/and extension(s) described in the format similar to plugin.xml. The method closes the device before returning.
contributorthe contributor making this contribution.
persistindicates if the contribution(s) should be stored in the registry cache. If false, contribution is not persisted in the registry cache and is lost on BlueBerry restart
nameoptional name of the contribution. Used for error reporting; might be QString()
translationBundleoptional translator used for translations; might be nullptr
tokenthe key used to check permissions
Returns
true if the contribution was successfully processed and false otherwise
Exceptions
ctkInvalidArgumentExceptionif an incorrect token is passed
See also
IContributor

◆ AddListener() [1/2]

virtual void berry::IExtensionRegistry::AddListener ( IRegistryEventListener listener,
const IExtensionPointFilter filter 
)
pure virtual

Adds the given listener for registry change events for extension points matching the provided filter.

Depending on activity, listeners of this type might receive a large number of modifications and negatively impact overall system performance. Whenever possible, consider registering listener specific to an extension point rather than a "global" listener.

Once registered, a listener starts receiving notification of changes to the registry. Registry change notifications are sent asynchronously. The listener continues to receive notifications until it is removed.

This method has no effect if the listener is already registered.

Parameters
listenerthe listener
filterAn extension point filter
See also
ExtensionTracker

◆ AddListener() [2/2]

virtual void berry::IExtensionRegistry::AddListener ( IRegistryEventListener listener,
const QString &  extensionPointId = QString() 
)
pure virtual

Adds the given listener for registry change events related to the specified extension point or for changes to all extension points and underlying extensions if the extensionPointId argument is empty.

Depending on activity, listeners of this type might receive a large number of modifications and negatively impact overall system performance. Whenever possible, consider registering listener specific to an extension point rather than a "global" listener.

Once registered, a listener starts receiving notification of changes to the registry. Registry change notifications are sent asynchronously. The listener continues to receive notifications until it is removed.

This method has no effect if the listener is already registered.

Parameters
listenerthe listener
extensionPointIdthe unique identifier of extension point
See also
IExtensionPoint::GetUniqueIdentifier()

◆ GetConfigurationElementsFor() [1/3]

virtual QList<SmartPointer<IConfigurationElement> > berry::IExtensionRegistry::GetConfigurationElementsFor ( const QString &  extensionPointId) const
pure virtual

Returns all configuration elements from all extensions configured into the identified extension point. Returns an empty list if the extension point does not exist, has no extensions configured, or none of the extensions contain configuration elements.

Parameters
extensionPointIdthe unique identifier of the extension point (e.g. "org.blueberry.core.applications")
Returns
the configuration elements

◆ GetConfigurationElementsFor() [2/3]

virtual QList<SmartPointer<IConfigurationElement> > berry::IExtensionRegistry::GetConfigurationElementsFor ( const QString &  namespaze,
const QString &  extensionPointName 
) const
pure virtual

Returns all configuration elements from all extensions configured into the identified extension point. Returns an empty list if the extension point does not exist, has no extensions configured, or none of the extensions contain configuration elements.

Parameters
namespazethe namespace for the extension point (e.g. "org.eclipse.core.resources")
extensionPointNamethe simple identifier of the extension point (e.g. "builders")
Returns
the configuration elements

◆ GetConfigurationElementsFor() [3/3]

virtual QList<SmartPointer<IConfigurationElement> > berry::IExtensionRegistry::GetConfigurationElementsFor ( const QString &  namespaze,
const QString &  extensionPointName,
const QString &  extensionId 
) const
pure virtual

Returns all configuration elements from the identified extension. Returns an empty array if the extension does not exist or contains no configuration elements.

Parameters
namespazethe namespace for the extension point (e.g. "org.eclipse.core.resources")
extensionPointNamethe simple identifier of the extension point (e.g. "builders")
extensionIdthe unique identifier of the extension (e.g. "com.example.acme.coolbuilder")
Returns
the configuration elements

◆ GetExtension() [1/3]

virtual SmartPointer<IExtension> berry::IExtensionRegistry::GetExtension ( const QString &  extensionId) const
pure virtual

Returns the specified extension in this extension registry, or null if there is no such extension.

Parameters
extensionIdthe unique identifier of the extension (e.g. "com.example.acme.coolbuilder")
Returns
the extension, or null

◆ GetExtension() [2/3]

virtual SmartPointer<IExtension> berry::IExtensionRegistry::GetExtension ( const QString &  extensionPointId,
const QString &  extensionId 
) const
pure virtual

Returns the specified extension in this extension registry, or null if there is no such extension. The first parameter identifies the extension point, and the second parameter identifies an extension plugged in to that extension point.

Parameters
extensionPointIdthe unique identifier of the extension point (e.g. "org.eclipse.core.resources.builders")
extensionIdthe unique identifier of the extension (e.g. "com.example.acme.coolbuilder")
Returns
the extension, or null

◆ GetExtension() [3/3]

virtual SmartPointer<IExtension> berry::IExtensionRegistry::GetExtension ( const QString &  namespaze,
const QString &  extensionPointName,
const QString &  extensionId 
) const
pure virtual

Returns the specified extension in this extension registry, or null if there is no such extension. The first two parameters identify the extension point, and the third parameter identifies an extension plugged in to that extension point.

Parameters
namespazethe namespace for the extension point (e.g. "org.eclipse.core.resources")
extensionPointNamethe simple identifier of the extension point (e.g. "builders")
extensionIdthe unique identifier of the extension (e.g. "com.example.acme.coolbuilder")
Returns
the extension, or null

◆ GetExtensionPoint() [1/2]

virtual SmartPointer<IExtensionPoint> berry::IExtensionRegistry::GetExtensionPoint ( const QString &  extensionPointId) const
pure virtual

Returns the extension point with the given extension point identifier in this extension registry, or null if there is no such extension point.

Parameters
extensionPointIdthe unique identifier of the extension point (e.g., "org.blueberry.core.applications")
Returns
the extension point, or null

◆ GetExtensionPoint() [2/2]

virtual SmartPointer<IExtensionPoint> berry::IExtensionRegistry::GetExtensionPoint ( const QString &  namespaze,
const QString &  extensionPointName 
) const
pure virtual

Returns the extension point in this extension registry with the given namespace and extension point simple identifier, or null if there is no such extension point.

Parameters
namespazethe namespace for the given extension point (e.g. "org.eclipse.core.resources")
extensionPointNamethe simple identifier of the extension point (e.g. "builders")
Returns
the extension point, or null

◆ GetExtensionPoints() [1/3]

virtual QList<SmartPointer<IExtensionPoint> > berry::IExtensionRegistry::GetExtensionPoints ( ) const
pure virtual

Returns all extension points known to this extension registry. Returns an empty array if there are no extension points.

Returns
the extension points known to this extension registry

◆ GetExtensionPoints() [2/3]

virtual QList<SmartPointer<IExtensionPoint> > berry::IExtensionRegistry::GetExtensionPoints ( const QString &  namespaze) const
pure virtual

Returns all extension points declared in the given namespace. Returns an empty array if there are no extension points declared in the namespace.

Parameters
namespazethe namespace for the extension points (e.g. "org.eclipse.core.resources")
Returns
the extension points in this registry declared in the given namespace

◆ GetExtensionPoints() [3/3]

virtual QList<SmartPointer<IExtensionPoint> > berry::IExtensionRegistry::GetExtensionPoints ( const SmartPointer< IContributor > &  contributor) const
pure virtual

Returns all extension points supplied by the contributor, or null if there are no such extension points.

Parameters
contributorthe contributor for the extensions (for OSGi registry, bundles and fragments are different contributors)
Returns
the extension points, or null
Since
3.4

◆ GetExtensions() [1/2]

virtual QList<SmartPointer<IExtension> > berry::IExtensionRegistry::GetExtensions ( const QString &  namespaze) const
pure virtual

Returns all extensions declared in the given namespace. Returns an empty array if no extensions are declared in the namespace.

Parameters
namespazethe namespace for the extensions (e.g. "org.eclipse.core.resources")
Returns
the extensions in this registry declared in the given namespace

◆ GetExtensions() [2/2]

virtual QList<SmartPointer<IExtension> > berry::IExtensionRegistry::GetExtensions ( const SmartPointer< IContributor > &  contributor) const
pure virtual

Returns all extensions supplied by the contributor, or null if there are no such extensions.

Parameters
contributorthe contributor for the extensions (for OSGi registry, bundles and fragments are different contributors)
Returns
the extensions, or null

◆ GetNamespaces()

virtual QList<QString> berry::IExtensionRegistry::GetNamespaces ( ) const
pure virtual

Returns all namespaces currently used by extensions and extension points in this registry. Returns an empty array if there are no known extensions/extension points in this registry.

The fully-qualified name of an extension point or an extension consist of a namespace and a simple name (much like a qualified Java class name consist of a package name and a class name). The simple names are presumed to be unique in the namespace.

Returns
all namespaces known to this registry

◆ IsMultiLanguage()

virtual bool berry::IExtensionRegistry::IsMultiLanguage ( ) const
pure virtual

Call this method to determine if this extension registry supports multiple languages.

See the runtime option "-registryMultiLanguage" for enabling multi-language support.

Returns
true if multiple languages are supported by this instance of the extension registry; false otherwise.

◆ RemoveExtension()

virtual bool berry::IExtensionRegistry::RemoveExtension ( const SmartPointer< IExtension > &  extension,
QObject *  token 
)
pure virtual

Removes the given extension from this registry.

This method is an access controlled method. Proper token (master token or user token) should be passed as an argument. Two registry keys are set in the registry constructor: master token and a user token. Master token allows all operations; user token only allows non-persisted registry elements to be modified.

Parameters
extensionextension to be removed
tokenthe key used to check permissions
Returns
true if the extension was successfully removed, and false otherwise
Exceptions
ctkInvalidArgumentExceptionif an incorrect token is passed

◆ RemoveExtensionPoint()

virtual bool berry::IExtensionRegistry::RemoveExtensionPoint ( const SmartPointer< IExtensionPoint > &  extensionPoint,
QObject *  token 
)
pure virtual

Removes the specified extension point from this registry.

This method is an access controlled method. Proper token (master token or user token) should be passed as an argument. Two registry keys are set in the registry constructor: master token and a user token. Master token allows all operations; user token only allows non-persisted registry elements to be modified.

Parameters
extensionPointextension point to be removed
tokenthe key used to check permissions
Returns
true if the extension point was successfully removed, and false otherwise
Exceptions
ctkInvalidArgumentExceptionif incorrect token is passed

◆ RemoveListener()

virtual void berry::IExtensionRegistry::RemoveListener ( IRegistryEventListener listener)
pure virtual

Removes the given registry change listener from this registry.

This method has no effect if the listener is not registered.

Parameters
listenerthe listener
See also
AddListener(IRegistryEventListener*, const QString&)

◆ Stop()

virtual void berry::IExtensionRegistry::Stop ( QObject *  token)
pure virtual

Call this method to properly stop the registry. The method stops registry event processing and writes out cache information to be used in the next run. This is an access controlled method; master token is required.

This method is an access controlled method. Master token should be passed as an argument.

Parameters
tokenmaster token for the registry
Exceptions
IllegalArgumentExceptionif incorrect token is passed

The documentation for this struct was generated from the following file: