Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
berry::IPerspectiveFactory Struct Referenceabstract

#include <berryIPerspectiveFactory.h>

Inheritance diagram for berry::IPerspectiveFactory:
Collaboration diagram for berry::IPerspectiveFactory:

Public Member Functions

 berryObjectMacro (berry::IPerspectiveFactory)
 
 ~IPerspectiveFactory () override
 
virtual void CreateInitialLayout (IPageLayout::Pointer layout)=0
 
- 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
 

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 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
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

A perspective factory generates the initial page layout and visible action set for a page.

When a new page is created in the workbench a perspective is used to define the initial page layout. If this is a predefined perspective (based on an extension to the workbench's perspective extension point) an IPerspectiveFactory is used to define the initial page layout.

The factory for the perspective is created and passed an IPageLayout where views can be added. The default layout consists of the editor area with no additional views. Additional views are added to the layout using the editor area as the initial point of reference. The factory is used only briefly while a new page is created; then discarded.

To define a perspective clients should implement this interface and include the name of their class in an extension to the workbench's perspective extension point (named "org.blueberry.ui.perspectives"). For example, the plug-in's XML markup might contain:

<extension point="org.blueberry.ui.perspectives">
  <perspective
      id="com.example.plugin.perspective"
      name="My Perspective"
      class="namespaze::MyPerspective">
  </perspective>
</extension>

Example of populating a page with standard workbench views:

public: void CreateInitialLayout(IPageLayout layout) {
   // Get the editor area.
   QString editorArea = layout->GetEditorArea();
   // Top left: Resource Navigator view and Bookmarks view placeholder
   IFolderLayout::Pointer topLeft = layout->CreateFolder("topLeft", IPageLayout::LEFT, 0.25f,
     editorArea);
   topLeft->AddView(IPageLayout::ID_RES_NAV);
   topLeft->AddPlaceholder(IPageLayout::ID_BOOKMARKS);
   // Bottom left: Outline view and Property Sheet view
   IFolderLayout::Pointer bottomLeft = layout->CreateFolder("bottomLeft", IPageLayout::BOTTOM, 0.50f,
     "topLeft");
   bottomLeft->AddView(IPageLayout::ID_OUTLINE);
   bottomLeft->AddView(IPageLayout::ID_PROP_SHEET);
   // Bottom right: Task List view
   layout->AddView(IPageLayout::ID_TASK_LIST, IPageLayout::BOTTOM, 0.66f, editorArea);
 }

Within the workbench a user may override the visible views, layout and action sets of a predefined perspective to create a custom perspective. In such cases the layout is persisted by the workbench and the factory is not used.

Definition at line 82 of file berryIPerspectiveFactory.h.

Constructor & Destructor Documentation

◆ ~IPerspectiveFactory()

berry::IPerspectiveFactory::~IPerspectiveFactory ( )
override

Member Function Documentation

◆ berryObjectMacro()

berry::IPerspectiveFactory::berryObjectMacro ( berry::IPerspectiveFactory  )

◆ CreateInitialLayout()

virtual void berry::IPerspectiveFactory::CreateInitialLayout ( IPageLayout::Pointer  layout)
pure virtual

Creates the initial layout for a page.

Implementors of this method may add additional views to a perspective. The perspective already contains an editor folder identified by the result of IPageLayout.getEditorArea(). Additional views should be added to the layout using this value as the initial point of reference.

Parameters
layoutthe page layout

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