Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
berry::WorkbenchPart Class Referenceabstract

#include <berryWorkbenchPart.h>

Inheritance diagram for berry::WorkbenchPart:
Collaboration diagram for berry::WorkbenchPart:

Public Member Functions

 berryObjectMacro (WorkbenchPart, QObject, IWorkbenchPart, IExecutableExtension)
 
 ~WorkbenchPart () override
 
void AddPropertyListener (IPropertyChangeListener *l) override
 
void RemovePropertyListener (IPropertyChangeListener *l) override
 
void SetPartProperty (const QString &key, const QString &value) override
 
QString GetPartProperty (const QString &key) const override
 
const QHash< QString, QString > & GetPartProperties () const override
 
void SetInitializationData (const IConfigurationElement::Pointer &cfig, const QString &propertyName, const Object::Pointer &data) override
 
void CreatePartControl (QWidget *parent) override=0
 
void SetFocus () override=0
 
IWorkbenchPartSite::Pointer GetSite () const override
 
QString GetPartName () const override
 
QString GetContentDescription () const override
 
QIcon GetTitleImage () const override
 
QString GetTitleToolTip () const override
 
- Public Member Functions inherited from berry::IWorkbenchPart
 berryObjectMacro (berry::IWorkbenchPart, Object)
 
 ~IWorkbenchPart () override
 
- Public Member Functions inherited from berry::Object
virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual QString ToString () const
 
virtual uint HashCode () const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
virtual bool operator== (const Object *) const
 
- Public Member Functions inherited from berry::IExecutableExtension
virtual ~IExecutableExtension ()
 
virtual void SetInitializationData (const SmartPointer< IConfigurationElement > &config, const QString &propertyName, const Object::Pointer &data)=0
 

Protected Member Functions

 WorkbenchPart ()
 
IConfigurationElement::Pointer GetConfigurationElement () const
 
void SetSite (IWorkbenchPartSite::Pointer site)
 
virtual void CheckSite (IWorkbenchPartSite::Pointer site)
 
virtual void SetTitleImage (const QIcon &titleImage)
 
virtual void SetTitleToolTip (const QString &toolTip)
 
virtual void SetPartName (const QString &partName)
 
virtual void SetContentDescription (const QString &description)
 
void FirePropertyChanged (const QString &key, const QString &oldValue, const QString &newValue)
 
void FirePropertyChange (int propertyId)
 
- Protected Member Functions inherited from berry::Object
 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 

Additional Inherited Members

- Public Types inherited from berry::Object
typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

Abstract base implementation of all workbench parts.

This class is not intended to be subclassed by clients outside this package; clients should instead subclass ViewPart or EditorPart.

See also
org.blueberry.ui.part.ViewPart
org.blueberry.ui.part.EditorPart

Definition at line 40 of file berryWorkbenchPart.h.

Constructor & Destructor Documentation

◆ ~WorkbenchPart()

berry::WorkbenchPart::~WorkbenchPart ( )
override

◆ WorkbenchPart()

berry::WorkbenchPart::WorkbenchPart ( )
protected

Member Function Documentation

◆ AddPropertyListener()

void berry::WorkbenchPart::AddPropertyListener ( IPropertyChangeListener listener)
overridevirtual

The property id for getTitle, getTitleImage and getTitleToolTip. Adds a listener for changes to properties of this workbench part. Has no effect if an identical listener is already registered.

The property ids are defined in IWorkbenchPartConstants.

Parameters
listenera property listener

Implements berry::IWorkbenchPart.

◆ berryObjectMacro()

berry::WorkbenchPart::berryObjectMacro ( WorkbenchPart  ,
QObject  ,
IWorkbenchPart  ,
IExecutableExtension   
)

◆ CheckSite()

virtual void berry::WorkbenchPart::CheckSite ( IWorkbenchPartSite::Pointer  site)
protectedvirtual

Checks that the given site is valid for this type of part. The default implementation does nothing.

Parameters
sitethe site to check

Reimplemented in berry::EditorPart, and berry::ViewPart.

◆ CreatePartControl()

void berry::WorkbenchPart::CreatePartControl ( QWidget *  parent)
overridepure virtual

Creates the controls for this workbench part.

Clients should not call this method (the workbench calls this method when it needs to, which may be never).

For implementors this is a multi-step process:

  1. Create one or more controls within the parent.
  2. Set the parent layout as needed.
  3. Register any global actions with the site's IActionBars.
  4. Register any context menus with the site.
  5. Register a selection provider with the site, to make it available to the workbench's ISelectionService (optional).
Parameters
parentthe parent control

Implements berry::IWorkbenchPart.

Implemented in berry::QtViewPart, and berry::QtEditorPart.

◆ FirePropertyChange()

void berry::WorkbenchPart::FirePropertyChange ( int  propertyId)
protected

◆ FirePropertyChanged()

void berry::WorkbenchPart::FirePropertyChanged ( const QString &  key,
const QString &  oldValue,
const QString &  newValue 
)
protected

◆ GetConfigurationElement()

IConfigurationElement::Pointer berry::WorkbenchPart::GetConfigurationElement ( ) const
inlineprotected

Returns the configuration element for this part. The configuration element comes from the plug-in registry entry for the extension defining this part.

Returns
the configuration element for this part

Definition at line 76 of file berryWorkbenchPart.h.

◆ GetContentDescription()

QString berry::WorkbenchPart::GetContentDescription ( ) const
overridevirtual

Returns the content description of this part. The content description is an optional user-readable string that describes what is currently being displayed in the part. By default, the workbench will display the content description in a line near the top of the view or editor. An empty string indicates no content description text. If this value changes the part must fire a property listener event with IWorkbenchPartConstants#PROP_CONTENT_DESCRIPTION.

