List of usage examples for javax.swing.tree AbstractLayoutCache getExpandedState
public abstract boolean getExpandedState(TreePath path);
From source file:ca.uhn.hl7v2.testpanel.ui.v2tree.Hl7V2MessageTree.java
private Set<String> getOpenPaths() { Set<String> retVal = new HashSet<String>(); TableModel model = getModel(); AbstractLayoutCache layout = ((OutlineModel) model).getLayout(); int messageIndex = -1; for (int i = 0; i < layout.getRowCount(); i++) { TreePath path = layout.getPathForRow(i); Object baseObj = path.getLastPathComponent(); if (baseObj instanceof TreeNodeMessage || baseObj instanceof TreeNodeUnknown) { messageIndex++;//from w ww . j a v a2 s. c o m if (layout.getExpandedState(path)) { retVal.add(Integer.toString(messageIndex)); } } else { baseObj = path.getPathComponent(path.getPathCount() - 2); if (baseObj instanceof TreeNodeBase) { retVal.add(Integer.toString(messageIndex) + ((TreeNodeBase) baseObj).getTerserPath()); } } } return retVal; }