Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
berry::AbstractHandler Class Reference

#include <berryAbstractHandler.h>

Inheritance diagram for berry::AbstractHandler:
Collaboration diagram for berry::AbstractHandler:

Public Member Functions

 berryObjectMacro (AbstractHandler)
 
 AbstractHandler ()
 
void AddHandlerListener (IHandlerListener *handlerListener) override
 
void Dispose () override
 
bool IsEnabled () const override
 
void SetEnabled (const Object::Pointer &evaluationContext) override
 
bool IsHandled () const override
 
void RemoveHandlerListener (IHandlerListener *handlerListener) override
 
- Public Member Functions inherited from berry::IHandler
 berryObjectMacro (berry::IHandler)
 
virtual Object::Pointer Execute (const SmartPointer< const ExecutionEvent > &event)=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
 

Protected Member Functions

void FireHandlerChanged (const SmartPointer< HandlerEvent > &handlerEvent)
 
void SetBaseEnabled (bool state)
 
virtual bool HasListeners () const
 
- 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
 

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 Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

This class is a partial implementation of IHandler. This abstract implementation provides support for handler listeners. You should subclass from this class unless you want to implement your own listener support. Subclasses should call AbstractHandler#FireHandlerChanged when the handler changes. Subclasses can also override AbstractHandler#IsEnabled and AbstractHandler#IsHandled.

Definition at line 34 of file berryAbstractHandler.h.

Constructor & Destructor Documentation

◆ AbstractHandler()

berry::AbstractHandler::AbstractHandler ( )

Member Function Documentation

◆ AddHandlerListener()

void berry::AbstractHandler::AddHandlerListener ( IHandlerListener handlerListener)
overridevirtual
See also
IHandler::addHandlerListener(IHandlerListener)

Implements berry::IHandler.

◆ berryObjectMacro()

berry::AbstractHandler::berryObjectMacro ( AbstractHandler  )

◆ Dispose()

void berry::AbstractHandler::Dispose ( )
overridevirtual

The default implementation does nothing. Subclasses who attach listeners to other objects are encouraged to detach them in this method.

See also
IHandler::Dispose()

Implements berry::IHandler.

◆ FireHandlerChanged()

void berry::AbstractHandler::FireHandlerChanged ( const SmartPointer< HandlerEvent > &  handlerEvent)
protected

Fires an event to all registered listeners describing changes to this instance.

Subclasses may extend the definition of this method (i.e., if a different type of listener can be attached to a subclass). This is used primarily for support of AbstractHandler in org.blueberry.ui.workbench, and clients should be wary of overriding this behaviour. If this method is overridden, then the first line of the method should be "<code>super.fireHandlerChanged(handlerEvent);</code>".

Parameters
handlerEventthe event describing changes to this instance. Must not be null.

◆ HasListeners()

virtual bool berry::AbstractHandler::HasListeners ( ) const
protectedvirtual

Returns true iff there is one or more IHandlerListeners attached to this AbstractHandler.

Subclasses may extend the definition of this method (i.e., if a different type of listener can be attached to a subclass). This is used primarily for support of AbstractHandler in org.blueberry.ui.qt, and clients should be wary of overriding this behaviour. If this method is overridden, then the return value should include "<code>super.hasListeners() ||</code>".

Returns
true iff there is one or more IHandlerListeners attached to this AbstractHandler

◆ IsEnabled()

bool berry::AbstractHandler::IsEnabled ( ) const
overridevirtual

Whether this handler is capable of executing at this time. Subclasses may override this method. If clients override this method they should also consider overriding SetEnabled so they can be notified about framework execution contexts.

Returns
true
See also
SetEnabled
SetBaseEnabled

Implements berry::IHandler.

◆ IsHandled()

bool berry::AbstractHandler::IsHandled ( ) const
overridevirtual

Whether this handler is capable of handling delegated responsibilities at this time. Subclasses may override this method.

Returns
true

Implements berry::IHandler.

◆ RemoveHandlerListener()

void berry::AbstractHandler::RemoveHandlerListener ( IHandlerListener handlerListener)
overridevirtual
See also
IHandler::removeHandlerListener(IHandlerListener)

Implements berry::IHandler.

◆ SetBaseEnabled()

void berry::AbstractHandler::SetBaseEnabled ( bool  state)
protected

Allow the default IsEnabled to answer our enabled state. It will fire a HandlerEvent if necessary. If clients use this method they should also consider overriding SetEnabled so they can be notified about framework execution contexts.

Parameters
statethe enabled state

◆ SetEnabled()

void berry::AbstractHandler::SetEnabled ( const Object::Pointer evaluationContext)
overridevirtual

Called by the framework to allow the handler to update its enabled state by extracting the same information available at execution time. Clients may override if they need to extract information from the application context.

Parameters
evaluationContextthe application context. May be null
See also
SetBaseEnabled(bool)

Implements berry::IHandler.


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