Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIPropertyChangeListener.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
20 #include <berryObjects.h>
21 
22 namespace berry {
23 
25 {
26 }
27 
28 void
31 {
32  if (listener == nullptr) return;
33 
34  this->propertyChange += Delegate(listener, &IPropertyChangeListener::PropertyChange);
35 }
36 
37 void
40 {
41  if (listener == nullptr) return;
42 
43  this->propertyChange -= Delegate(listener, &IPropertyChangeListener::PropertyChange);
44 }
45 
47 {
48  if (event->GetProperty() == IWorkbenchPartConstants::INTEGER_PROPERTY)
49  {
50  this->PropertyChange(event->GetSource(), event->GetNewValue().Cast<ObjectInt>()->GetValue());
51  }
52 }
53 
54 }
void RemoveListener(IPropertyChangeListener *listener)
virtual void PropertyChange(const PropertyChangeEvent::Pointer &event)
void AddListener(IPropertyChangeListener *listener)
SmartPointer< Other > Cast() const