/**
* Sets the tree up
*/
private void setupTree() {
root = new DefaultMutableTreeNode(resources.getString("preferences"));
topNode = new DefaultMutableTreeNode(resources.getString("preferences"));
root.add(topNode);
DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer() {
public Component getTreeCellRendererComponent(JTree tree,
Object value, boolean sel, boolean expanded, boolean leaf,
int row, boolean hasFocus) {
super.getTreeCellRendererComponent(tree, value, sel, expanded,
leaf, row, hasFocus);
DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
setText(((String) node.getUserObject()).replaceAll("^a\\d+ ",
""));
return this;
}
};
renderer.setLeafIcon(null);
Iterator i = prefsDialog.getPanels().keySet().iterator();
while (i.hasNext()) {
topNode.add(new DefaultMutableTreeNode((String) i.next()));
}
TreeMap plugins = PreferencesDialog.getPluginPanels();
if (plugins.size() > 0) {
pluginsNode = new DefaultMutableTreeNode(resources
.getString("pluginPreferences"));
i = plugins.keySet().iterator();
while (i.hasNext()) {
pluginsNode.add(new DefaultMutableTreeNode((String) i.next()));
}
root.add(pluginsNode);
}
tree = new JTree(root);