DefaultMutableTreeNode (final AntBuildTarget[] targets, final AntBuildFile buildFile, final DefaultMutableTreeNode buildFileNode) { DefaultMutableTreeNode result = null; for (AntBuildTarget target : targets) { if (target.getName() == null) continue; final AntTargetNodeDescriptor descriptor = new AntTargetNodeDescriptor(target, buildFile); final DefaultMutableTreeNode node = new DefaultMutableTreeNode(descriptor); if (isSelected(descriptor)){ result = node; } buildFileNode.add(node); } return result; }