#include <berryAbstractHandler.h>
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.
◆ AbstractHandler()
berry::AbstractHandler::AbstractHandler |
( |
| ) |
|
◆ AddHandlerListener()
void berry::AbstractHandler::AddHandlerListener |
( |
IHandlerListener * |
handlerListener | ) |
|
|
overridevirtual |
- See also
- IHandler::addHandlerListener(IHandlerListener)
Implements berry::IHandler.
◆ berryObjectMacro()
◆ 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()
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
-
handlerEvent | the 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
-
◆ 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
-
evaluationContext | the application context. May be null |
- See also
- SetBaseEnabled(bool)
Implements berry::IHandler.
The documentation for this class was generated from the following file: