Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <berryAbstractHandler.h>
Public Member Functions | |
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 void AddHandlerListener(IHandlerListener *handlerListener)=0 | |
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::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 |
Public Attributes | |
berryObjectMacro(AbstractHandler) private IHandlerListener::Events | handlerListeners |
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< 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 Attributes inherited from berry::Object | |
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 38 of file berryAbstractHandler.h.
berry::AbstractHandler::AbstractHandler | ( | ) |
Definition at line 24 of file berryAbstractHandler.cpp.
|
override |
Definition at line 30 of file berryAbstractHandler.cpp.
References handlerListeners.
|
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 35 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 59 of file berryAbstractHandler.cpp.
References handlerListeners, 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 80 of file berryAbstractHandler.cpp.
References handlerListeners, and HasListeners().
Referenced by 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 40 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 49 of file berryAbstractHandler.cpp.
|
overridevirtual |
Implements berry::IHandler.
Definition at line 54 of file berryAbstractHandler.cpp.
References handlerListeners.
|
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 69 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 45 of file berryAbstractHandler.cpp.
berryObjectMacro (AbstractHandler) private IHandlerListener::Events berry::AbstractHandler::handlerListeners |
Track this base class enabled state.
Definition at line 44 of file berryAbstractHandler.h.
Referenced by AddHandlerListener(), FireHandlerChanged(), HasListeners(), and RemoveHandlerListener().