Medical Imaging Interaction Toolkit
2024.06.00
Medical Imaging Interaction Toolkit
|
#include <berryISelectionListener.h>
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 () |
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 100 of file berryISelectionListener.h.
typedef void(R::* berry::SelectionChangedAdapter< R >::Callback) (const IWorkbenchPart::Pointer &, const ISelection::ConstPointer &) |
Definition at line 105 of file berryISelectionListener.h.
typedef R berry::SelectionChangedAdapter< R >::Listener |
Definition at line 103 of file berryISelectionListener.h.
|
inline |
Definition at line 107 of file berryISelectionListener.h.
|
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.
part | the workbench part containing the selection |
selection | the current selection. This may be null if INullSelectionListener is implemented. |
Implements berry::ISelectionListener.
Definition at line 114 of file berryISelectionListener.h.