Medical Imaging Interaction Toolkit  2023.12.99-b884b24c
Medical Imaging Interaction Toolkit
berry::WorkbenchPlugin Class Reference

#include <berryWorkbenchPlugin.h>

Inheritance diagram for berry::WorkbenchPlugin:
Collaboration diagram for berry::WorkbenchPlugin:

Public Member Functions

 WorkbenchPlugin ()
 
 ~WorkbenchPlugin () override
 
std::size_t GetBundleCount ()
 
IEditorRegistryGetEditorRegistry ()
 
IElementFactoryGetElementFactory (const QString &targetID) const
 
IPresentationFactoryGetPresentationFactory ()
 
IPerspectiveRegistryGetPerspectiveRegistry ()
 
IIntroRegistry * GetIntroRegistry ()
 
IViewRegistryGetViewRegistry ()
 
void start (ctkPluginContext *context) override
 
ctkPluginContext * GetPluginContext ()
 
void stop (ctkPluginContext *context) override
 
QString GetDataLocation () const
 
- Public Member Functions inherited from berry::AbstractUICTKPlugin
 AbstractUICTKPlugin ()
 
mitk::IPreferencesServiceGetPreferencesService () const
 
mitk::IPreferencesGetPreferences () const
 
IWorkbenchGetWorkbench ()
 
void start (ctkPluginContext *context) override
 
void stop (ctkPluginContext *context) override
 
- Public Member Functions inherited from berry::Plugin
 Plugin ()
 
void start (ctkPluginContext *context) override
 
void stop (ctkPluginContext *context) override
 
QSharedPointer< ctkPlugin > GetPlugin () const
 
ILogGetLog () const
 
QString GetStateLocation () const
 

Static Public Member Functions

static bool HasExecutableExtension (const IConfigurationElement::Pointer &element, const QString &extensionName)
 
static bool IsBundleLoadedForExecutableExtension (const IConfigurationElement::Pointer &element, const QString &extensionName)
 
static QSharedPointer< ctkPlugin > GetBundleForExecutableExtension (const IConfigurationElement::Pointer &element, const QString &extensionName)
 
static WorkbenchPluginGetDefault ()
 
static void Log (const QString &message)
 
static void Log (const ctkException &exc)
 
static void Log (const QString &message, const ctkException &t)
 
static void Log (const QString &clazz, const QString &methodName, const ctkException &t)
 
static void Log (const QString &message, const SmartPointer< IStatus > &status)
 
static void Log (const SmartPointer< IStatus > &status)
 
- Static Public Member Functions inherited from berry::AbstractUICTKPlugin
static QIcon ImageDescriptorFromPlugin (const QString &pluginId, const QString &imageFilePath)
 
static QIcon GetMissingIcon ()
 

Static Public Attributes

static bool DEBUG
 
static char PREFERENCE_PAGE_CATEGORY_SEPARATOR
 

Additional Inherited Members

- Protected Attributes inherited from berry::Plugin
ctkPluginContext * m_Context
 

Detailed Description

This class represents the TOP of the workbench UI world A plugin class is effectively an application wrapper for a plugin & its classes. This class should be thought of as the workbench UI's application class.

This class is responsible for tracking various registries font, preference, graphics, dialog store.

This class is explicitly referenced by the workbench plugin's "plugin.xml" and places it into the UI start extension point of the main overall application harness

When is this class started? When the Application calls createExecutableExtension to create an executable instance of our workbench class.

Definition at line 58 of file berryWorkbenchPlugin.h.

Constructor & Destructor Documentation

◆ WorkbenchPlugin()

berry::WorkbenchPlugin::WorkbenchPlugin ( )

Create an instance of the WorkbenchPlugin. The workbench plugin is effectively the "application" for the workbench UI. The entire UI operates as a good plugin citizen.

◆ ~WorkbenchPlugin()

berry::WorkbenchPlugin::~WorkbenchPlugin ( )
override

Member Function Documentation

◆ GetBundleCount()

std::size_t berry::WorkbenchPlugin::GetBundleCount ( )

◆ GetBundleForExecutableExtension()

static QSharedPointer<ctkPlugin> berry::WorkbenchPlugin::GetBundleForExecutableExtension ( const IConfigurationElement::Pointer element,
const QString &  extensionName 
)
static

Returns the bundle that contains the class referenced by an executable extension. Determining the bundle happens in one of two ways:

  • The element has an attribute with the specified name or element text in the form bundle.id/class.name[:optional attributes]
  • The element has a child element with the specified name that has a plugin attribute
Parameters
elementthe element to test
extensionNamethe name of the extension to test for
Returns
the bundle referenced by the extension. If that bundle cannot be determined the bundle that declared the element is returned. Note that this may be null.

◆ GetDataLocation()

QString berry::WorkbenchPlugin::GetDataLocation ( ) const

FOR INTERNAL WORKBENCH USE ONLY.

Returns the path to a location in the file system that can be used to persist/restore state between workbench invocations. If the location did not exist prior to this call it will be created. Returns null if no such location is available.

Returns
path to a location in the file system where this plug-in can persist data between sessions, or null if no such location is available.

◆ GetDefault()

static WorkbenchPlugin* berry::WorkbenchPlugin::GetDefault ( )
static

Return the default instance of the receiver. This represents the runtime plugin.

Returns
WorkbenchPlugin
See also
AbstractUICTKPlugin for the typical implementation pattern for plugin classes.

◆ GetEditorRegistry()

IEditorRegistry* berry::WorkbenchPlugin::GetEditorRegistry ( )

Answer the manager that maps resource types to a the description of the editor to use

Returns
IEditorRegistry the editor registry used by this plug-in.

◆ GetElementFactory()

IElementFactory* berry::WorkbenchPlugin::GetElementFactory ( const QString &  targetID) const

Answer the element factory for an id, or null. if not found.

Parameters
targetID
Returns
IElementFactory

◆ GetIntroRegistry()

IIntroRegistry* berry::WorkbenchPlugin::GetIntroRegistry ( )

Returns the introduction registry.

Returns
the introduction registry.

◆ GetPerspectiveRegistry()

IPerspectiveRegistry* berry::WorkbenchPlugin::GetPerspectiveRegistry ( )

Return the perspective registry.

Returns
IPerspectiveRegistry. The registry for the receiver.

◆ GetPluginContext()

ctkPluginContext* berry::WorkbenchPlugin::GetPluginContext ( )

Returns the bundle context associated with the workbench plug-in.

Returns
the bundle context

◆ GetPresentationFactory()

IPresentationFactory* berry::WorkbenchPlugin::GetPresentationFactory ( )

Returns the presentation factory with the given id, or null if not found.

Returns
IPresentationFactory or null if not factory matches that id.

◆ GetViewRegistry()

IViewRegistry* berry::WorkbenchPlugin::GetViewRegistry ( )

Answer the view registry.

Returns
IViewRegistry the view registry for the receiver.

◆ HasExecutableExtension()

static bool berry::WorkbenchPlugin::HasExecutableExtension ( const IConfigurationElement::Pointer element,
const QString &  extensionName 
)
static

Answers whether the provided element either has an attribute with the given name or a child element with the given name with an attribute called class.

Parameters
elementthe element to test
extensionNamethe name of the extension to test for
Returns
whether or not the extension is declared

◆ IsBundleLoadedForExecutableExtension()

static bool berry::WorkbenchPlugin::IsBundleLoadedForExecutableExtension ( const IConfigurationElement::Pointer element,
const QString &  extensionName 
)
static

Checks to see if the provided element has the syntax for an executable extension with a given name that resides in a bundle that is already active. Determining the bundle happens in one of two ways:

  • The element has an attribute with the specified name or element text in the form bundle.id/class.name[:optional attributes]
  • The element has a child element with the specified name that has a plugin attribute
Parameters
elementthe element to test
extensionNamethe name of the extension to test for
Returns
whether or not the bundle expressed by the above criteria is active. If the bundle cannot be determined then the state of the bundle that declared the element is returned.

◆ Log() [1/6]

static void berry::WorkbenchPlugin::Log ( const ctkException &  exc)
static

Log the throwable.

Parameters
exc

◆ Log() [2/6]

static void berry::WorkbenchPlugin::Log ( const QString &  clazz,
const QString &  methodName,
const ctkException &  t 
)
static

Logs the given throwable to the platform log, indicating the class and method from where it is being logged (this is not necessarily where it occurred).

This convenience method is for internal use by the Workbench only and must not be called outside the Workbench.

Parameters
clazzThe calling class.
methodNameThe calling method name.
tThe throwable from where the problem actually occurred.

◆ Log() [3/6]

static void berry::WorkbenchPlugin::Log ( const QString &  message)
static

Logs the given message to the platform log.

If you have an exception in hand, call log(String, Throwable) instead.

If you have a status object in hand call log(String, IStatus) instead.

This convenience method is for internal use by the Workbench only and must not be called outside the Workbench.

Parameters
messageA high level UI message describing when the problem happened.

◆ Log() [4/6]

static void berry::WorkbenchPlugin::Log ( const QString &  message,
const ctkException &  t 
)
static

Logs the given message and throwable to the platform log.

If you have a status object in hand call log(String, IStatus) instead.

This convenience method is for internal use by the Workbench only and must not be called outside the Workbench.

Parameters
messageA high level UI message describing when the problem happened.
tThe throwable from where the problem actually occurred.

◆ Log() [5/6]

static void berry::WorkbenchPlugin::Log ( const QString &  message,
const SmartPointer< IStatus > &  status 
)
static

Logs the given message and status to the platform log.

This convenience method is for internal use by the Workbench only and must not be called outside the Workbench.

Parameters
messageA high level UI message describing when the problem happened. May be null.
statusThe status describing the problem. Must not be null.

◆ Log() [6/6]

static void berry::WorkbenchPlugin::Log ( const SmartPointer< IStatus > &  status)
static

Log the status to the default log.

Parameters
status

◆ start()

void berry::WorkbenchPlugin::start ( ctkPluginContext *  context)
override

◆ stop()

void berry::WorkbenchPlugin::stop ( ctkPluginContext *  context)
override

Member Data Documentation

◆ DEBUG

bool berry::WorkbenchPlugin::DEBUG
static

Global workbench ui plugin flag. Only workbench implementation is allowed to use this flag All other plugins, examples, or test cases must not use this flag.

Definition at line 101 of file berryWorkbenchPlugin.h.

◆ PREFERENCE_PAGE_CATEGORY_SEPARATOR

char berry::WorkbenchPlugin::PREFERENCE_PAGE_CATEGORY_SEPARATOR
static

The character used to separate preference page category ids

Definition at line 106 of file berryWorkbenchPlugin.h.


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