Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::Platform Class Reference

#include <berryPlatform.h>

Static Public Member Functions

static IAdapterManagerGetAdapterManager ()
 
static IExtensionRegistryGetExtensionRegistry ()
 
static IPreferencesServiceGetPreferencesService ()
 
static SmartPointer< IProductGetProduct ()
 
static QVariant GetDebugOption (const QString &option)
 
static QT_DEPRECATED QDir GetConfigurationPath ()
 
static ctkLocation * GetConfigurationLocation ()
 
static QT_DEPRECATED QDir GetInstallPath ()
 
static ctkLocation * GetInstallLocation ()
 
static QT_DEPRECATED QDir GetInstancePath ()
 
static ctkLocation * GetInstanceLocation ()
 
static QT_DEPRECATED bool GetStatePath (QDir &statePath, const QSharedPointer< ctkPlugin > &plugin, bool create=true)
 
static QDir GetStateLocation (const QSharedPointer< ctkPlugin > &plugin)
 
static QT_DEPRECATED QDir GetUserPath ()
 
static ctkLocation * GetUserLocation ()
 
static int GetOS ()
 
static int GetOSArch ()
 
static bool IsUnix ()
 
static bool IsWindows ()
 
static bool IsBSD ()
 
static bool IsLinux ()
 
static bool IsVMS ()
 
static bool IsRunning ()
 
static QStringList GetApplicationArgs ()
 
static QSharedPointer< ctkPlugin > GetPlugin (const QString &symbolicName)
 
static QList< QSharedPointer< ctkPlugin > > GetPlugins (const QString &symbolicName, const QString &version=QString())
 

Static Public Attributes

static const QString PI_RUNTIME
 
static const int OS_FREE_BSD
 
static const int OS_AIX
 
static const int OS_HPUX
 
static const int OS_TRU64
 
static const int OS_LINUX
 
static const int OS_MAC_OS_X
 
static const int OS_NET_BSD
 
static const int OS_OPEN_BSD
 
static const int OS_IRIX
 
static const int OS_SOLARIS
 
static const int OS_QNX
 
static const int OS_VXWORKS
 
static const int OS_CYGWIN
 
static const int OS_UNKNOWN_UNIX
 
static const int OS_WINDOWS_NT
 
static const int OS_WINDOWS_CE
 
static const int OS_VMS
 
static const int ARCH_ALPHA
 
static const int ARCH_IA32
 
static const int ARCH_IA64
 
static const int ARCH_MIPS
 
static const int ARCH_HPPA
 
static const int ARCH_PPC
 
static const int ARCH_POWER
 
static const int ARCH_SPARC
 
static const int ARCH_AMD64
 
static const int ARCH_ARM
 
static const QString PROP_QTPLUGIN_PATH
 
static const QString PROP_NEWINSTANCE
 
static const QString PROP_PLUGIN_DIRS
 
static const QString PROP_FORCE_PLUGIN_INSTALL
 
static const QString PROP_APPLICATION
 
static const QString PROP_IGNOREAPP
 
static const QString PROP_TESTPLUGIN
 
static const QString PROP_TESTAPPLICATION
 
static const QString PROP_XARGS
 

Detailed Description

The central class of the BlueBerry Platform Runtime. This class cannot be instantiated or subclassed by clients; all functionality is provided by static methods. Features include:

  • the platform registry of installed plug-ins
  • the platform adapter manager
  • the platform log

Most users don't have to worry about Platform's lifecycle. However, if your code can call methods of this class when Platform is not running, it becomes necessary to check IsRunning() before making the call. A runtime exception might be thrown or incorrect result might be returned if a method from this class is called while Platform is not running.

Definition at line 202 of file berryPlatform.h.

Member Function Documentation

IAdapterManager * berry::Platform::GetAdapterManager ( )
static

Returns the adapter manager used for extending IAdaptable objects.

Returns
the adapter manager for this platform
See also
IAdapterManager

Definition at line 90 of file berryPlatform.cpp.

Referenced by mitk::DataStorageEditorInput::GetAdapter(), and berry::PlatformObject::GetAdapter().

QStringList berry::Platform::GetApplicationArgs ( )
static

Returns the applications command line arguments which have not been consumed by the platform.

Definition at line 228 of file berryPlatform.cpp.

ctkLocation * berry::Platform::GetConfigurationLocation ( )
static

Returns the location of the configuration information used to run this instance of BlueBerry. The configuration area typically contains the list of plug-ins available for use, various settings (those shared across different instances of the same configuration) and any other such data needed by plug-ins. null is returned if the platform is running without a configuration location.

This method is equivalent to acquiring the org.commontk.service.datalocation.Location service with the property "type" equal to ctkLocation::CONFIGURATION_FILTER.

Returns
the location of the platform's configuration data area or null if none
See also
ctkLocation::CONFIGURATION_FILTER

Definition at line 85 of file berryPlatform.cpp.

Referenced by GetConfigurationPath().

QDir berry::Platform::GetConfigurationPath ( )
static

Returns the path of the configuration information used to run this instance of the BlueBerry platform. The configuration area typically contains the list of plug-ins available for use, various settings (those shared across different instances of the same configuration) and any other such data needed by plug-ins. An empty path is returned if the platform is running without a configuration location.

Returns
the location of the platform's configuration data area
Deprecated:
(as of 2015_05) Use GetConfigurationLocation() instead.

Definition at line 75 of file berryPlatform.cpp.

References GetConfigurationLocation().

QVariant berry::Platform::GetDebugOption ( const QString &  option)
static

Returns the identified option. A null QString is returned if no such option is found. Options are specified in the general form <plug-in id>/<option-path>. For example, org.blueberry.core.runtime/debug

Clients are also able to acquire the DebugOptions service and query it for debug options.

Parameters
optionthe name of the option to lookup
Returns
the value of the requested debug option or QString::null

Definition at line 244 of file berryPlatform.cpp.

IExtensionRegistry * berry::Platform::GetExtensionRegistry ( )
static

Returns the extension registry for this platform. May return null if the registry has not been created yet.

Returns
existing extension registry or null
See also
IExtensionRegistry

Definition at line 95 of file berryPlatform.cpp.

Referenced by QmitkDataManagerView::CreateQtPartControl(), and berry::ExtensionTracker::ExtensionTracker().

ctkLocation * berry::Platform::GetInstallLocation ( )
static

Returns the location of the base installation for the running platform null is returned if the platform is running without a configuration location.

This method is equivalent to acquiring the org.commontk.service.datalocation.Location service with the property "type" equal to ctkLocation::INSTALL_FILTER.

Returns
the location of the platform's installation area or null if none
See also
ctkLocation::INSTALL_FILTER

Definition at line 120 of file berryPlatform.cpp.

Referenced by GetInstallPath().

QDir berry::Platform::GetInstallPath ( )
static

Returns the path of the base installation for the running platform

Returns
the location of the platform's installation area or null if none
Deprecated:
(as of 2015_05) Use GetInstallLocation() instead.

Definition at line 110 of file berryPlatform.cpp.

References GetInstallLocation().

ctkLocation * berry::Platform::GetInstanceLocation ( )
static

Returns the location of the platform's working directory (also known as the instance data area). null is returned if the platform is running without an instance location.

This method is equivalent to acquiring the org.commontk.service.datalocation.Location service with the property "type" equal to ctkLocation::INSTANCE_FILTER.

Returns
the location of the platform's instance data area or null if none
See also
ctkLocation::INSTANCE_FILTER

Definition at line 136 of file berryPlatform.cpp.

Referenced by GetInstancePath().

QDir berry::Platform::GetInstancePath ( )
static

Returns the path of the platform's working directory (also known as the instance data area). An empty path is returned if the platform is running without an instance location.

Returns
the location of the platform's instance data area or null if none
Deprecated:
(as of 2015_05) Use GetInstanceLocation() instead.

Definition at line 125 of file berryPlatform.cpp.

References GetInstanceLocation().

int berry::Platform::GetOS ( )
static

Definition at line 141 of file berryPlatform.cpp.

int berry::Platform::GetOSArch ( )
static

Definition at line 146 of file berryPlatform.cpp.

QSharedPointer< ctkPlugin > berry::Platform::GetPlugin ( const QString &  symbolicName)
static

Returns the resolved plug-in with the specified symbolic name that has the highest version. If no resolved plug-ins are installed that have the specified symbolic name then null is returned.

Note that clients may want to filter the results based on the state of the plug-ins.

Parameters
symbolicNamethe symbolic name of the plug-in to be returned.
Returns
the plug-in that has the specified symbolic name with the highest version, or null if no plug-in is found.

Definition at line 233 of file berryPlatform.cpp.

Referenced by berry::PropertyTester::IsDeclaringPluginActive().

QList< QSharedPointer< ctkPlugin > > berry::Platform::GetPlugins ( const QString &  symbolicName,
const QString &  version = QString() 
)
static

