Medical Imaging Interaction Toolkit
2024.06.00
Medical Imaging Interaction Toolkit
|
#include <berryICommandService.h>
Public Member Functions | |
berryObjectMacro (berry::ICommandService) | |
virtual void | AddExecutionListener (IExecutionListener *listener)=0 |
virtual void | DefineUncategorizedCategory (const QString &name, const QString &description)=0 |
virtual SmartPointer< ParameterizedCommand > | Deserialize (const QString &serializedParameterizedCommand) const =0 |
virtual SmartPointer< CommandCategory > | GetCategory (const QString &categoryId) const =0 |
virtual SmartPointer< Command > | GetCommand (const QString &commandId) const =0 |
virtual QList< SmartPointer< CommandCategory > > | GetDefinedCategories () const =0 |
virtual QStringList | GetDefinedCategoryIds () const =0 |
virtual QStringList | GetDefinedCommandIds () const =0 |
virtual QList< SmartPointer< Command > > | GetDefinedCommands () const =0 |
virtual QStringList | GetDefinedParameterTypeIds () const =0 |
virtual QList< SmartPointer< ParameterType > > | GetDefinedParameterTypes () const =0 |
virtual QString | GetHelpContextId (const SmartPointer< const Command > &command) const =0 |
virtual QString | GetHelpContextId (const QString &commandId) const =0 |
virtual SmartPointer< ParameterType > | GetParameterType (const QString ¶meterTypeId) const =0 |
virtual void | ReadRegistry ()=0 |
virtual void | RemoveExecutionListener (IExecutionListener *listener)=0 |
virtual void | SetHelpContextId (const SmartPointer< IHandler > &handler, const QString &helpContextId)=0 |
virtual SmartPointer< IElementReference > | RegisterElementForCommand (const SmartPointer< ParameterizedCommand > &command, const SmartPointer< UIElement > &element)=0 |
virtual void | RegisterElement (const SmartPointer< IElementReference > &elementReference)=0 |
virtual void | UnregisterElement (const SmartPointer< IElementReference > &elementReference)=0 |
virtual void | RefreshElements (const QString &commandId, const QHash< QString, Object::Pointer > &filter)=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 Member Functions | |
static const QString | AUTOGENERATED_CATEGORY_ID () |
Static Public Member Functions inherited from berry::Object | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
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 |
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 the command architecture within the workbench. This service can be used to access the set of commands and command categories.
This service can be acquired from your service locator:
ICommandService service = (ICommandService) getSite().getService(ICommandService.class);
Definition at line 51 of file berryICommandService.h.
|
pure virtual |
Adds an execution listener to the command service. This listener will be notified as commands are executed.
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 add; must not be null . |
|
static |
The identifier of the category in which all auto-generated commands will appear. This value must never be null
.
berry::ICommandService::berryObjectMacro | ( | berry::ICommandService | ) |
|
pure virtual |
Sets the name and description of the category for uncategorized commands. This is the category that will be returned if GetCategory is called with null
.
name | The name of the category for uncategorized commands; must not be null . |
description | The description of the category for uncategorized commands; may be null . |
|
pure virtual |
Returns a ParameterizedCommand with a command and parameterizations as specified in the provided serializedParameterizedCommand
string. The serializedParameterizedCommand
must use the format returned by ParameterizedCommand#Serialize and described in the Javadoc for that method.
If a parameter id encoded in the serializedParameterizedCommand
does not exist in the encoded command, that parameter id and value are ignored. A given parameter id should not be used more than once in serializedParameterizedCommand
. This will not result in an exception, but the value of the parameter when the command is executed cannot be specified here.
This method will never return null
, however it may throw an exception if there is a problem processing the serialization string or the encoded command is undefined.
serializedParameterizedCommand | a String representing a command id and parameter ids and values |
ParameterizedCommand
with the command and parameterizations encoded in the serializedParameterizedCommand
NotDefinedException | if the command indicated in serializedParameterizedCommand is not defined |
SerializationException | if there is an error deserializing serializedParameterizedCommand |
|
pure virtual |
Retrieves the category with the given identifier. If no such category exists, then an undefined category with the given id is created.
categoryId | The identifier to find. If the category is null , then a category suitable for uncategorized items is defined and returned. |
|
pure virtual |
Retrieves the command with the given identifier. If no such command exists, then an undefined command with the given id is created.
commandId | The identifier to find; must not be null . |
|
pure virtual |
Returns the collection of all of the defined categories in the workbench.
Category
) that are defined; never null
, but may be empty.
|
pure virtual |
Returns the collection of the identifiers for all of the defined categories in the workbench.
String
) that are defined; never null
, but may be empty.
|
pure virtual |
Returns the collection of the identifiers for all of the defined commands in the workbench.
String
) that are defined; never null
, but may be empty.
|
pure virtual |
Returns the collection of all of the defined commands in the workbench.
Command
) that are defined; never null
, but may be empty.
|
pure virtual |
Returns the collection of the identifiers for all of the defined command parameter types in the workbench.
String
) that are defined; never null
, but may be empty.
|
pure virtual |
Returns the collection of all of the defined command parameter types in the workbench.
ParameterType
) that are defined; never null
, but may be empty.
|
pure virtual |
Gets the help context identifier for a particular command. The command's handler is first checked for a help context identifier. If the handler does not have a help context identifier, then the help context identifier for the command is returned. If neither has a help context identifier, then null
is returned.
commandId | The identifier of the command for which the help context should be retrieved; must not be null . |
null
. NotDefinedException | If the command with the given identifier is not defined. |
|
pure virtual |
Gets the help context identifier for a particular command. The command's handler is first checked for a help context identifier. If the handler does not have a help context identifier, then the help context identifier for the command is returned. If neither has a help context identifier, then null
is returned.
command | The command for which the help context should be retrieved; must not be null . |
null
. NotDefinedException | If the given command is not defined. |
|
pure virtual |
Retrieves the command parameter type with the given identifier. If no such parameter type exists, then an undefined parameter type with the given id is created.
parameterTypeId | The identifier to find; must not be null . |
|
pure virtual |
Reads the command information from the registry and the preferences. This will overwrite any of the existing information in the command service. This method is intended to be called during start-up. When this method completes, this command service will reflect the current state of the registry and preference store.
|
pure virtual |
Refresh any elements registered against the command with the given id. It allows the active handler the opportunity to provide user feedback. If the command is parameterized, some of the parameters can be specified to help narrow down which elements to refresh.
The service locator used in registering the element can also be used to scope the search. For example: if you wanted all elements for your command but only within the part's workbench window, you could use:
Map filter = new HashMap(); filter.put(IServiceScopes.WINDOW_SCOPE, getSite().getPage() .getWorkbenchWindow()); commandService.refreshElements(commandId, filter);
commandId | The command id to refresh if it has registered eleemnts. |
filter | key-value pairs that can narrow down the callbacks to return. The parameters are ANDed together. This may be null . |
|
pure virtual |
Re-register a callback element provided by the ICommandService. This element reference must not currently be held by the ICommandService. i.e. it must have been removed using UnregisterElement.
Note: elements should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.
elementReference | The reference to re-register. Must not be null . |
|
pure virtual |
Register that this element accepts callbacks for this parameterized command.
Note: elements should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.
command | The parameterized command that is already specialized. Must not be null . |
element | The callback to register for this specialized command instance. Must not be null . |
NotDefinedException | If the command included in the ParameterizedCommand is not defined, or the element is null . |
|
pure virtual |
Removes an execution listener from the command service.
listener | The listener to remove; must not be null . |
|
pure virtual |
Sets the help context identifier to associate with a particular handler.
handler | The handler with which to register a help context identifier; must not be null . |
helpContextId | The help context identifier to register; may be null if the help context identifier should be removed. |
|
pure virtual |
Unregister an element callback. It will be removed from the ICommandService. The same service that is used to register an element for a command must be used to unregister the element.
elementReference | The callback reference that was provided by the command service on registration. Must not be null . |