Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
#include <berryHandlerUtil.h>
Public Types | |
typedef ObjectList< ObjectString::Pointer > | StringVectorType |
Some common utilities for working with handlers in Platform UI.
Note: this class should not be instantiated or extended by clients.
Definition at line 40 of file berryHandlerUtil.h.
Definition at line 52 of file berryHandlerUtil.h.
|
static |
Return the active contexts.
event | The execution event that contains the application context |
null
. Definition at line 80 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_CONTEXT_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariable().
|
static |
Return the active contexts.
event | The execution event that contains the application context |
null
. ExecutionException | If the context variable is not found. |
Definition at line 87 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_CONTEXT_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariableChecked().
|
static |
Return the active editor.
event | The execution event that contains the application context |
null
. Return the active editor.event | The execution event that contains the application context |
null
. ExecutionException | If the active editor variable is not found. Return the part id of the active editor. |
event | The execution event that contains the application context |
null
. Definition at line 120 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_EDITOR_ID_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariable().
|
static |
Return the part id of the active editor.
event | The execution event that contains the application context |
null
. ExecutionException | If the active editor id variable is not found. |
Definition at line 127 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_EDITOR_ID_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariableChecked().
|
static |
Return the active menu editor input, if available. The active menu is a registered context menu.
event | The execution event that contains the application context |
null
. Definition at line 288 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_MENU_EDITOR_INPUT_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariable().
|
static |
Return the active menu editor input. The active menu is a registered context menu. Some context menus do not include the editor input which will throw an exception.
event | The execution event that contains the application context |
null
. ExecutionException | If the active menu editor input variable is not found. |
Definition at line 296 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_MENU_EDITOR_INPUT_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariableChecked().
|
static |
Return the menu IDs that were applied to the registered context menu. For example, #CompilationUnitEditorContext.
event | The execution event that contains the application context |
null
. Definition at line 223 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_MENU_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariable().
|
static |
Return the menu IDs that were applied to the registered context menu. For example, #CompilationUnitEditorContext.
event | The execution event that contains the application context |
null
. ExecutionException | If the active menus variable is not found. |
Definition at line 231 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_MENU_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariableChecked().
|
static |
Return the active menu selection. The active menu is a registered context menu.
event | The execution event that contains the application context |
null
. Definition at line 244 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_MENU_SELECTION_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariable().
|
static |
Return the active menu selection. The active menu is a registered context menu.
event | The execution event that contains the application context |
null
. ExecutionException | If the active menu selection variable is not found. |
Definition at line 252 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_MENU_SELECTION_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariableChecked().
|
static |
Return the active part.
event | The execution event that contains the application context |
null
. Definition at line 140 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_PART_NAME(), berry::SmartPointer< TObjectType >::GetPointer(), and GetVariable().
|
static |
Return the active part.
event | The execution event that contains the application context |
null
. ExecutionException | If the active part variable is not found. |
Definition at line 147 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_PART_NAME(), berry::SmartPointer< TObjectType >::Cast(), berry::SmartPointer< TObjectType >::GetPointer(), and GetVariableChecked().
|
static |
Return the part id of the active part.
event | The execution event that contains the application context |
null
. Definition at line 160 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_PART_ID_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariable().
|
static |
Return the part id of the active part.
event | The execution event that contains the application context |
null
. ExecutionException | If the active part id variable is not found. |
Definition at line 167 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_PART_ID_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariableChecked().
|
static |
Return the active part site.
event | The execution event that contains the application context |
null
. Definition at line 180 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_SITE_NAME(), berry::SmartPointer< TObjectType >::GetPointer(), and GetVariable().
|
static |
Return the active part site.
event | The execution event that contains the application context |
null
. ExecutionException | If the active part site variable is not found. |
Definition at line 188 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_SITE_NAME(), berry::SmartPointer< TObjectType >::Cast(), berry::SmartPointer< TObjectType >::GetPointer(), and GetVariableChecked().
|
static |
Return the active shell. Is not necessarily the active workbench window shell.
event | The execution event that contains the application context |
null
. Return the active shell. Is not necessarily the active workbench window shell.event | The execution event that contains the application context |
null
. ExecutionException | If the active shell variable is not found. Return the active workbench window. |
event | The execution event that contains the application context |
null
. Definition at line 266 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_WORKBENCH_WINDOW_NAME(), berry::SmartPointer< TObjectType >::GetPointer(), and GetVariable().
|
static |
Return the active workbench window.
event | The execution event that contains the application context |
null
. ExecutionException | If the active workbench window variable is not found. |
Definition at line 274 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_WORKBENCH_WINDOW_NAME(), berry::SmartPointer< TObjectType >::Cast(), berry::SmartPointer< TObjectType >::GetPointer(), and GetVariableChecked().
|
static |
Return the current selection.
event | The execution event that contains the application context |
null
. Definition at line 201 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_CURRENT_SELECTION_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariable().
|
static |
Return the current selection.
event | The execution event that contains the application context |
null
. ExecutionException | If the current selection variable is not found. |
Definition at line 209 of file berryHandlerUtil.cpp.
References berry::ISources::ACTIVE_CURRENT_SELECTION_NAME(), berry::SmartPointer< TObjectType >::Cast(), and GetVariableChecked().
|
static |
Return the ShowInContext input.
event | The execution event that contains the application context |
null
. Definition at line 331 of file berryHandlerUtil.cpp.
References GetVariable(), and berry::ISources::SHOW_IN_INPUT().
|
static |
Return the ShowInContext input. Will not return null
.
event | The execution event that contains the application context |
null
. ExecutionException | If the show in input variable is not found. |
Definition at line 342 of file berryHandlerUtil.cpp.
References GetVariableChecked(), and berry::ISources::SHOW_IN_INPUT().
|
static |
Return the ShowInContext selection.
event | The execution event that contains the application context |
null
. Definition at line 310 of file berryHandlerUtil.cpp.
References berry::SmartPointer< TObjectType >::Cast(), GetVariable(), and berry::ISources::SHOW_IN_SELECTION().
|
static |
Return the ShowInContext selection. Will not return null
.
event | The execution event that contains the application context |
null
. ExecutionException | If the show in selection variable is not found. |
Definition at line 318 of file berryHandlerUtil.cpp.
References berry::SmartPointer< TObjectType >::Cast(), GetVariableChecked(), and berry::ISources::SHOW_IN_SELECTION().
|
static |
Extract the variable.
event | The execution event that contains the application context |
name | The variable name to extract. |
null
if it could not be found. Definition at line 46 of file berryHandlerUtil.cpp.
References berry::SmartPointer< TObjectType >::Cast(), and berry::IEvaluationContext::UNDEFINED_VARIABLE.
Referenced by GetActiveContexts(), GetActiveEditorId(), GetActiveMenuEditorInput(), GetActiveMenus(), GetActiveMenuSelection(), GetActivePart(), GetActivePartId(), GetActiveSite(), GetActiveWorkbenchWindow(), GetCurrentSelection(), GetShowInInput(), GetShowInSelection(), and GetVariableChecked().
|
static |
Extract the variable.
context | The IEvaluationContext or null |
name | The variable name to extract. |
null
if it could not be found. Definition at line 68 of file berryHandlerUtil.cpp.
References berry::SmartPointer< TObjectType >::Cast(), berry::SmartPointer< TObjectType >::IsNotNull(), and berry::IEvaluationContext::UNDEFINED_VARIABLE.
|
static |
Extract the variable.
event | The execution event that contains the application context |
name | The variable name to extract. |
null
. ExecutionException | if the variable is not found. |
Definition at line 57 of file berryHandlerUtil.cpp.
References GetVariable(), and berry::SmartPointer< TObjectType >::IsNull().
Referenced by GetActiveContextsChecked(), GetActiveEditorIdChecked(), GetActiveMenuEditorInputChecked(), GetActiveMenusChecked(), GetActiveMenuSelectionChecked(), GetActivePartChecked(), GetActivePartIdChecked(), GetActiveSiteChecked(), GetActiveWorkbenchWindowChecked(), GetCurrentSelectionChecked(), GetShowInInputChecked(), and GetShowInSelectionChecked().
|
static |
Checks whether the radio state of the command is same as the radio state parameter's value
event | The execution event that contains the application context |
true
whe the values are same, false
otherwiseExecutionException | When the command doesn't have the radio state or the event doesn't have the radio state parameter |
Definition at line 374 of file berryHandlerUtil.cpp.
References berry::SmartPointer< TObjectType >::Cast(), berry::SmartPointer< TObjectType >::IsNull(), berry::RadioState::PARAMETER_ID, and berry::RadioState::STATE_ID.
|
static |
Toggles the command's state.
command | The command whose state needs to be toggled |
ExecutionException | When the command doesn't contain the toggle state or when the state doesn't contain a boolean value |
Definition at line 354 of file berryHandlerUtil.cpp.
References berry::SmartPointer< TObjectType >::Cast(), berry::SmartPointer< TObjectType >::IsNull(), and berry::RegistryToggleState::STATE_ID.
|
static |
Updates the radio state of the command to the given value
command | the command whose state should be updated |
newState | the new state |
ExecutionException | When the command doesn't have a radio state |
Definition at line 398 of file berryHandlerUtil.cpp.
References berry::SmartPointer< TObjectType >::IsNull(), and berry::RadioState::STATE_ID.