Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
berryPropertyTester.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 
17 #include "berryPropertyTester.h"
18 
19 #include "berryPlatform.h"
20 #include "berryIContributor.h"
21 
22 #include <ctkPlugin.h>
23 
24 namespace berry
25 {
26 
28 {
29  fProperties = descriptor->GetProperties();
30  fNamespace= descriptor->GetNamespace();
31  fConfigElement= descriptor->GetExtensionElement();
32 }
33 
35 {
36  PropertyTesterDescriptor::Pointer tester(new PropertyTesterDescriptor(fConfigElement, fNamespace, fProperties));
37  return tester;
38 }
39 
40 bool PropertyTester::Handles(const QString &namespaze,
41  const QString &property)
42 {
43  return fNamespace == namespaze && fProperties.contains("," + property + ",");
44 }
45 
47 {
48  return true;
49 }
50 
52 {
53  QSharedPointer<ctkPlugin> plugin = Platform::GetPlugin(fConfigElement->GetContributor()->GetName());
54  return plugin->getState() == ctkPlugin::ACTIVE;
55 }
56 
58 {
59  return this;
60 }
61 
62 
63 } // namespace berry
itk::SmartPointer< Self > Pointer
bool IsDeclaringPluginActive() override
PropertyTesterDescriptor::Pointer InternalCreateDescriptor()
bool Handles(const QString &namespaze, const QString &property) override
IPropertyTester * Instantiate() override
static QSharedPointer< ctkPlugin > GetPlugin(const QString &symbolicName)
void InternalInitialize(PropertyTesterDescriptor::Pointer descriptor)
bool IsInstantiated() override