Returns
the content description of this part (not null)

It is considered bad practice to overload or extend this method. Parts should call setContentDescription to change their content description.

Implements berry::IWorkbenchPart.

◆ GetPartName()

QString berry::WorkbenchPart::GetPartName ( ) const
overridevirtual

Returns the name of this part. If this value changes the part must fire a property listener event with IWorkbenchPartConstants#PROP_PART_NAME.

Returns
the name of this view, or the empty string if the name is being managed by the workbench (not null)

It is considered bad practice to overload or extend this method. Parts should call setPartName to change their part name.

Implements berry::IWorkbenchPart.

◆ GetPartProperties()

const QHash<QString, QString>& berry::WorkbenchPart::GetPartProperties ( ) const
overridevirtual

Return an unmodifiable map of the arbitrary properties. This method can be used to save the properties during workbench save/restore.

Returns
A Map of the properties. Must not be null.

Implements berry::IWorkbenchPart.

◆ GetPartProperty()

QString berry::WorkbenchPart::GetPartProperty ( const QString &  key) const
overridevirtual

Return the value for the arbitrary property key, or null.

Parameters
keythe arbitrary property. Must not be null.
Returns
the property value, or null.

Implements berry::IWorkbenchPart.

◆ GetSite()

IWorkbenchPartSite::Pointer berry::WorkbenchPart::GetSite ( ) const
overridevirtual

Returns the site for this workbench part. The site can be null while the workbench part is being initialized. After the initialization is complete, this value must be non-null for the remainder of the part's life cycle.

Returns
The part site; this value may be null if the part has not yet been initialized

Implements berry::IWorkbenchPart.

◆ GetTitleImage()

QIcon berry::WorkbenchPart::GetTitleImage ( ) const
overridevirtual

Returns the title image of this workbench part. If this value changes the part must fire a property listener event with PROP_TITLE.

The title image is usually used to populate the title bar of this part's visual container. Since this image is managed by the part itself, callers must not dispose the returned image.

Returns
the title image

Implements berry::IWorkbenchPart.

◆ GetTitleToolTip()

QString berry::WorkbenchPart::GetTitleToolTip ( ) const
overridevirtual

Returns the title tool tip text of this workbench part. An empty string result indicates no tool tip. If this value changes the part must fire a property listener event with PROP_TITLE.

The tool tip text is used to populate the title bar of this part's visual container.

Returns
the workbench part title tool tip (not null)

Implements berry::IWorkbenchPart.

◆ RemovePropertyListener()

void berry::WorkbenchPart::RemovePropertyListener ( IPropertyChangeListener listener)
overridevirtual

Removes the given property listener from this workbench part. Has no affect if an identical listener is not registered.

Parameters
listenera property listener

Implements berry::IWorkbenchPart.

◆ SetContentDescription()

virtual void berry::WorkbenchPart::SetContentDescription ( const QString &  description)
protectedvirtual

Sets the content description for this part. The content description is typically a short string describing the current contents of the part. Setting this to the empty string will cause a default content description to be used. Clients should call this method instead of overriding getContentDescription(). For views, the content description is shown (by default) in a line near the top of the view. For editors, the content description is shown beside the part name when showing a list of editors. If the editor is open on a file, this typically contains the path to the input file, without the filename or trailing slash.

Parameters
descriptionthe content description

Reimplemented in berry::EditorPart.

◆ SetFocus()

void berry::WorkbenchPart::SetFocus ( )
overridepure virtual

Asks this part to take focus within the workbench.

Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use IWorkbenchPage.activate(IWorkbenchPart) instead.

Implements berry::IWorkbenchPart.

Implemented in QmitkDataManagerView.

◆ SetInitializationData()

void berry::WorkbenchPart::SetInitializationData ( const IConfigurationElement::Pointer cfig,
const QString &  propertyName,
const Object::Pointer data 
)
override

The WorkbenchPart implementation of this IExecutableExtension records the configuration element in and internal state variable (accessible via getConfigElement). It also loads the title image, if one is specified in the configuration element. Subclasses may extend.

Should not be called by clients. It is called by the core plugin when creating this executable extension.

◆ SetPartName()

virtual void berry::WorkbenchPart::SetPartName ( const QString &  partName)
protectedvirtual

Sets the name of this part. The name will be shown in the tab area for the part. Clients should call this method instead of overriding getPartName. Setting this to the empty string will cause a default part name to be used.

Parameters
partNamethe part name, as it should be displayed in tabs.

Reimplemented in berry::EditorPart.

◆ SetPartProperty()

void berry::WorkbenchPart::SetPartProperty ( const QString &  key,
const QString &  value 
)
overridevirtual

Set an arbitrary property on the part. It is the implementor's responsibility to fire the corresponding PropertyChangeEvent.

A default implementation has been added to WorkbenchPart.

Parameters
keythe arbitrary property. Must not be null.
valuethe property value. A null value will remove that property.

Implements berry::IWorkbenchPart.

◆ SetSite()

void berry::WorkbenchPart::SetSite ( IWorkbenchPartSite::Pointer  site)
protected

Sets the part site.

Subclasses must invoke this method from IEditorPart.init and IViewPart.init.

Parameters
sitethe workbench part site

◆ SetTitleImage()

virtual void berry::WorkbenchPart::SetTitleImage ( const QIcon &  titleImage)
protectedvirtual

Sets or clears the title image of this part.

Parameters
titleImagethe title image, or null to clear

◆ SetTitleToolTip()

virtual void berry::WorkbenchPart::SetTitleToolTip ( const QString &  toolTip)
protectedvirtual

Sets or clears the title tool tip text of this part. Clients should call this method instead of overriding getTitleToolTip

Parameters
toolTipthe new tool tip text, or null to clear

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