]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <daniel@daniel.creatis>
Fri, 30 Nov 2012 16:39:49 +0000 (17:39 +0100)
committerDaniel Gonzalez <daniel@daniel.creatis>
Fri, 30 Nov 2012 16:39:49 +0000 (17:39 +0100)
CreaDevManager application implementation

Creation of files and folders in constructors
Showing files and folders in the tree and catching changing event in tree.

14 files changed:
lib/creaDevManagerLib/modelCDMApplication.cpp
lib/creaDevManagerLib/modelCDMCMakeListsFile.cpp
lib/creaDevManagerLib/modelCDMFile.cpp
lib/creaDevManagerLib/modelCDMFolder.cpp
lib/creaDevManagerLib/modelCDMFolder.h
lib/creaDevManagerLib/modelCDMLibrary.cpp
lib/creaDevManagerLib/modelCDMMain.cpp
lib/creaDevManagerLib/modelCDMMain.h
lib/creaDevManagerLib/modelCDMPackage.cpp
lib/creaDevManagerLib/modelCDMProject.cpp
lib/creaDevManagerLib/modelCDMProject.h
lib/creaDevManagerLib/wxCDMMainFrame.cpp
lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx
lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.h

index 5035feb7a7f40a515748c2b405d2267537a58bc3..a816a96fa188eb08cce1b411f1ae9401f55622b0 100644 (file)
@@ -44,7 +44,13 @@ modelCDMApplication::modelCDMApplication()
 
 modelCDMApplication::modelCDMApplication(const std::string& path, const int& level)
 {
-  this->name = "application";
+  std::vector<std::string> words;
+  std::string delimiters;
+  //TODO::fix for windows
+  delimiters = "/";
+  CDMUtilities::splitter::split(words, path, delimiters, CDMUtilities::splitter::no_empties);
+  this->name = words[words.size()-1];
+
   this->path = path;
   this->type = wxDIR_DIRS;
   this->level = level;
index 7cdcc6381d1c022f76aabf7124d8b1957711c20e..768ce80cdd2fb6bf2d1b4d6f81ed57df0c56c1c0 100644 (file)
@@ -34,6 +34,9 @@
 
 #include "modelCDMCMakeListsFile.h"
 
+#include<creaWx.h>
+#include<wx/dir.h>
+
 modelCDMCMakeListsFile::modelCDMCMakeListsFile()
 {
 }
@@ -41,6 +44,11 @@ modelCDMCMakeListsFile::modelCDMCMakeListsFile()
 modelCDMCMakeListsFile::modelCDMCMakeListsFile(const std::string& path,
     const int& level)
 {
+  this->children.clear();
+  this->level = level;
+  this->type = wxDIR_FILES;
+  this->name = "CMakeFileLists.txt";
+  this->path = path;
 }
 
 modelCDMCMakeListsFile::~modelCDMCMakeListsFile()
index 0049e41f3bc22eebcb6d54e54cfbffd947633100..6fcfab6560982f1d1d2b75dd8a49e9c9f8091115 100644 (file)
 
 #include "modelCDMFile.h"
 
+#include <creaWx.h>
+#include <wx/dir.h>
+
+#include "CDMUtilities.h"
+
 modelCDMFile::modelCDMFile()
 {
 }
 
 modelCDMFile::modelCDMFile(const std::string& path, const int& level)
 {
+  this->children.clear();
+  this->level = level;
+
+  std::vector<std::string> words;
+  std::string delimiters;
+  //TODO::fix for windows
+  delimiters = "/";
+  CDMUtilities::splitter::split(words, path, delimiters, CDMUtilities::splitter::no_empties);
+  this->name = words[words.size()-1];
+
+  this->path = path;
+  this->type = wxDIR_FILES;
 }
 
 modelCDMFile::~modelCDMFile()
index a1965a663ee3f2f061f1ba4697bb1fc65c3ca373..537e636759f79b919d5efde421cc4eb12dbbc0bd 100644 (file)
 
 #include "modelCDMFolder.h"
 
+#include <creaWx.h>
+#include <wx/dir.h>
+
+#include "CDMUtilities.h"
+
 modelCDMFolder::modelCDMFolder()
 {
+  this->CMakeLists = NULL;
 }
 
 modelCDMFolder::modelCDMFolder(const std::string& path, const int& level)
 {
+  //set attributes
+  this->children.clear();
+  this->level = level;
+  this->CMakeLists = NULL;
+
+  std::vector<std::string> words;
+  std::string delimiters;
+  //TODO::fix for windows
+  delimiters = "/";
+  CDMUtilities::splitter::split(words, path, delimiters, CDMUtilities::splitter::no_empties);
+  this->name = words[words.size()-1];
+
+  this->path = path;
+  this->type = wxDIR_DIRS;
+
+  std::string pathFixed(CDMUtilities::fixPath(path));
+  //check all folders
+  wxDir dir(crea::std2wx((pathFixed).c_str()));
+  if (dir.IsOpened())
+    {
+      wxString fileName;
+      bool cont = dir.GetFirst(&fileName, wxEmptyString, wxDIR_DIRS);
+      while (cont)
+        {
+          std::string stdfileName = crea::wx2std(fileName);
+
+          //if is an unknown folder, create folder
+          this->children.push_back(new modelCDMFolder(pathFixed + "/" + stdfileName, this->level + 1));
+
+          cont = dir.GetNext(&fileName);
+        }
+
+      cont = dir.GetFirst(&fileName, wxEmptyString, wxDIR_FILES);
+      while (cont)
+        {
+          std::string stdfileName = crea::wx2std(fileName);
+
+          //if CMakeLists, create CMakeLists
+          if(stdfileName == "CMakeLists.txt")
+            {
+              this->CMakeLists = new modelCDMCMakeListsFile(pathFixed + "/" + stdfileName, this->level + 1);
+              this->children.push_back(this->CMakeLists);
+            }
+          else
+            {
+              this->children.push_back(new modelCDMFile(pathFixed + "/" + stdfileName, this->level + 1));
+            }
+          //if is an unknown file, create file
+          cont = dir.GetNext(&fileName);
+        }
+    }
+
+  this->SortChildren();
 }
 
 modelCDMFolder::~modelCDMFolder()
 {
+  for (int i = 0; i < this->children.size(); i++)
+    {
+      if(this->children[i] != NULL)
+        {
+          delete this->children[i];
+          this->children[i] = NULL;
+        }
+    }
 }
 
 bool modelCDMFolder::CreateFolder(const std::string& name, std::string*& result,
index f1ead308e42b2be68295c5cb5924e7c2744284bc..fe88055eaa2afe4ca116503e3b580acd2b6e4b5e 100644 (file)
@@ -39,6 +39,7 @@
 #include<vector>
 
 #include "modelCDMIProjectTreeNode.h"
+#include "modelCDMCMakeListsFile.h"
 
 class modelCDMFolder : public modelCDMIProjectTreeNode
 {
@@ -57,6 +58,7 @@ public:
 
 private:
   std::vector<modelCDMFolder*> folders;
+  modelCDMCMakeListsFile* CMakeLists;
 };
 
 #endif /* MODELCDMFOLDER_H_ */
index c9aeb1fa5138c7f7abe8a2440d1bc5504ca76a45..cfd04119528f70e3dc72830a3b09bc68f6e45e6c 100644 (file)
@@ -44,7 +44,13 @@ modelCDMLibrary::modelCDMLibrary()
 
 modelCDMLibrary::modelCDMLibrary(const std::string& path, const int& level)
 {
-  this->name = "library";
+  std::vector<std::string> words;
+  std::string delimiters;
+  //TODO::fix for windows
+  delimiters = "/";
+  CDMUtilities::splitter::split(words, path, delimiters, CDMUtilities::splitter::no_empties);
+  this->name = words[words.size()-1];
+
   this->path = path;
   this->type = wxDIR_DIRS;
   this->level = level;
index b3c381ff12064be15f6dd7a4661a4a4b3c8819f1..5c49116154af82e1e1f882b45c8ba83f4425d205 100644 (file)
@@ -263,6 +263,11 @@ bool modelCDMMain::RefreshProject(
     }
 }
 
+std::map<wxTreeItemId, modelCDMIProjectTreeNode*>& modelCDMMain::GetModelElements()
+{
+  return this->modelElements;
+}
+
 bool modelCDMMain::CloseProject(
     std::string*& result
 )
index 83d86acaf4a3252a83a84d7045c05b989519eaaf..d75355ce27f0a70ac624482ec3a2e718c95f005d 100644 (file)
 #define MODELCDMMAIN_H_
 
 #include<iostream>
+#include<map>
 
+#include<creaWx.h>
+#include<wx/treectrl.h>
+
+#include "modelCDMIProjectTreeNode.h"
 #include "modelCDMProject.h"
 
 class modelCDMMain
@@ -46,6 +51,8 @@ public:
   ~modelCDMMain();
 
   modelCDMProject* GetProject() const;
+  std::map< wxTreeItemId, modelCDMIProjectTreeNode* >& GetModelElements();
+
 
   bool CreateProject(
       const std::string& name,
@@ -65,8 +72,10 @@ public:
       std::string*& result
   );
 
+
 private:
   modelCDMProject* project;
+  std::map< wxTreeItemId, modelCDMIProjectTreeNode* > modelElements;
 };
 
 
index 487beef12ce2684ab99eb5a00112686533cd72d9..b7280b124b9d6f7a467564536993b84b7cd046c9 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "creaWx.h"
 #include "wx/dir.h"
+#include "CDMUtilities.h"
 
 modelCDMPackage::modelCDMPackage()
 {
@@ -44,8 +45,13 @@ modelCDMPackage::modelCDMPackage()
 modelCDMPackage::modelCDMPackage(const std::string& path, const int& level)
 {
   this->type = wxDIR_DIRS;
-  //TODO: Get Package Name
-  this->name = "Package";
+  //Get Package Name
+  std::vector<std::string> words;
+  std::string delimiters;
+  //TODO::fix for windows
+  delimiters = "/";
+  CDMUtilities::splitter::split(words, path, delimiters, CDMUtilities::splitter::no_empties);
+  this->name = words[words.size()-1].substr(5, words[words.size()-1].size()-9);
   this->namePackage = this->name;
   this->level = level;
   this->path = path;
index 11ed495072c0783af6106bd9926a73fb6565946d..dc9ac63d5f5752d2f830fae4db656bbf0cb77201 100644 (file)
@@ -47,6 +47,7 @@ modelCDMProject::modelCDMProject()
   std::cout << "in constructor1" << std::endl;
   this->appli = NULL;
   this->lib = NULL;
+  this->CMakeLists = NULL;
 }
 
 modelCDMProject::modelCDMProject(
@@ -79,13 +80,14 @@ modelCDMProject::modelCDMProject(
           std::vector<std::string> nameBits;
           CDMUtilities::splitter::split(nameBits, word, " ", CDMUtilities::splitter::no_empties);
 
-          this->name = "";
+          this->name = this->nameProject = "";
           for (int i = 0; i < nameBits.size(); i++)
             {
               if(i != 0)
                 this->name += " ";
               this->name += nameBits[i];
             }
+          this->nameProject = this->name;
 
         }
 
@@ -132,28 +134,14 @@ modelCDMProject::modelCDMProject(
   this->type = wxDIR_DIRS;
   this->level = 0;
 
-  //TODO: implement method
-  //if appli exist create Appli
+  this->children.clear();
   this->appli = NULL;
-  wxDir dir(crea::std2wx((pathFixed + "/appli").c_str()));
-  if (dir.IsOpened())
-    {
-      this->appli = new modelCDMAppli(pathFixed + "/appli", this->level + 1);
-      this->children.push_back(this->appli);
-    }
-
-  //if lib exist create Lib
   this->lib = NULL;
-  dir.Open(crea::std2wx((pathFixed + "/lib").c_str()));
-  if (dir.IsOpened())
-    {
-      this->lib = new modelCDMLib(pathFixed + "/lib", this->level + 1);
-      this->children.push_back(this->lib);
-    }
-
-  //if bbtk_* exist create Packages
   this->packages.clear();
-  dir.Open(crea::std2wx((pathFixed).c_str()));
+
+
+  //check all folders
+  wxDir dir(crea::std2wx((pathFixed).c_str()));
   if (dir.IsOpened())
     {
       wxString fileName;
@@ -162,63 +150,86 @@ modelCDMProject::modelCDMProject(
         {
           std::string stdfileName = crea::wx2std(fileName);
 
-          if(stdfileName.size() > 9 && stdfileName.substr(0,5) == "bbtk_" && stdfileName.substr(stdfileName.size()-4,4) == "_PKG")
+          //if appli, create appli
+          if(stdfileName == "appli")
+            {
+              this->appli = new modelCDMAppli(pathFixed + "/appli", this->level + 1);
+              this->children.push_back(this->appli);
+            }
+          //if lib, create lib
+          else if(stdfileName == "lib")
+            {
+              this->lib = new modelCDMLib(pathFixed + "/lib", this->level + 1);
+              this->children.push_back(this->lib);
+            }
+          //if package , create package
+          else if(stdfileName.size() > 9 && stdfileName.substr(0,5) == "bbtk_" && stdfileName.substr(stdfileName.size()-4,4) == "_PKG")
             {
               modelCDMPackage* package = new modelCDMPackage(pathFixed + "/" + stdfileName, this->level + 1);
               this->packages.push_back(package);
               this->children.push_back(package);
             }
+          //if is an unknown folder, create folder
+          else
+            {
+              this->children.push_back(new modelCDMFolder(pathFixed + "/" + stdfileName, this->level + 1));
+            }
 
           cont = dir.GetNext(&fileName);
         }
 
+      cont = dir.GetFirst(&fileName, wxEmptyString, wxDIR_FILES);
+      while (cont)
+        {
+          std::string stdfileName = crea::wx2std(fileName);
+
+          //if CMakeLists, create CMakeLists
+          if(stdfileName == "CMakeLists.txt")
+            {
+              this->CMakeLists = new modelCDMCMakeListsFile(pathFixed + "/" + stdfileName, this->level + 1);
+              this->children.push_back(this->CMakeLists);
+            }
+          else
+            {
+              this->children.push_back(new modelCDMFile(pathFixed + "/" + stdfileName, this->level + 1));
+            }
+          //if is an unknown file, create file
+          cont = dir.GetNext(&fileName);
+        }
     }
+
   this->SortChildren();
 
 }
 
 modelCDMProject::~modelCDMProject()
 {
-  if(this->appli != NULL)
-    {
-      delete this->appli;
-      this->appli = NULL;
-    }
-  if(this->lib != NULL)
-    {
-      delete this->lib;
-      this->lib = NULL;
-    }
-  for (int i = 0; i < this->packages.size(); i++)
+  for (int i = 0; i < this->children.size(); i++)
     {
-      if(this->packages[i] != NULL)
+      if(this->children[i] != NULL)
         {
-          delete this->packages[i];
-          this->packages[i] = NULL;
+          delete this->children[i];
+          this->children[i] = NULL;
         }
     }
 }
 
-const std::string&
-modelCDMProject::GetName() const
+const std::string& modelCDMProject::GetNameProject() const
 {
-  return this->name;
+  return this->nameProject;
 }
 
-const std::string&
-modelCDMProject::GetVersion() const
+const std::string& modelCDMProject::GetVersion() const
 {
   return this->version;
 }
 
-const std::string&
-modelCDMProject::GetVersionDate() const
+const std::string& modelCDMProject::GetVersionDate() const
 {
   return this->versionDate;
 }
 
-const std::string&
-modelCDMProject::GetBuildPath() const
+const std::string& modelCDMProject::GetBuildPath() const
 {
   return this->buildPath;
 }
index bafe63525e7448c3ba34ffa5d073365204af2b00..00fff7c63066c44bf1dbb1e79858b55300f336e0 100644 (file)
@@ -42,6 +42,7 @@
 #include "modelCDMLib.h"
 #include "modelCDMAppli.h"
 #include "modelCDMPackage.h"
+#include "modelCDMCMakeListsFile.h"
 
 class modelCDMProject : public modelCDMFolder
 {
@@ -52,7 +53,7 @@ public:
 
   void PopulateProject();
 
-  const std::string& GetName() const;
+  const std::string& GetNameProject() const;
   const std::string& GetVersion() const;
   const std::string& GetVersionDate() const;
   const std::string& GetBuildPath() const;
@@ -94,7 +95,7 @@ public:
 
 private:
 
-  std::string name;
+  std::string nameProject;
   std::string version;
   std::string versionDate;
   std::string buildPath;
@@ -102,6 +103,7 @@ private:
   modelCDMLib* lib;
   modelCDMAppli* appli;
   std::vector<modelCDMPackage*> packages;
+  modelCDMCMakeListsFile* CMakeLists;
 
 };
 
index 28d9a5d0e7860f3fe791adb9669577a4394a17eb..d8ffea1e4f50b10728a563145b306e437f4bd434 100755 (executable)
@@ -238,7 +238,7 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event)
         }
 
       //populate tree control
-      tree_Projects->BuildTree(this->model->GetProject());
+      tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject());
       tree_Projects->SelectItem(this->model->GetProject()->GetId());
 
       //change description panel
@@ -325,7 +325,7 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
 
 
       //populate tree control
-      tree_Projects->BuildTree(this->model->GetProject());
+      tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
       tree_Projects->SelectItem(this->model->GetProject()->GetId());
 
       //change description panel
@@ -383,7 +383,7 @@ void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
       std::cout << "error closing project: " << *result << std::endl;
       wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
     }
-  tree_Projects->BuildTree(this->model->GetProject());
+  tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
 
   if(this->panel_Properties != NULL)
     {
@@ -412,7 +412,38 @@ void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
 }
 void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
 {
-  std::cerr << "Event OnMenuCloseAllProjects not implemented" << std::endl;
+  std::cerr << "Event OnMenuCloseAllProjects closing only one project" << std::endl;
+  std::string* result;
+  if(!this->model->CloseProject(result))
+    {
+      std::cout << "error closing project: " << *result << std::endl;
+      wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
+    }
+  tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
+
+  if(this->panel_Properties != NULL)
+    {
+      auiManager.DetachPane(this->panel_Properties);
+      this->panel_Properties->Destroy();
+    }
+  if(this->panel_ProjectActions != NULL)
+    {
+      auiManager.DetachPane(this->panel_ProjectActions);
+      this->panel_ProjectActions->Destroy();
+    }
+
+  this->panel_Properties = new wxCDMMainDescriptionPanel(
+      this,
+      ID_WINDOW_PROPERTIES,
+      wxT("Description Panel"),
+      wxDefaultPosition,
+      wxSize(300, 400),
+      0
+  );
+
+  auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
+
+  auiManager.Update();
   event.Skip();
 }
 void wxCDMMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
@@ -423,6 +454,33 @@ void wxCDMMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
 void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event)
 {
   std::cout << "Closing CreaDevManager..." << std::endl;
+  std::string* result;
+  if(!this->model->CloseProject(result))
+    {
+      std::cout << "error closing project: " << *result << std::endl;
+      wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
+    }
+  tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
+
+  if(this->panel_Properties != NULL)
+    {
+      auiManager.DetachPane(this->panel_Properties);
+      this->panel_Properties->Destroy();
+    }
+  if(this->panel_ProjectActions != NULL)
+    {
+      auiManager.DetachPane(this->panel_ProjectActions);
+      this->panel_ProjectActions->Destroy();
+    }
+
+  this->panel_Properties = new wxCDMMainDescriptionPanel(
+      this,
+      ID_WINDOW_PROPERTIES,
+      wxT("Description Panel"),
+      wxDefaultPosition,
+      wxSize(300, 400),
+      0
+  );
   Close();
   event.Skip();
 }
@@ -520,6 +578,18 @@ void wxCDMMainFrame::OnMenuAboutCreatis(wxCommandEvent& event)
 
 void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
 {
-  std::cerr << "Event OnTreeSelectionChange not implemented" << std::endl;
+  std::cout << "New Tree Selection" << std::endl;
+  //get selected element
+  wxTreeItemId elementId = event.GetItem();
+
+  //get element from model
+  modelCDMIProjectTreeNode* element = this->model->GetModelElements()[elementId];
+  std::cout << "Tree Selection: " << element->GetName() << std::endl;
+
+  //TODO get element type
+  //TODO create element description
+  //TODO delete old view
+  //TODO set new view
   event.Skip();
+
 }
index 61bd7e7752de661ebbd72431474d1fe361b90946..671574dc64f5aab3bad860b9d6020229f5221257 100755 (executable)
@@ -70,17 +70,19 @@ bool wxCDMProjectsTreeCtrl::Create(
   return TRUE;
 }
 
-void wxCDMProjectsTreeCtrl::BuildTree(modelCDMProject* projectTree)
+void wxCDMProjectsTreeCtrl::BuildTree(std::map< wxTreeItemId, modelCDMIProjectTreeNode* >& modelElements, modelCDMProject* projectTree)
 {
   this->DeleteAllItems();
+  modelElements.clear();
   if(projectTree != NULL)
     {
       wxTreeItemId rootIndex;
       rootIndex= this-> AddRoot(crea::std2wx(projectTree->GetName()));
       projectTree->SetId(rootIndex);
+      modelElements[rootIndex] = projectTree;
 
       std::cout << "Building TreeCtrl for " << projectTree->GetName() << std::endl;
-      this->BuildTree(projectTree->GetChildren(), rootIndex);
+      this->BuildTree(projectTree->GetChildren(), modelElements, rootIndex);
 
       this->Expand(rootIndex);
 
@@ -92,7 +94,7 @@ void wxCDMProjectsTreeCtrl::BuildTree(modelCDMProject* projectTree)
     }
 }
 
