Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <berryIConfigurationElement.h>
Public Member Functions | |
berryObjectMacro (berry::IConfigurationElement) virtual ~IConfigurationElement() | |
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::Pointer > | GetChildren () const =0 |
virtual QList< IConfigurationElement::Pointer > | GetChildren (const QString &name) const =0 |
virtual SmartPointer< IExtension > | GetDeclaringExtension () const =0 |
virtual QString | GetName () const =0 |
virtual SmartPointer< Object > | GetParent () const =0 |
virtual QString | GetValue () const =0 |
virtual QString | GetValue (const QLocale &locale) const =0 |
virtual QString | GetNamespaceIdentifier () const =0 |
virtual SmartPointer< IContributor > | GetContributor () 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::TypeInfo > | GetSuperclasses () 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< Self > | Pointer |
typedef berry::SmartPointer< const Self > | ConstPointer |
typedef berry::WeakPointer< Self > | WeakPtr |
typedef berry::WeakPointer< const Self > | ConstWeakPtr |
Static Public Member Functions inherited from berry::Object | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
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 |
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.
This interface is not intended to be implemented by clients.
Definition at line 64 of file berryIConfigurationElement.h.
berry::IConfigurationElement::berryObjectMacro | ( | berry::IConfigurationElement | ) |
|
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(IConfigurationElement, QString, Object*) 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.
propertyName | the name of the property |
CoreException | if an instance of the executable extension could not be created for any reason |
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
inline |
Definition at line 106 of file berryIConfigurationElement.h.
References BERRY_WARN, and GetAttribute.
|
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.
name | the name of the attribute |
null
if none InvalidRegistryObjectException | if this configuration element is no longer valid |
|
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"
.
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
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.
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
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.
name | the name of the child configuration element |
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
pure virtual |
Returns the contributor of this configuration element.
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
pure virtual |
Returns the extension that declares this configuration element.
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
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"
.
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
pure virtual |
Returns the namespace name for this configuration element.
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
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
.
null
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
pure virtual |
Returns the text value of this configuration element. For example, the configuration markup
<script lang="javascript">..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.
null
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
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().
locale | the requested locale |
null
InvalidRegistryObjectException | if this configuration element is no longer valid |
|
pure virtual |
Returns whether this configuration element object is valid.
true
if the object is valid, and false
if it is no longer valid