FileTemplate () { final TreePath selectionPath = myTree.getSelectionPath(); if (selectionPath == null) { return null; } final FileTemplateNode node = (FileTemplateNode)selectionPath.getLastPathComponent(); return getTemplate(node); }