}
tree = new JTree(topNode);
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
tree.setBorder( new EmptyBorder(5, 5, 5, 5) );
tree.setCellRenderer(new DefaultTreeCellRenderer() {
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
if (value instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode defaultMutableTreeNode = (DefaultMutableTreeNode) value;
Object userObject = defaultMutableTreeNode.getUserObject();
if (userObject instanceof TopicInfo) {
TopicInfo topicInfo = (TopicInfo) userObject;
renderer.setIcon( topicInfo.subtopicCount == 0 ? ResourceManager.HELPTOPIC_ICON : ResourceManager.HELPDIR_ICON );
}
}
return renderer;
}
});
tree.addTreeSelectionListener(this);
htmlPane = new JEditorPane();
htmlPane.setEditable(false);
htmlPane.setContentType("text/html");
htmlPane.setEditorKit( new HTMLEditorKit() );
htmlPane.setBorder(new EmptyBorder(5, 5, 5, 5));
JSplitPane splitPane = new ProportionalSplitPane(JSplitPane.HORIZONTAL_SPLIT);
splitPane.setResizeWeight(0.0d);
splitPane.setBorder(null);