Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
berry::IConfigurationElement Struct Referenceabstract

#include <berryIConfigurationElement.h>

Inheritance diagram for berry::IConfigurationElement:
Collaboration diagram for berry::IConfigurationElement:

Public Member Functions

 berryObjectMacro (berry::IConfigurationElement)
 
 ~IConfigurationElement () override
 
virtual QObject * CreateExecutableExtension (const QString &propertyName) const =0
 
template<class C >
C * CreateExecutableExtension (const QString &propertyName) const
 
virtual QString GetAttribute (const QString &name) const =0
 
virtual QList< QString > GetAttributeNames () const =0
 
virtual QList< IConfigurationElement::PointerGetChildren () const =0
 
virtual QList< IConfigurationElement::PointerGetChildren (const QString &name) const =0
 
virtual SmartPointer< IExtensionGetDeclaringExtension () const =0
 
virtual QString GetName () const =0
 
virtual SmartPointer< ObjectGetParent () const =0
 
virtual QString GetValue () const =0
 
virtual QString GetValue (const QLocale &locale) const =0
 
virtual QString GetNamespaceIdentifier () const =0
 
virtual SmartPointer< IContributorGetContributor () const =0
 
virtual bool IsValid () const =0
 
- Public Member Functions inherited from berry::Object
virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual QString ToString () const
 
virtual uint HashCode () const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
virtual bool operator== (const Object *) const
 

Additional Inherited Members

- Public Types inherited from berry::Object
typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 
- Protected Member Functions inherited from berry::Object
 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

A configuration element, with its attributes and children, directly reflects the content and structure of the extension section within the declaring plug-in's manifest (plugin.xml) file.

This interface also provides a way to create executable extension objects.

These registry objects 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 except IsValid() will throw InvalidRegistryObjectException. For configuration element objects, the most common case is code in a plug-in dealing with extensions contributed to one of the extension points it declares. 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 when accessing the extension and configuration element objects because they become invalid if the contributing plug-in is 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 or configuration element 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.

This interface is not intended to be implemented by clients.

Definition at line 59 of file berryIConfigurationElement.h.

Constructor & Destructor Documentation

◆ ~IConfigurationElement()

berry::IConfigurationElement::~IConfigurationElement ( )
override

Member Function Documentation

◆ berryObjectMacro()

berry::IConfigurationElement::berryObjectMacro ( berry::IConfigurationElement  )

◆ CreateExecutableExtension() [1/2]

template<class C >
C* berry::IConfigurationElement::CreateExecutableExtension ( const QString &  propertyName) const
inline

Definition at line 101 of file berryIConfigurationElement.h.

References BERRY_WARN.

◆ CreateExecutableExtension() [2/2]

virtual QObject* berry::IConfigurationElement::CreateExecutableExtension ( const QString &  propertyName) const
pure virtual

Creates and returns a new instance of the executable extension identified by the named attribute of this configuration element. The named attribute value must contain a fully qualified name of a class. The class can either refer to a class implementing the executable extension or to a factory capable of returning the executable extension.

The specified class is instantiated using its 0-argument public constructor.

Then the following checks are done:
If the specified class implements the IExecutableExtension interface, the method IExecutableExtension#SetInitializationData is called, passing to the object the configuration information that was used to create it.

If the specified class implements IExecutableExtensionFactory interface, the method IExecutableExtensionFactory#Create() is invoked.

Unlike other methods on this object, invoking this method may activate the plug-in.

Parameters
propertyNamethe name of the property
Returns
the executable instance
Exceptions
CoreExceptionif an instance of the executable extension could not be created for any reason
See also
IExecutableExtension::SetInitializationData(IConfigurationElement, QString, Object*)
IExecutableExtensionFactory
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetAttribute()

virtual QString berry::IConfigurationElement::GetAttribute ( const QString &  name) const
pure virtual

Returns the named attribute of this configuration element, or null if none.

The names of configuration element attributes are the same as the attribute names of the corresponding XML element. For example, the configuration markup

<bg pattern="stripes"/>

corresponds to a configuration element named "bg" with an attribute named "pattern" with attribute value "stripes".

Note that any translation specified in the plug-in manifest file is automatically applied.

Parameters
namethe name of the attribute
Returns
attribute value, or null if none
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetAttributeNames()

virtual QList<QString> berry::IConfigurationElement::GetAttributeNames ( ) const
pure virtual

Returns the names of the attributes of this configuration element. Returns an empty list if this configuration element has no attributes.

The names of configuration element attributes are the same as the attribute names of the corresponding XML element. For example, the configuration markup

<bg color="blue" pattern="stripes"/>

corresponds to a configuration element named "bg" with attributes named "color" and "pattern".

Returns
the names of the attributes
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetChildren() [1/2]

virtual QList<IConfigurationElement::Pointer> berry::IConfigurationElement::GetChildren ( ) const
pure virtual

Returns all configuration elements that are children of this configuration element. Returns an empty list if this configuration element has no children.

Each child corresponds to a nested XML element in the configuration markup. For example, the configuration markup

<view>
<verticalHint>top</verticalHint>
<horizontalHint>left</horizontalHint>
</view>

corresponds to a configuration element, named "view", with two children.

Returns
the child configuration elements
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetChildren() [2/2]

virtual QList<IConfigurationElement::Pointer> berry::IConfigurationElement::GetChildren ( const QString &  name) const
pure virtual

Returns all child configuration elements with the given name. Returns an empty list if this configuration element has no children with the given name.

Parameters
namethe name of the child configuration element
Returns
the child configuration elements with that name
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetContributor()

virtual SmartPointer<IContributor> berry::IConfigurationElement::GetContributor ( ) const
pure virtual

Returns the contributor of this configuration element.

Returns
the contributor for this configuration element
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetDeclaringExtension()

virtual SmartPointer<IExtension> berry::IConfigurationElement::GetDeclaringExtension ( ) const
pure virtual

Returns the extension that declares this configuration element.

Returns
the extension
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetName()

virtual QString berry::IConfigurationElement::GetName ( ) const
pure virtual

Returns the name of this configuration element. The name of a configuration element is the same as the XML tag of the corresponding XML element. For example, the configuration markup

<wizard name="Create Project"/>

corresponds to a configuration element named "wizard".

Returns
the name of this configuration element
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetNamespaceIdentifier()

virtual QString berry::IConfigurationElement::GetNamespaceIdentifier ( ) const
pure virtual

Returns the namespace name for this configuration element.

Returns
the namespace name for this configuration element
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetParent()

virtual SmartPointer<Object> berry::IConfigurationElement::GetParent ( ) const
pure virtual

Returns the element which contains this element. If this element is an immediate child of an extension, the returned value can be downcast to IExtension. Otherwise the returned value can be downcast to IConfigurationElement.

Returns
the parent of this configuration element or null
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetValue() [1/2]

virtual QString berry::IConfigurationElement::GetValue ( ) const
pure virtual

Returns the text value of this configuration element. For example, the configuration markup

<script lang="javascript">./scripts/cp.js</script>

corresponds to a configuration element "script" with value ".\scripts\cp.js".

Values may span multiple lines (i.e., contain carriage returns and/or line feeds).

Note that any translation specified in the plug-in manifest file is automatically applied.

Returns
the text value of this configuration element or null
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid

◆ GetValue() [2/2]

virtual QString berry::IConfigurationElement::GetValue ( const QLocale &  locale) const
pure virtual

When multi-language support is enabled, this method returns the text value of this configuration element in the specified locale, or null if none.

The locale matching tries to find the best match between available translations and the requested locale, falling back to a more generic locale ("en") when the specific locale ("en_US") is not available.

If multi-language support is not enabled, this method is equivalent to the method GetValue().

Parameters
localethe requested locale
Returns
the text value of this configuration element in the specified locale, or null
Exceptions
InvalidRegistryObjectExceptionif this configuration element is no longer valid
See also
IExtensionRegistry::IsMultiLanguage()

◆ IsValid()

virtual bool berry::IConfigurationElement::IsValid ( ) const
pure virtual

Returns whether this configuration element object is valid.

Returns
true if the object is valid, and false if it is no longer valid

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