Medical Imaging Interaction Toolkit  2023.04.99-859410e3
Medical Imaging Interaction Toolkit
berry::NullSelectionChangedAdapter< R > Struct Template Reference

#include <berryINullSelectionListener.h>

Inheritance diagram for berry::NullSelectionChangedAdapter< R >:
Collaboration diagram for berry::NullSelectionChangedAdapter< R >:

Public Types

typedef R Listener
typedef void(R::* Callback) (const IWorkbenchPart::Pointer &, const ISelection::ConstPointer &)

Public Member Functions

 NullSelectionChangedAdapter (R *l, Callback c)
void SelectionChanged (const IWorkbenchPart::Pointer &part, const ISelection::ConstPointer &selection) override
- Public Member Functions inherited from berry::INullSelectionListener
 ~INullSelectionListener () override
- Public Member Functions inherited from berry::ISelectionListener
virtual ~ISelectionListener ()

Detailed Description

template<typename R>
struct berry::NullSelectionChangedAdapter< R >

This template can be used like this:

class MyClass {

private: void HandleSelectionChanged(berry::IWorkbenchPart::Pointer part, berry::ISelection::ConstPointer selection) { // do something }

berry::INullSelectionListener::Pointer m_SelectionListener;

public: MyClass() : m_SelectionListener(new berry::NullSelectionChangedAdapter<MyClass>(this, &MyClass::HandleSelectionChanged)) { // get the selection service // ... service->AddPostSelectionListener(m_SelectionListener); } };

Definition at line 69 of file berryINullSelectionListener.h.

Member Typedef Documentation

◆ Callback

template<typename R >
typedef void(R::* berry::NullSelectionChangedAdapter< R >::Callback) (const IWorkbenchPart::Pointer &, const ISelection::ConstPointer &)

Definition at line 74 of file berryINullSelectionListener.h.

◆ Listener

template<typename R >
typedef R berry::NullSelectionChangedAdapter< R >::Listener

Definition at line 72 of file berryINullSelectionListener.h.

Constructor & Destructor Documentation

◆ NullSelectionChangedAdapter()

template<typename R >
berry::NullSelectionChangedAdapter< R >::NullSelectionChangedAdapter ( R *  l,
Callback  c 

Definition at line 76 of file berryINullSelectionListener.h.

Member Function Documentation

◆ SelectionChanged()

template<typename R >
void berry::NullSelectionChangedAdapter< R >::SelectionChanged ( const IWorkbenchPart::Pointer part,
const ISelection::ConstPointer selection 

Notifies this listener that the selection has changed.

This method is called when the selection changes from one to a non-null value, but not when the selection changes to null. If there is a requirement to be notified in the latter scenario, implement INullSelectionListener. The event will be posted through this method.

partthe workbench part containing the selection
selectionthe current selection. This may be null if INullSelectionListener is implemented.

Implements berry::ISelectionListener.

Definition at line 83 of file berryINullSelectionListener.h.

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