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

#include <berryIEvaluationService.h>

Inheritance diagram for berry::IEvaluationService:
Collaboration diagram for berry::IEvaluationService:

Public Member Functions

 berryObjectMacro (berry::IEvaluationService)
 
virtual void AddServiceListener (IPropertyChangeListener *listener)=0
 
virtual void RemoveServiceListener (IPropertyChangeListener *listener)=0
 
virtual SmartPointer< IEvaluationReferenceAddEvaluationListener (const SmartPointer< Expression > &expression, IPropertyChangeListener *listener, const QString &property)=0
 
virtual void AddEvaluationReference (const SmartPointer< IEvaluationReference > &ref)=0
 
virtual void RemoveEvaluationListener (const SmartPointer< IEvaluationReference > &ref)=0
 
virtual SmartPointer< IEvaluationContextGetCurrentState () const =0
 
virtual void RequestEvaluation (const QString &propertyName)=0
 
- Public Member Functions inherited from berry::IServiceWithSources
 berryObjectMacro (berry::IServiceWithSources)
 
 ~IServiceWithSources () override
 
virtual void AddSourceProvider (const SmartPointer< ISourceProvider > &provider)=0
 
virtual void RemoveSourceProvider (const SmartPointer< ISourceProvider > &provider)=0
 
- Public Member Functions inherited from berry::IDisposable
 berryObjectMacro (berry::IDisposable)
 
 ~IDisposable () override
 
virtual void Dispose ()=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
 

Static Public Attributes

static const QString RESULT
 
static const QString PROP_NOTIFYING
 

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

Evaluate a core expression against the workbench application context and report updates using a Boolean property. Clients supply an IPropertyChangeListener that will be notified as changes occur.

This can be used to implement core expressions in client extension points similar to the <enabledWhen> of org.blueberry.ui.handlers/handler elements.

The service will fire TRUE and FALSE for the oldValue and newValue in the property change events.

Adding the evaluation listener will fire one change with oldValue=null and newValue="evaluated expression". Remove the IEvaluationReference will fire one change with oldValue="last evaluated value" and newValue=null.

Adding a service listener will fire the PROP_NOTIFYING property change event with newValue=TRUE when a source change causes expression evaluations to update and another PROP_NOTIFYING property change event with newValue=FALSE when the changes that started with a specific source change have finished. The PROP_NOTIFYING change events will not be fired for source changes caused by the outer most recalculations.

Variable sources can be provided to this service using the org.blueberry.ui.services Extension Point. This makes the available to <with/> expressions.

This service can be acquired from your service locator:

  IEvaluationService::Pointer service = GetSite()->GetService(IEvaluationService::GetManifestName());
  • This service is available globally.
Note
This interface is not intended to be extended by clients.
This interface is not intended to be implemented by clients.

Definition at line 76 of file berryIEvaluationService.h.

Member Function Documentation

◆ AddEvaluationListener()

virtual SmartPointer<IEvaluationReference> berry::IEvaluationService::AddEvaluationListener ( const SmartPointer< Expression > &  expression,
IPropertyChangeListener listener,
const QString &  property 
)
pure virtual

Add a listener that can be notified when the workbench application context causes the expression evaluation value to change.

Note: listeners should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.

Parameters
expressionthe core expression to evaluate.
listenerthe listener to be notified.
propertythe property contained in the notification
Returns
a token that can be used to remove this listener. RemoveEvaluationListener

◆ AddEvaluationReference()

virtual void berry::IEvaluationService::AddEvaluationReference ( const SmartPointer< IEvaluationReference > &  ref)
pure virtual

Re-add a property change listener that has already been removed by RemoveEvaluationListener.

It will only accept IEvaluationReferences returned from a previous call to AddEvaluationListener on this service.

Note: references should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.

Parameters
refThe listener to re-add.
See also
RemoveEvaluationListener

◆ AddServiceListener()

virtual void berry::IEvaluationService::AddServiceListener ( IPropertyChangeListener listener)
pure virtual

When a source change starts recalculating expressions the PROP_NOTIFYING property change is fired with the newValue=TRUE. This property is not fired for any source changes caused by the outer recalculations.

Note: listeners should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.

Parameters
listenerThe listener to be notified. Must not be null. Has no effect if the listener has already been added.

◆ berryObjectMacro()

berry::IEvaluationService::berryObjectMacro ( berry::IEvaluationService  )

◆ GetCurrentState()

virtual SmartPointer<IEvaluationContext> berry::IEvaluationService::GetCurrentState ( ) const
pure virtual

Get an IEvaluationContext that contains the current state of the workbench application context. This context changes with the application state, but becomes invalid when the global current selection changes.

Note: This context should not be modified.

Returns
the latest context.
See also
ISources::ACTIVE_CURRENT_SELECTION_NAME

◆ RemoveEvaluationListener()

virtual void berry::IEvaluationService::RemoveEvaluationListener ( const SmartPointer< IEvaluationReference > &  ref)
pure virtual

Remove the listener represented by the evaluation reference.

Parameters
refthe reference to be removed.

◆ RemoveServiceListener()

virtual void berry::IEvaluationService::RemoveServiceListener ( IPropertyChangeListener listener)
pure virtual

Remove the listener for PROP_NOTIFYING property changes.

Parameters
listenerThe listener to remove. Must not be null. Has no effect if the listener is not currently registered.

◆ RequestEvaluation()

virtual void berry::IEvaluationService::RequestEvaluation ( const QString &  propertyName)
pure virtual

Request that this service re-evaluate all registered core expressions that contain a property tester for the given property name. This will fire a PROP_NOTIFYING property change event to service listeners.

Notes:

  • the property must be able to return the new value before this re-evaluation is requested
  • limit calls to this method to avoid unnecessary churn
  • A re-evaluation that does not change the value of an expression will not fire a property change event
Parameters
propertyNameThe fully qualified property name, like org.eclipse.core.resources.name. Must not be null.

Member Data Documentation

◆ PROP_NOTIFYING

const QString berry::IEvaluationService::PROP_NOTIFYING
static

The property used to notify any service listeners.

Definition at line 88 of file berryIEvaluationService.h.

◆ RESULT

const QString berry::IEvaluationService::RESULT
static

A general property that can be used.

Definition at line 83 of file berryIEvaluationService.h.


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