Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
berry::ContributionItemFactory Class Referenceabstract

#include <berryContributionItemFactory.h>

Public Member Functions

virtual SmartPointer< IContributionItemCreate (IWorkbenchWindow *window)=0
 
QString GetId () const
 
virtual ~ContributionItemFactory ()=default
 

Static Public Attributes

static const QScopedPointer< ContributionItemFactoryOPEN_WINDOWS
 
static const QScopedPointer< ContributionItemFactoryVIEWS_SHORTLIST
 
static const QScopedPointer< ContributionItemFactoryREOPEN_EDITORS
 
static const QScopedPointer< ContributionItemFactoryPERSPECTIVES_SHORTLIST
 

Protected Member Functions

 ContributionItemFactory (const QString &contributionItemId)
 

Detailed Description

Access to standard contribution items provided by the workbench.

Most of the functionality of this class is provided by static methods and fields. Example usage:

MenuManager menu = ...;
IContributionItem::Pointer reEdit
    = ContributionItemFactory::REOPEN_EDITORS->Create(window);
menu->Add(reEdit);

Clients may declare subclasses that provide additional application-specific contribution item factories.

Definition at line 45 of file berryContributionItemFactory.h.

Constructor & Destructor Documentation

◆ ContributionItemFactory()

berry::ContributionItemFactory::ContributionItemFactory ( const QString &  contributionItemId)
protected

Creates a new workbench contribution item factory with the given id.

Parameters
contributionItemIdthe id of contribution items created by this factory

◆ ~ContributionItemFactory()

virtual berry::ContributionItemFactory::~ContributionItemFactory ( )
virtualdefault

Member Function Documentation

◆ Create()

virtual SmartPointer<IContributionItem> berry::ContributionItemFactory::Create ( IWorkbenchWindow window)
pure virtual

Creates a new standard contribution item for the given workbench window.

A typical contribution item automatically registers listeners against the workbench window so that it can keep its enablement state up to date. Ordinarily, the window's references to these listeners will be dropped automatically when the window closes. However, if the client needs to get rid of a contribution item while the window is still open, the client must call IContributionItem::dispose to give the item an opportunity to deregister its listeners and to perform any other cleanup.

Parameters
windowthe workbench window
Returns
the workbench contribution item

◆ GetId()

QString berry::ContributionItemFactory::GetId ( ) const

Returns the id of this contribution item factory.

Returns
the id of contribution items created by this factory

Member Data Documentation

◆ OPEN_WINDOWS

const QScopedPointer<ContributionItemFactory> berry::ContributionItemFactory::OPEN_WINDOWS
static

Workbench contribution item (id "openWindows"): A list of windows currently open in the workbench. Selecting one of the items makes the corresponding window the active window. This action dynamically maintains the list of windows.

Definition at line 96 of file berryContributionItemFactory.h.

◆ PERSPECTIVES_SHORTLIST

const QScopedPointer<ContributionItemFactory> berry::ContributionItemFactory::PERSPECTIVES_SHORTLIST
static

Workbench contribution item (id "perspectivesShortlist"): A list of perspectives available to be opened, arranged as a shortlist of promising perspectives and an "Other" subitem. Selecting one of the items makes the corresponding perspective active. Should a new perspective need to be opened, a workbench user preference controls whether the perspective is opened in the active window or a new window. This action dynamically maintains the perspectives shortlist.

Definition at line 124 of file berryContributionItemFactory.h.

◆ REOPEN_EDITORS

const QScopedPointer<ContributionItemFactory> berry::ContributionItemFactory::REOPEN_EDITORS
static

Workbench contribution item (id "reopenEditors"): A list of recent editors (with inputs) available to be reopened in the window. Selecting one of the items reopens the corresponding editor on its input in the active window. This action dynamically maintains the list of editors.

Definition at line 113 of file berryContributionItemFactory.h.

◆ VIEWS_SHORTLIST

const QScopedPointer<ContributionItemFactory> berry::ContributionItemFactory::VIEWS_SHORTLIST
static

Workbench contribution item (id "viewsShortlist"): A list of views available to be opened in the window, arranged as a shortlist of promising views and an "Other" subitem. Selecting one of the items opens the corresponding view in the active window. This action dynamically maintains the view shortlist.

Definition at line 105 of file berryContributionItemFactory.h.


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