Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
berryIPropertyChangeListener.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
16 #include <berryObjects.h>
17 
18 namespace berry {
19 
21 {
22 }
23 
24 void
27 {
28  if (listener == nullptr) return;
29 
30  this->propertyChange += Delegate(listener, &IPropertyChangeListener::PropertyChange);
31 }
32 
33 void
36 {
37  if (listener == nullptr) return;
38 
39  this->propertyChange -= Delegate(listener, &IPropertyChangeListener::PropertyChange);
40 }
41 
43 {
44  if (event->GetProperty() == IWorkbenchPartConstants::INTEGER_PROPERTY)
45  {
46  this->PropertyChange(event->GetSource(), event->GetNewValue().Cast<ObjectInt>()->GetValue());
47  }
48 }
49 
50 }
void RemoveListener(IPropertyChangeListener *listener)
SmartPointer< Other > Cast() const
virtual void PropertyChange(const PropertyChangeEvent::Pointer &event)
void AddListener(IPropertyChangeListener *listener)