Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
#include <berryIContextService.h>
Public Types | |
enum | ShellType { TYPE_DIALOG, TYPE_NONE, TYPE_WINDOW } |
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 |
Public Member Functions | |
virtual SmartPointer< IContextActivation > | ActivateContext (const QString &contextId)=0 |
virtual SmartPointer< IContextActivation > | ActivateContext (const QString &contextId, const SmartPointer< Expression > &expression)=0 |
virtual SmartPointer< IContextActivation > | ActivateContext (const QString &contextId, const SmartPointer< Expression > &expression, bool global)=0 |
virtual void | AddContextManagerListener (IContextManagerListener *listener)=0 |
virtual void | DeactivateContext (const SmartPointer< IContextActivation > &activation)=0 |
virtual void | DeactivateContexts (const QList< SmartPointer< IContextActivation > > &activations)=0 |
virtual QList< QString > | GetActiveContextIds () const =0 |
virtual SmartPointer< Context > | GetContext (const QString &contextId) const =0 |
virtual QList< SmartPointer< Context > > | GetDefinedContexts () const =0 |
virtual QList< QString > | GetDefinedContextIds () const =0 |
virtual ShellType | GetShellType (const SmartPointer< Shell > &shell) const =0 |
virtual ShellType | GetShellType (QWidget *widget) const =0 |
virtual void | ReadRegistry ()=0 |
virtual bool | RegisterShell (const SmartPointer< Shell > &shell, ShellType type)=0 |
virtual void | RemoveContextManagerListener (IContextManagerListener *listener)=0 |
virtual bool | UnregisterShell (const SmartPointer< Shell > &shell)=0 |
virtual void | DeferUpdates (bool defer)=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::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 |
Static Public Attributes | |
static const QString | CONTEXT_ID_WORKBENCH_MENU |
static const QString | CONTEXT_ID_DIALOG |
static const QString | CONTEXT_ID_DIALOG_AND_WINDOW |
static const QString | CONTEXT_ID_WINDOW |
Additional Inherited Members | |
Static Public Member Functions inherited from berry::Object | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
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 |
Provides services related to contexts in the blueberry workbench. This provides access to contexts.
This service can be acquired from your service locator:
IContextService service = (IContextService) getSite().getService(IContextService.class);
Definition at line 45 of file berryIContextService.h.
Definition at line 71 of file berryIContextService.h.
|
pure virtual |
Activates the given context within the context of this service. If this service was retrieved from the workbench, then this context will be active globally. If the service was retrieved from a nested component, then the context will only be active within that component.
Also, it is guaranteed that the contexts submitted through a particular service will be cleaned up when that services is destroyed. So, for example, a service retrieved from a IWorkbenchPartSite
would deactivate all of its contexts when the site is destroyed.
contextId | The identifier for the context which should be activated; must not be null . |
|
pure virtual |
Activates the given context within the context of this service. The context becomes active when expression
evaluates to true
. This is the same as calling ActivateContext with global==false
.
Also, it is guaranteed that the context submitted through a particular service will be cleaned up when that services is destroyed. So, for example, a service retrieved from a IWorkbenchPartSite
would deactivate all of its handlers when the site is destroyed.
contextId | The identifier for the context which should be activated; must not be null . |
expression | This expression must evaluate to true before this context will really become active. The expression may be null if the context should always be active. |
|
pure virtual |
Activates the given context within the context of this service. The context becomes active when expression
evaluates to true
. If global==false
then this service must also be the active service to activate the context.
Also, it is guaranteed that the context submitted through a particular service will be cleaned up when that services is destroyed. So, for example, a service retrieved from a IWorkbenchPartSite
would deactivate all of its handlers when the site is destroyed.
contextId | The identifier for the context which should be activated; must not be null . |
expression | This expression must evaluate to true before this context will really become active. The expression may be null if the context should always be active. |
global | Indicates that the handler should be activated irrespectively of whether the corresponding workbench component (e.g., window, part, etc.) is active. |
|
pure virtual |
Adds a listener to this context service. The listener will be notified when the set of defined contexts changes. This can be used to track the global appearance and disappearance of contexts.
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.
listener | The listener to attach; must not be null . |
|
pure virtual |
Deactivates the given context within the context of this service. If the handler was context with a different service, then it must be deactivated from that service instead. It is only possible to retract a context activation with this method. That is, you must have the same IContextActivation
used to activate the context.
activation | The token that was returned from a call to activateContext ; must not be null . |
|
pure virtual |
Deactivates the given contexts within the context of this service. If the contexts were activated with a different service, then they must be deactivated from that service instead. It is only possible to retract context activations with this method. That is, you must have the same IContextActivation
instances used to activate the contexts.
activations | The tokens that were returned from a call to activateContext . This collection must only contain instances of IContextActivation . The collection must not be null . |
|
pure virtual |
Informs the service that a batch operation has started.
Note: You must insure that if you call deferUpdates(true)
that nothing in your batched operation will prevent the matching call to deferUpdates(false)
.
defer | true when starting a batch operation false when ending the operation |
|
pure virtual |
Returns the set of active context identifiers.
null
if no active contexts have been set yet. If the set is not null
, then it contains only instances of String
.
|
pure virtual |
Retrieves the context with the given identifier. If no such context exists, then an undefined context with the given id is created.
contextId | The identifier to find; must not be null . |
|
pure virtual |
Returns the collection of the identifiers for all of the defined contexts in the workbench.
String
) that are defined; never null
, but may be empty.
|
pure virtual |
Returns the collection of all of the defined contexts in the workbench.
Context
) that are defined; never null
, but may be empty.
|
pure virtual |
Returns the shell type for the given shell.
shell | The shell for which the type should be determined. If this value is null , then IContextService.TYPE_NONE is returned. |
|
pure virtual |
|
pure virtual |
Reads the context information from the registry and the preferences. This will overwrite any of the existing information in the context service. This method is intended to be called during start-up. When this method completes, this context service will reflect the current state of the registry and preference store.
|
pure virtual |
Registers a shell to automatically promote or demote some basic types of contexts. The "In Dialogs" and "In Windows" contexts are provided by the system. This a convenience method to ensure that these contexts are promoted when the given is shell is active.
If a shell is registered as a window, then the "In Windows" context is enabled when that shell is active. If a shell is registered as a dialog – or is not registered, but has a parent shell – then the "In Dialogs" context is enabled when that shell is active. If the shell is registered as none – or is not registered, but has no parent shell – then the neither of the contexts will be enabled (by us – someone else can always enabled them).
If the provided shell has already been registered, then this method will change the registration.
shell | The shell to register for key bindings; must not be null . |
type | The type of shell being registered. This value must be one of the constants given in this interface. |
true
if the shell had already been registered (i.e., the registration has changed); false
otherwise.
|
pure virtual |
Removes a listener from this context service.
listener | The listener to be removed; must not be null . |
|
pure virtual |
Unregisters a shell that was previously registered. After this method completes, the shell will be treated as if it had never been registered at all. If you have registered a shell, you should ensure that this method is called when the shell is disposed. Otherwise, a potential memory leak will exist.
If the shell was never registered, or if the shell is null
, then this method returns false
and does nothing.
shell | The shell to be unregistered; does nothing if this value is null . |
true
if the shell had been registered; false
otherwise.
|
static |
The identifier for the context that is active when a shell registered as a dialog.
Definition at line 57 of file berryIContextService.h.
|
static |
The identifier for the context that is active when a shell is registered as either a window or a dialog.
Definition at line 63 of file berryIContextService.h.
|
static |
The identifier for the context that is active when a shell is registered as a window.
Definition at line 69 of file berryIContextService.h.
|
static |
The identifier for the context that is active when a workbench is active.
Definition at line 51 of file berryIContextService.h.