Medical Imaging Interaction Toolkit  2016.11.0
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()
 
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
 
virtual void CreatePartControl (QWidget *parent) override=0
 
virtual 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) virtual ~IWorkbenchPart()
 
- 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 This class is not intended to be subclassed by clients.

Definition at line 45 of file berryWorkbenchPart.h.

Constructor & Destructor Documentation

berry::WorkbenchPart::WorkbenchPart ( )
protected

Definition at line 58 of file berryWorkbenchPart.cpp.

Member Function Documentation

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.

Definition at line 201 of file berryWorkbenchPart.cpp.

References berry::IPropertyChangeListener::Events::AddListener().

berry::WorkbenchPart::berryObjectMacro ( WorkbenchPart  ,
QObject  ,
IWorkbenchPart  ,
IExecutableExtension   
)
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.

Definition at line 116 of file berryWorkbenchPart.cpp.

Referenced by berry::ViewPart::CheckSite(), berry::EditorPart::CheckSite(), and SetSite().

virtual 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 QmitkFunctionality.

void berry::WorkbenchPart::FirePropertyChanged ( const QString &  key,
const QString &  oldValue,
const QString &  newValue 
)
protected
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 81 of file berryWorkbenchPart.h.

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 practise to overload or extend this method. Parts should call setContentDescription to change their content description.

Implements berry::IWorkbenchPart.

Definition at line 253 of file berryWorkbenchPart.cpp.

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 practise to overload or extend this method. Parts should call setPartName to change their part name.

Implements berry::IWorkbenchPart.

Definition at line 248 of file berryWorkbenchPart.cpp.

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.

Definition at line 238 of file berryWorkbenchPart.cpp.

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.

Definition at line 230 of file berryWorkbenchPart.cpp.

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.

Definition at line 258 of file berryWorkbenchPart.cpp.

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.

Definition at line 264 of file berryWorkbenchPart.cpp.

Referenced by berry::EditorPart::GetTitleToolTip().

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.

Definition at line 206 of file berryWorkbenchPart.cpp.

References berry::IPropertyChangeListener::Events::RemoveListener().

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.

Definition at line 153 of file berryWorkbenchPart.cpp.

Referenced by berry::EditorPart::SetContentDescription().

virtual 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 QmitkFunctionality, QmitkDataManagerView, and QmitkStdMultiWidgetEditor.

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.

Definition at line 269 of file berryWorkbenchPart.cpp.

References berry::AbstractUICTKPlugin::ImageDescriptorFromPlugin().

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.

Definition at line 145 of file berryWorkbenchPart.cpp.

Referenced by berry::EditorPart::SetPartName().

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.

Definition at line 211 of file berryWorkbenchPart.cpp.

References FirePropertyChanged().

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

Returns the default title image.

Returns
the default image Sets the part site.

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

Parameters
sitethe workbench part site

Definition at line 110 of file berryWorkbenchPart.cpp.

References CheckSite().

Referenced by QmitkAbstractRenderEditor::Init().

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

Definition at line 121 of file berryWorkbenchPart.cpp.

References FirePropertyChange(), and berry::IWorkbenchPartConstants::PROP_TITLE.

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

Definition at line 133 of file berryWorkbenchPart.cpp.

References FirePropertyChange(), and berry::IWorkbenchPartConstants::PROP_TITLE.


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