Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::SelectionChangedAdapter< R > Struct Template Reference

#include <berryISelectionListener.h>

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

Public Types

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

Public Member Functions

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

Detailed Description

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

This template can be used like this:

class MyClass {

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

berry::ISelectionListener::Pointer m_SelectionListener;

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

Definition at line 104 of file berryISelectionListener.h.

Member Typedef Documentation

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

Definition at line 109 of file berryISelectionListener.h.

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

Definition at line 107 of file berryISelectionListener.h.

Constructor & Destructor Documentation

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

Definition at line 111 of file berryISelectionListener.h.

Member Function Documentation

template<typename R >
void berry::SelectionChangedAdapter< 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 118 of file berryISelectionListener.h.


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