Returns all plug-ins with the specified symbolic name. If no resolved plug-ins with the specified symbolic name can be found, an empty list is returned. If the version argument is not null then only the plug-ins that have the specified symbolic name and a version greater than or equal to the specified version are returned. The returned plug-ins are ordered in descending plug-in version order.

Note that clients may want to filter the results based on the state of the plug-ins.

Parameters
symbolicNamethe symbolic name of the plug-ins that are to be returned.
versionthe version that the returned plug-in versions must match, or QString() if no version matching is to be done.
Returns
the list of plug-ins with the specified name that match the specified version and match rule, or null if no plug-ins are found.

Definition at line 238 of file berryPlatform.cpp.

IPreferencesService * berry::Platform::GetPreferencesService ( )
static

Return the interface into the preference mechanism. The returned object can be used for such operations as searching for preference values across multiple scopes and preference import/export.

Clients are also able to acquire the IPreferencesService service via CTK mechanisms and use it for preference functions.

Returns
an object to interface into the preference mechanism

Definition at line 100 of file berryPlatform.cpp.

Referenced by QmitkDataManagerPreferencePage::CreateQtControl(), QmitkSegmentationPreferencePage::CreateQtControl(), QmitkMultiLabelSegmentationPreferencePage::CreateQtControl(), QmitkDataManagerView::CreateQtPartControl(), QmitkFunctionality::GetPreferences(), mitk::GetSimulationPreferences(), mitk::WorkbenchUtil::LoadFiles(), QmitkPreferencesDialog::OnExportButtonClicked(), QmitkPreferencesDialog::OnImportButtonClicked(), QmitkExtWorkbenchWindowAdvisor::PostWindowCreate(), and QmitkPreferencesDialog::SavePreferences().

IProduct::Pointer berry::Platform::GetProduct ( )
static

Returns the product which was selected when running this BlueBerry instance or null if none

Returns
the current product or null if none

Definition at line 249 of file berryPlatform.cpp.

QDir berry::Platform::GetStateLocation ( const QSharedPointer< ctkPlugin > &  plugin)
static

Returns the location in the local file system of the plug-in state area for the given plug-in. If the plug-in state area did not exist prior to this call, it is created.

The plug-in state area is a file directory within the platform's metadata area where a plug-in is free to create files. The content and structure of this area is defined by the plug-in, and the particular plug-in is solely responsible for any files it puts there. It is recommended for plug-in preference settings and other configuration parameters.

Parameters
pluginthe plugin whose state location if returned
Returns
a local file system path
Exceptions
ctkIllegalStateExceptionif no instance location was specified
RuntimeExceptionif the plug-in state area could not be created.

Definition at line 202 of file berryPlatform.cpp.

Referenced by GetStatePath().

bool berry::Platform::GetStatePath ( QDir &  statePath,
const QSharedPointer< ctkPlugin > &  plugin,
bool  create = true 
)
static

Returns the path in the local file system of the plug-in state area for the given plug-in. If the plug-in state area did not exist prior to this call, it is created.

The plug-in state area is a file directory within the platform's metadata area where a plug-in is free to create files. The content and structure of this area is defined by the plug-in, and the particular plug-in is solely responsible for any files it puts there. It is recommended for plug-in preference settings and other configuration parameters.

Parameters
pluginthe plug-in whose state location is returned
Returns
a local file system path TODO Investigate the usage of a service factory
Deprecated:
(as of 2015_05) Use GetStateLocation instead.

Definition at line 196 of file berryPlatform.cpp.

References GetStateLocation().

ctkLocation * berry::Platform::GetUserLocation ( )
static

Returns the location of the platform's user data area. The user data area is a location on the system which is specific to the system's current user. By default it is located relative to the location given by the system property "user.home". null is returned if the platform is running without an user location.

This method is equivalent to acquiring the org.commontk.service.datalocation.Location service with the property "type" equal to ctkLocation::USER_FILTER.

Returns
the location of the platform's user data area or null if none
See also
ctkLocation::USER_FILTER

Definition at line 218 of file berryPlatform.cpp.

Referenced by GetUserPath().

QDir berry::Platform::GetUserPath ( )
static

Returns the path of the platform's user data area. The user data area is a location on the system which is specific to the system's current user. By default it is located relative to the location given by the System property "user.home". An empty path is returned if the platform is running without an user location.

Returns
the location of the platform's user data area or null if none
Deprecated:
(as of 2015_05) Use GetUserLocation() instead.

Definition at line 207 of file berryPlatform.cpp.

References GetUserLocation().

bool berry::Platform::IsBSD ( )
static

Definition at line 169 of file berryPlatform.cpp.

bool berry::Platform::IsLinux ( )
static

Definition at line 178 of file berryPlatform.cpp.

bool berry::Platform::IsRunning ( )
static

Definition at line 223 of file berryPlatform.cpp.

bool berry::Platform::IsUnix ( )
static

Definition at line 151 of file berryPlatform.cpp.

bool berry::Platform::IsVMS ( )
static

Definition at line 187 of file berryPlatform.cpp.

bool berry::Platform::IsWindows ( )
static

Definition at line 160 of file berryPlatform.cpp.

Member Data Documentation

const int berry::Platform::ARCH_ALPHA
static

Definition at line 226 of file berryPlatform.h.

const int berry::Platform::ARCH_AMD64
static

Definition at line 234 of file berryPlatform.h.

const int berry::Platform::ARCH_ARM
static

Definition at line 235 of file berryPlatform.h.

const int berry::Platform::ARCH_HPPA
static

Definition at line 230 of file berryPlatform.h.

const int berry::Platform::ARCH_IA32
static

Definition at line 227 of file berryPlatform.h.

const int berry::Platform::ARCH_IA64
static

Definition at line 228 of file berryPlatform.h.

const int berry::Platform::ARCH_MIPS
static

Definition at line 229 of file berryPlatform.h.

const int berry::Platform::ARCH_POWER
static

Definition at line 232 of file berryPlatform.h.

const int berry::Platform::ARCH_PPC
static

Definition at line 231 of file berryPlatform.h.

const int berry::Platform::ARCH_SPARC
static

Definition at line 233 of file berryPlatform.h.

const int berry::Platform::OS_AIX
static

Definition at line 209 of file berryPlatform.h.

const int berry::Platform::OS_CYGWIN
static

Definition at line 220 of file berryPlatform.h.

const int berry::Platform::OS_FREE_BSD
static

Definition at line 208 of file berryPlatform.h.

const int berry::Platform::OS_HPUX
static

Definition at line 210 of file berryPlatform.h.

const int berry::Platform::OS_IRIX
static

Definition at line 216 of file berryPlatform.h.

const int berry::Platform::OS_LINUX
static

Definition at line 212 of file berryPlatform.h.

const int berry::Platform::OS_MAC_OS_X
static

Definition at line 213 of file berryPlatform.h.

const int berry::Platform::OS_NET_BSD
static

Definition at line 214 of file berryPlatform.h.

const int berry::Platform::OS_OPEN_BSD
static

Definition at line 215 of file berryPlatform.h.

const int berry::Platform::OS_QNX
static

Definition at line 218 of file berryPlatform.h.

const int berry::Platform::OS_SOLARIS
static

Definition at line 217 of file berryPlatform.h.

const int berry::Platform::OS_TRU64
static

Definition at line 211 of file berryPlatform.h.

const int berry::Platform::OS_UNKNOWN_UNIX
static

Definition at line 221 of file berryPlatform.h.

const int berry::Platform::OS_VMS
static

Definition at line 224 of file berryPlatform.h.

const int berry::Platform::OS_VXWORKS
static

Definition at line 219 of file berryPlatform.h.

const int berry::Platform::OS_WINDOWS_CE
static

Definition at line 223 of file berryPlatform.h.

const int berry::Platform::OS_WINDOWS_NT
static

Definition at line 222 of file berryPlatform.h.

const QString berry::Platform::PI_RUNTIME
static

Definition at line 206 of file berryPlatform.h.

const QString berry::Platform::PROP_APPLICATION
static

Definition at line 243 of file berryPlatform.h.

const QString berry::Platform::PROP_FORCE_PLUGIN_INSTALL
static

Definition at line 241 of file berryPlatform.h.

const QString berry::Platform::PROP_IGNOREAPP
static

Definition at line 244 of file berryPlatform.h.

const QString berry::Platform::PROP_NEWINSTANCE
static

Definition at line 239 of file berryPlatform.h.

const QString berry::Platform::PROP_PLUGIN_DIRS
static

Definition at line 240 of file berryPlatform.h.

const QString berry::Platform::PROP_QTPLUGIN_PATH
static

Definition at line 237 of file berryPlatform.h.

const QString berry::Platform::PROP_TESTAPPLICATION
static

Definition at line 247 of file berryPlatform.h.

const QString berry::Platform::PROP_TESTPLUGIN
static

Definition at line 246 of file berryPlatform.h.

const QString berry::Platform::PROP_XARGS
static

Definition at line 249 of file berryPlatform.h.


The documentation for this class was generated from the following files: