Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
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::vcl_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 ()
 
IPreferencesServiceGetPreferencesService () const
 
SmartPointer< 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.

Definition at line 78 of file berryWorkbenchPlugin.cpp.

◆ ~WorkbenchPlugin()

berry::WorkbenchPlugin::~WorkbenchPlugin ( )
override

Definition at line 89 of file berryWorkbenchPlugin.cpp.

Member Function Documentation

◆ GetBundleCount()

std::vcl_size_t berry::WorkbenchPlugin::GetBundleCount ( )

Definition at line 183 of file berryWorkbenchPlugin.cpp.

◆ GetBundleForExecutableExtension()

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.

Definition at line 127 of file berryWorkbenchPlugin.cpp.

References GetAttribute, and berry::Platform::GetPlugin().

Referenced by IsBundleLoadedForExecutableExtension().

◆ 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.

Definition at line 466 of file berryWorkbenchPlugin.cpp.

◆ GetDefault()

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.

Definition at line 178 of file berryWorkbenchPlugin.cpp.

Referenced by berry::QtWorkbenchAdvisor::Initialize(), Log(), berry::WorkbenchWindowAdvisor::OpenIntro(), QmitkNodeSelectionButton::paintEvent(), QmitkExtWorkbenchWindowAdvisor::PostWindowCreate(), and berry::QtStyleManager::QtStyleManager().

◆ 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.

Definition at line 243 of file berryWorkbenchPlugin.cpp.

◆ GetElementFactory()

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

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

Parameters
targetID
Returns
IElementFactory

Definition at line 251 of file berryWorkbenchPlugin.cpp.

References berry::IExtensionRegistry::GetExtensionPoint(), berry::Platform::GetExtensionRegistry(), berry::CoreException::GetStatus(), Log(), and berry::PlatformUI::PLUGIN_ID().

◆ GetIntroRegistry()

IIntroRegistry * berry::WorkbenchPlugin::GetIntroRegistry ( )

Returns the introduction registry.

Returns
the introduction registry.

Definition at line 226 of file berryWorkbenchPlugin.cpp.

◆ GetPerspectiveRegistry()

IPerspectiveRegistry * berry::WorkbenchPlugin::GetPerspectiveRegistry ( )

Return the perspective registry.

Returns
IPerspectiveRegistry. The registry for the receiver.

Definition at line 190 of file berryWorkbenchPlugin.cpp.

◆ GetPluginContext()

ctkPluginContext * berry::WorkbenchPlugin::GetPluginContext ( )

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

Returns
the bundle context

Definition at line 450 of file berryWorkbenchPlugin.cpp.

Referenced by berry::QtWorkbenchAdvisor::Initialize(), and QmitkNodeSelectionButton::paintEvent().

◆ GetPresentationFactory()

IPresentationFactory * berry::WorkbenchPlugin::GetPresentationFactory ( )

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

Parameters
targetIDThe id of the presentation factory to use.
Returns
IPresentationFactory or null if not factory matches that id.

Definition at line 300 of file berryWorkbenchPlugin.cpp.

References Log().

◆ GetViewRegistry()

IViewRegistry * berry::WorkbenchPlugin::GetViewRegistry ( )

Answer the view registry.

Returns
IViewRegistry the view registry for the receiver.

Definition at line 235 of file berryWorkbenchPlugin.cpp.

◆ HasExecutableExtension()

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

Definition at line 100 of file berryWorkbenchPlugin.cpp.

References GetAttribute.

◆ IsBundleLoadedForExecutableExtension()

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.

Definition at line 117 of file berryWorkbenchPlugin.cpp.

References GetBundleForExecutableExtension().

◆ Log() [1/6]

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.

Definition at line 314 of file berryWorkbenchPlugin.cpp.

References BERRY_INFO.

Referenced by berry::CommandContributionItem::CommandContributionItem(), GetElementFactory(), berry::XMLMemento::GetFloat(), berry::XMLMemento::GetInteger(), GetPresentationFactory(), Log(), and berry::CommandContributionItem::UpdateCommandPropertiesInUI().

◆ Log() [2/6]

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

Log the throwable.

Parameters
t

Definition at line 320 of file berryWorkbenchPlugin.cpp.

References BERRY_INFO.

◆ Log() [3/6]

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.

Definition at line 330 of file berryWorkbenchPlugin.cpp.

References Log().

◆ Log() [4/6]

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.

Definition at line 336 of file berryWorkbenchPlugin.cpp.

References Log().

◆ Log() [5/6]

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.

Definition at line 345 of file berryWorkbenchPlugin.cpp.

References BERRY_STATUS_LOC, berry::IStatus::ERROR_TYPE, GetDefault(), berry::Plugin::GetLog(), and berry::ILog::Log().

◆ Log() [6/6]

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

Log the status to the default log.

Parameters
status

Definition at line 357 of file berryWorkbenchPlugin.cpp.

References GetDefault(), berry::Plugin::GetLog(), and berry::ILog::Log().

◆ start()

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

◆ stop()

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

Definition at line 455 of file berryWorkbenchPlugin.cpp.

References berry::AbstractUICTKPlugin::stop().

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 files: