Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
#include <berryAbstractHandler.h>
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 |
![]() | |
berryObjectMacro (berry::IHandler) | |
virtual Object::Pointer | Execute (const SmartPointer< const ExecutionEvent > &event)=0 |
![]() | |
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 |
Protected Member Functions | |
void | FireHandlerChanged (const SmartPointer< HandlerEvent > &handlerEvent) |
void | SetBaseEnabled (bool state) |
virtual bool | HasListeners () const |
![]() | |
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 | |
![]() | |
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 const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
![]() | |
QAtomicInt | m_ReferenceCount |
QMutex | m_ReferenceCountLock |
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(HandlerEvent)when the handler changes. Subclasses can also override AbstractHandler#isEnabled() and AbstractHandler#isHandled().
Definition at line 34 of file berryAbstractHandler.h.
berry::AbstractHandler::AbstractHandler | ( | ) |
Definition at line 20 of file berryAbstractHandler.cpp.
|
overridevirtual |
Implements berry::IHandler.
Definition at line 26 of file berryAbstractHandler.cpp.
References berry::IHandlerListener::Events::AddListener().
berry::AbstractHandler::berryObjectMacro | ( | AbstractHandler | ) |
|
overridevirtual |
The default implementation does nothing. Subclasses who attach listeners to other objects are encouraged to detach them in this method.
Implements berry::IHandler.
Definition at line 31 of file berryAbstractHandler.cpp.
|
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>".
handlerEvent | the event describing changes to this instance. Must not be null . |
Definition at line 55 of file berryAbstractHandler.cpp.
References berry::IHandlerListener::Events::handlerChanged, and berry::SmartPointer< TObjectType >::IsNull().
Referenced by SetBaseEnabled().
|
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>".
Definition at line 76 of file berryAbstractHandler.cpp.
References berry::IHandlerListener::Events::handlerChanged, and berry::Message1< T, A >::HasListeners().
|
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(Object) so they can be notified about framework execution contexts.
true
Implements berry::IHandler.
Definition at line 36 of file berryAbstractHandler.cpp.
|
overridevirtual |
Whether this handler is capable of handling delegated responsibilities at this time. Subclasses may override this method.
true
Implements berry::IHandler.
Definition at line 45 of file berryAbstractHandler.cpp.
|
overridevirtual |
Implements berry::IHandler.
Definition at line 50 of file berryAbstractHandler.cpp.
References berry::IHandlerListener::Events::RemoveListener().
|
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(Object) so they can be notified about framework execution contexts.
state | the enabled state |
Definition at line 65 of file berryAbstractHandler.cpp.
References FireHandlerChanged().
|
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.
evaluationContext | the application context. May be null |
Implements berry::IHandler.
Definition at line 41 of file berryAbstractHandler.cpp.