final TreePath[] selectionPaths = tree.getSelectionPaths();
for (int i = 0; selectionPaths != null && i < selectionPaths.length; i++) {
final DefaultMutableTreeNode node = (DefaultMutableTreeNode)selectionPaths[i].getLastPathComponent();
String selectedNode;
if (node.getUserObject() instanceof Descriptor) {
<BUG>selectedNode = ((Descriptor)node.getUserObject()).getText();
</BUG>
}
else {
selectedNode = (String)node.getUserObject();

final TreePath[] selectionPaths = tree.getSelectionPaths();
for (int i = 0; selectionPaths != null && i < selectionPaths.length; i++) {
final DefaultMutableTreeNode node = (DefaultMutableTreeNode)selectionPaths[i].getLastPathComponent();
String selectedNode;
if (node.getUserObject() instanceof Descriptor) {
selectedNode = ((Descriptor)node.getUserObject()).getKey().toString();
}
else {
selectedNode = (String)node.getUserObject();
