List<TreeNode> (Component parent) { List<TreeNode> result = new ArrayList<>(); if (parent instanceof JComponent) { DefaultMutableTreeNode node = ClientProperty.get(parent, UiInspectorAction.CLICK_INFO); if (node != null) { result.add(node); } } if (parent instanceof Container) { for (Component component : ((Container)parent).getComponents()) { result.add(createComponentNode(component)); } } if (parent instanceof Window) { Window[] children = ((Window)parent).getOwnedWindows(); for (Window child : children) { if (child instanceof InspectorWindow) continue; result.add(createComponentNode(child)); } } return result; }