-void wxCDMProjectsTreeCtrl::BuildTree(const std::vector<modelCDMIProjectTreeNode*>& treeNodes, wxTreeItemId parent)
+void wxCDMProjectsTreeCtrl::BuildTree(const std::vector<modelCDMIProjectTreeNode*>& treeNodes, std::map< wxTreeItemId, modelCDMIProjectTreeNode* >& modelElements, wxTreeItemId parent)
 {
   for (int i = 0; i < treeNodes.size(); i++)
     {
@@ -103,11 +105,12 @@ void wxCDMProjectsTreeCtrl::BuildTree(const std::vector<modelCDMIProjectTreeNode
           wxString nodeName((treeNodes[i]->GetName()).c_str(), wxConvUTF8);
           parentNodeIndex = this->AppendItem(parent, nodeName);
           treeNodes[i]->SetId(parentNodeIndex);
+          modelElements[parentNodeIndex] = treeNodes[i];
 
           std::vector<modelCDMIProjectTreeNode*> innerChildren = treeNodes[i]->GetChildren();
           if(innerChildren.size() > 0)
             {
-              this->BuildTree(innerChildren, parentNodeIndex);
+              this->BuildTree(innerChildren, modelElements, parentNodeIndex);
             }
         }
 
index 7cf0887ca9d8e2d8197755c22b3d706348a8aec9..18649e0384e6c8aa32869134cdd79e856a432bfa 100755 (executable)
@@ -42,6 +42,7 @@
 #include "modelCDMIProjectTreeNode.h"
 
 #include <vector>
+#include <map>
 
 class wxCDMProjectsTreeCtrl: public wxTreeCtrl
 {
@@ -66,9 +67,9 @@ public:
     const wxString &name=_("Projects tree")
   );
 
-  void BuildTree(modelCDMProject* tree = NULL);
+  void BuildTree(std::map< wxTreeItemId, modelCDMIProjectTreeNode* >& modelElements, modelCDMProject* tree = NULL);
 private:
-  void BuildTree(const std::vector<modelCDMIProjectTreeNode*>& tree, wxTreeItemId parent);
+  void BuildTree(const std::vector<modelCDMIProjectTreeNode*>& tree, std::map< wxTreeItemId, modelCDMIProjectTreeNode* >& modelElements, wxTreeItemId parent);
 };
 
 #endif /* WXCDMPROJECTSTREECTRL_H_ */