Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
berry::ViewPart Class Reference

#include <berryViewPart.h>

Inheritance diagram for berry::ViewPart:
Collaboration diagram for berry::ViewPart:

Public Member Functions

 berryObjectMacro (ViewPart, WorkbenchPart, IViewPart)
 
void Init (IViewSite::Pointer site, IMemento::Pointer memento=IMemento::Pointer(nullptr)) override
 
void SaveState (IMemento::Pointer memento) override
 
IViewSite::Pointer GetViewSite () override
 
- Public Member Functions inherited from berry::WorkbenchPart
 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
 
- Public Member Functions inherited from berry::IViewPart
 berryObjectMacro (berry::IViewPart, IWorkbenchPart)
 
 ~IViewPart () override
 

Protected Member Functions

 ViewPart ()
 
void CheckSite (IWorkbenchPartSite::Pointer site) override
 
- Protected Member Functions inherited from berry::WorkbenchPart
 WorkbenchPart ()
 
IConfigurationElement::Pointer GetConfigurationElement () const
 
void SetSite (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 views.

This class should be subclassed by clients wishing to define new views. The name of the subclass should be given as the "class" attribute in a view extension contributed to the workbench's view extension point (named "org.blueberry.ui.views"). For example, the plug-in's XML markup might contain:

<extension point="org.blueberry.ui.views">
<view id="com.example.myplugin.view"
name="My View"
class="com.example.myplugin.MyView"
icon="images/eview.gif"/>
</extension>

where com.example.myplugin.MyView is the name of the ViewPart subclass.

Subclasses must implement the following methods:

  • createPartControl - to create the view's controls
  • setFocus - to accept focus

Subclasses may extend or reimplement the following methods as required:

  • setInitializationData - extend to provide additional initialization when view extension is instantiated
  • init(IWorkbenchPartSite) - extend to provide additional initialization when view is assigned its site
  • dispose - extend to provide additional cleanup
  • getAdapter - reimplement to make their view adaptable

Definition at line 65 of file berryViewPart.h.

Constructor & Destructor Documentation

◆ ViewPart()

berry::ViewPart::ViewPart ( )
protected

Member Function Documentation

◆ berryObjectMacro()

berry::ViewPart::berryObjectMacro ( ViewPart  ,
WorkbenchPart  ,
IViewPart   
)

◆ CheckSite()

void berry::ViewPart::CheckSite ( IWorkbenchPartSite::Pointer  site)
overrideprotectedvirtual

Checks that the given site is valid for this type of part. The site for a view must be an IViewSite.

Parameters
sitethe site to check
Since
3.1

Reimplemented from berry::WorkbenchPart.

◆ GetViewSite()

IViewSite::Pointer berry::ViewPart::GetViewSite ( )
overridevirtual

Returns the site for this view. This method is equivalent to (IViewSite) getSite().

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

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

Implements berry::IViewPart.

◆ Init()

void berry::ViewPart::Init ( IViewSite::Pointer  site,
IMemento::Pointer  memento = IMemento::Pointer(nullptr) 
)
overridevirtual

Initializes this view with the given view site. A memento is passed to the view which contains a snapshot of the views state from a previous session. Where possible, the view should try to recreate that state within the part controls.

This method is automatically called by the workbench shortly after the part is instantiated. It marks the start of the views's lifecycle. Clients must not call this method.

Parameters
sitethe view site
mementothe IViewPart state or null if there is no previous saved state
Exceptions
PartInitExceptionif this view was not initialized successfully

Implements berry::IViewPart.

◆ SaveState()

void berry::ViewPart::SaveState ( IMemento::Pointer  memento)
overridevirtual

Saves the object state within a memento.

Parameters
mementoa memento to receive the object state

Implements berry::IViewPart.


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