Medical Imaging Interaction Toolkit  2023.12.99-101158b3
Medical Imaging Interaction Toolkit
berry::AbstractUICTKPlugin Class Reference

#include <berryAbstractUICTKPlugin.h>

Inheritance diagram for berry::AbstractUICTKPlugin:
Collaboration diagram for berry::AbstractUICTKPlugin:

Public Member Functions

 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 QIcon ImageDescriptorFromPlugin (const QString &pluginId, const QString &imageFilePath)
 
static QIcon GetMissingIcon ()
 

Additional Inherited Members

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

Detailed Description

Abstract base class for plug-ins that integrate with the BlueBerry platform UI.

Subclasses obtain the following capabilities:

Dialogs

  • The dialog store is read the first time getDialogSettings is called.
  • The dialog store allows the plug-in to "record" important choices made by the user in a wizard or dialog, so that the next time the wizard/dialog is used the widgets can be defaulted to better values. A wizard could also use it to record the last 5 values a user entered into an editable combo - to show "recent values".
  • The dialog store is found in the file whose name is given by the constant FN_DIALOG_STORE. A dialog store file is first looked for in the plug-in's read/write state area; if not found there, the plug-in's install directory is checked. This allows a plug-in to ship with a read-only copy of a dialog store file containing initial values for certain settings.
  • Plug-in code can call saveDialogSettings to cause settings to be saved in the plug-in's read/write state area. A plug-in may opt to do this each time a wizard or dialog is closed to ensure the latest information is always safe on disk.
  • Dialog settings are also saved automatically on plug-in shutdown.

For easy access to your plug-in object, use the singleton pattern. Declare a static variable in your plug-in class for the singleton. Store the first (and only) instance of the plug-in class in the singleton when it is created. Then access the singleton when needed through a static getDefault method.

See the description on Plugin.

Definition at line 72 of file berryAbstractUICTKPlugin.h.

Constructor & Destructor Documentation

◆ AbstractUICTKPlugin()

berry::AbstractUICTKPlugin::AbstractUICTKPlugin ( )

Creates an abstract UI plug-in runtime object.

Plug-in runtime classes are ctkPluginActivators and so must have an default constructor. This method is called by the runtime when the associated bundle is being activated.

Member Function Documentation

◆ GetMissingIcon()

static QIcon berry::AbstractUICTKPlugin::GetMissingIcon ( )
static

◆ GetPreferences()

mitk::IPreferences* berry::AbstractUICTKPlugin::GetPreferences ( ) const

◆ GetPreferencesService()

mitk::IPreferencesService* berry::AbstractUICTKPlugin::GetPreferencesService ( ) const

Returns the preferences service for this UI plug-in. This preferences service is used to hold persistent settings for this plug-in in the context of a workbench. Some of these settings will be user controlled, whereas others may be internal setting that are never exposed to the user.

Returns
the preferences service

◆ GetWorkbench()

IWorkbench* berry::AbstractUICTKPlugin::GetWorkbench ( )

Returns the Platform UI workbench.

This method exists as a convenience for plugin implementors. The workbench can also be accessed by invoking PlatformUI.getWorkbench().

Returns
IWorkbench the workbench for this plug-in

◆ ImageDescriptorFromPlugin()

static QIcon berry::AbstractUICTKPlugin::ImageDescriptorFromPlugin ( const QString &  pluginId,
const QString &  imageFilePath 
)
static

Creates and returns a new image descriptor for an image file located within the specified plug-in.

This is a convenience method that simply locates the image file in within the plug-in (no image registries are involved). The path is relative to the root of the plug-in, and takes into account files coming from plug-in fragments. The path may include $arg$ elements. However, the path must not have a leading "." or path separator. Clients should use a path like "icons/mysample.gif" rather than "./icons/mysample.gif" or "/icons/mysample.gif".

Parameters
pluginIdthe id of the plug-in containing the image file; null is returned if the plug-in does not exist
imageFilePaththe relative path of the image file, relative to the root of the plug-in; the path must be legal
Returns
an image descriptor, or null if no image could be found

◆ start()

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

The AbstractUIPlugin implementation of this Plugin method refreshes the plug-in actions. Subclasses may extend this method, but must send super first.

Parameters
context

◆ stop()

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

The AbstractUIPlugin implementation of this Plugin method saves this plug-in's preference and dialog stores and shuts down its image registry (if they are in use). Subclasses may extend this method, but must send super last. A try-finally statement should be used where necessary to ensure that super.shutdown() is always done.


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