Comment puis-je obtenir la chaîne de requête XPath correspondante à partir d'un TreePath sélectionné?javax.swing.tree.TreePath Sélection dans la chaîne de requête XPath
a
|-b
+-c
|-b
+-d
Si je sélectionne "d" Je veux obtenir quelque chose comme/a/b [2]/d
EDIT:. Pour l'instant, je voulais faire une boucle à travers le tree.getSelectionPath() toString() .split (",") mais l'information que vous obtiendrez est/a/b/d - vous ne pouvez pas comprendre que b devrait être b [2]
[Qu'avez-vous essayé] (http://whathaveyoutried.com)? –
@Eric Galluzzo: voir mon edit – KIC