Я хочу найти, что метод как isNodeExpanded () проверяет, расширен ли данный узел JTree или нет, но я не могу найти его.
Я знаю, что могу сделать это путем отслеживания расширения узла с TreeExpansionListener. Существует ли лучший путь?
JTree.java:
/**
* Returns true if the node identified by the path is currently expanded,
*
* @param path the <code>TreePath</code> specifying the node to check
* @return false if any of the nodes in the node's path are collapsed,
* true if all nodes in the path are expanded
*/
public boolean isExpanded(TreePath path);
Beautiful, JavaDoc: -)
Расширенное состояние узла - не в TreeModel
, а в JTree
.