The plug-in activator for the CoreExt module. More...
#include <mitkCoreExtActivator.h>
Public Member Functions | |
void | Start (berry::IBundleContext::Pointer context) |
void | StartInputDeviceModules () |
The plug-in activator for the CoreExt module.
When the plug-in is started by the framework, it initializes CoreExt module itself.
Furthermore through every other bundle, that is included in mitk::CoreExtActivator::Start
,
another module will be activated in the process. This can be done by adding a method to
mitk::CoreExtActivator::Start
,which initializes an Activator of the desired bundle.
E.g. mitk::CoreExtActivator::StartInputDevicesModules
Definition at line 39 of file mitkCoreExtActivator.h.
void mitk::CoreExtActivator::Start | ( | berry::IBundleContext::Pointer | context ) |
Registers sandbox core object factories.
context | the context for the bundle |
Reimplemented from berry::Plugin.
Definition at line 29 of file mitkCoreExtActivator.cpp.
References RegisterCoreExtObjectFactory(), and StartInputDeviceModules().
{ RegisterCoreExtObjectFactory(); this->StartInputDeviceModules(); }
void mitk::CoreExtActivator::StartInputDeviceModules | ( | ) |
Activates the input device modules.
Definition at line 35 of file mitkCoreExtActivator.cpp.
References berry::Platform::GetServiceRegistry(), ID, mitk::CoreExtConstants::INPUTDEVICE_PREFERENCES, and mitk::CoreExtConstants::INPUTDEVICE_SERVICE.
Referenced by Start().
{ mitk::IInputDeviceRegistry::Pointer inputDeviceRegistry(new mitk::InputDeviceRegistry()); berry::Platform::GetServiceRegistry().RegisterService(mitk::CoreExtConstants::INPUTDEVICE_SERVICE,inputDeviceRegistry); // Gets the last setting of the preferences; if a device was selected, it will still be activated after a restart berry::IPreferencesService::Pointer prefService = berry::Platform::GetServiceRegistry() .GetServiceById<berry::IPreferencesService>(berry::IPreferencesService::ID); berry::IPreferences::Pointer extPreferencesNode = prefService->GetSystemPreferences()->Node(CoreExtConstants::INPUTDEVICE_PREFERENCES); // Initializes the modules std::vector<IInputDeviceDescriptor::Pointer> descriptors(inputDeviceRegistry->GetInputDevices()); for (std::vector<IInputDeviceDescriptor::Pointer>::const_iterator it = descriptors.begin(); it != descriptors.end(); ++it) { if (extPreferencesNode->GetBool((*it)->GetID(), false)) { IInputDevice::Pointer temp = (*it)->CreateInputDevice(); temp->RegisterInputDevice(); } } } // end method StartInputDeviceModules