Salome HOME
Update line endings according to coding rules
[modules/shaper.git] / src / CollectionPlugin / CollectionPlugin_WidgetCreator.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        CollectionPlugin_WidgetCreator.cpp
4 // Created:     15 Nov 2016
5 // Author:      Vitaly SMETANNIKOV
6
7 #include "CollectionPlugin_WidgetCreator.h"
8 #include "CollectionPlugin_WidgetField.h"
9
10
11 CollectionPlugin_WidgetCreator::CollectionPlugin_WidgetCreator()
12 : ModuleBase_IWidgetCreator()
13 {
14   myPanelTypes.insert("field-panel");
15 }
16
17 void CollectionPlugin_WidgetCreator::widgetTypes(std::set<std::string>& theTypes)
18 {
19   theTypes = myPanelTypes;
20 }
21
22
23 ModuleBase_ModelWidget* CollectionPlugin_WidgetCreator::createWidgetByType(
24                                                      const std::string& theType,
25                                                      QWidget* theParent,
26                                                      Config_WidgetAPI* theWidgetApi,
27                                                      ModuleBase_IWorkshop* theWorkshop)
28 {
29   ModuleBase_ModelWidget* aWidget = 0;
30   if (myPanelTypes.find(theType) == myPanelTypes.end())
31     return aWidget;
32
33   if (theType == "field-panel") {
34     aWidget = new CollectionPlugin_WidgetField(theParent, theWorkshop, theWidgetApi);
35   }
36
37   return aWidget;
38 }