Medical Imaging Interaction Toolkit  2016.11.0
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 ()
 
- 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 73 of file berryINullSelectionListener.h.

Member Typedef Documentation

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

Definition at line 78 of file berryINullSelectionListener.h.

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

Definition at line 76 of file berryINullSelectionListener.h.

Constructor & Destructor Documentation

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

Definition at line 80 of file berryINullSelectionListener.h.

Member Function Documentation

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

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.

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

Implements berry::ISelectionListener.

Definition at line 87 of file berryINullSelectionListener.h.


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