salut,
j'ai un souci avec les string, dans un treeview j'ai une méthode récursive avec la quelle je récupère le parent( sous forme d'un string) de mon treeviewItem en suite le parent du parent, et je stoque ces string d'un autre string ce qui me construit le chemin de mon treeviewItem.
mon problème est que je récupère que le premier parent et pas le chemin complet.
voila un petit extrat de mon fichier de log
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 private String getListParent(TreeViewItem currentItem, String path) { LOG.Debug("getlistParent started ....."); TreeViewItem parent = new TreeViewItem(); parent = getParentTreeViewItem(currentItem); String parentName = getNameOfParent(parent); path = parentName + "/" + path; if(!parentName.Equals("racine")) { getListParent(parent,path); } LOG.Debug("path in the end = " + path); return path; }
path in the end= racine/dossier1/fichier1/
path in the end = dossier1/fichier1/
path in the end = fichier1/
alors que le chemin correcte est celui ci : racine/dossier1/fichier1/
quelqu'un aurait une idée
merci
Partager