Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <berryPropertyTester.h>
Public Member Functions | |
void | InternalInitialize (PropertyTesterDescriptor::Pointer descriptor) |
PropertyTesterDescriptor::Pointer | InternalCreateDescriptor () |
bool | Handles (const QString &namespaze, const QString &property) override |
bool | IsInstantiated () override |
bool | IsDeclaringPluginActive () override |
IPropertyTester * | Instantiate () override |
Public Member Functions inherited from berry::IPropertyTester | |
berryObjectMacro (berry::IPropertyTester) virtual ~IPropertyTester() | |
virtual bool | Test (Object::ConstPointer receiver, const QString &property, const QList< Object::Pointer > &args, Object::Pointer expectedValue)=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 |
Abstract superclass of all property testers. Implementation classes of the extension point org.blueberry.core.expresssions.propertyTesters
must extend PropertyTester
.
A property tester implements the property tests enumerated in the property tester extension point. For the following property test extension
<propertyTester namespace="org.blueberry.jdt.core" id="org.blueberry.jdt.core.IPackageFragmentTester" properties="isDefaultPackage" type="org.blueberry.jdt.core.IPackageFragment" class="org.blueberry.demo.MyPackageFragmentTester"> </propertyTester>
the corresponding implementation class looks like:
public class MyPackageFragmentTester { public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { IPackageFragment fragement= (IPackageFragment)receiver; if ("isDefaultPackage".equals(property)) { return expectedValue == null ? fragement.isDefaultPackage() : fragement.isDefaultPackage() == ((Boolean)expectedValue).booleanValue(); } Assert.isTrue(false); return false; } }
The property can then be used in a test expression as follows:
<instanceof value="org.blueberry.core.IPackageFragment"/> <test property="org.blueberry.jdt.core.isDefaultPackage"/>
There is no guarantee that the same instance of a property tester is used to handle <test property="..."/> requests. So property testers should always be implemented in a stateless fashion.
Definition at line 72 of file berryPropertyTester.h.
|
overridevirtual |
Returns whether the property tester can handle the given property or not.
namespace | the name space to be considered |
property | the property to test |
true
if the tester provides an implementation for the given property; otherwise false
is returnedImplements berry::IPropertyTester.
Definition at line 40 of file berryPropertyTester.cpp.
|
overridevirtual |
Loads the implementation class for this property tester and returns an instance of this class.
CoreException | if the implementation class cannot be loaded |
Implements berry::IPropertyTester.
Definition at line 57 of file berryPropertyTester.cpp.
PropertyTesterDescriptor::Pointer berry::PropertyTester::InternalCreateDescriptor | ( | ) |
Note: this method is for internal use only. Clients must not call this method.
Definition at line 34 of file berryPropertyTester.cpp.
void berry::PropertyTester::InternalInitialize | ( | PropertyTesterDescriptor::Pointer | descriptor | ) |
Initialize the property tester with the given name space and property.
Note: this method is for internal use only. Clients must not call this method.
descriptor | the descriptor object for this tester |
Definition at line 27 of file berryPropertyTester.cpp.
|
overridevirtual |
Returns true
if the implementation class of this property tester can be loaded. This is the case if the plug-in providing the implementation class is active. Returns false
otherwise.
Implements berry::IPropertyTester.
Definition at line 51 of file berryPropertyTester.cpp.
References berry::Platform::GetPlugin().
|
overridevirtual |
Returns whether the implementation class for this property tester is loaded or not.
true
if the implementation class is loaded; false
otherwiseImplements berry::IPropertyTester.
Definition at line 46 of file berryPropertyTester.cpp.