private void initSelection() {
        this.getSelectionModel().setSelectionMode(
                TreeSelectionModel.SINGLE_TREE_SELECTION);
        this.addTreeSelectionListener(new TreeSelectionListener() {
            @Override
            public void valueChanged(TreeSelectionEvent e) {
                DefaultMutableTreeNode selectedNode =
                        (DefaultMutableTreeNode) getLastSelectedPathComponent();
                if (selectedNode == null) {
                    return;
                }

                if (selectedNode.isLeaf()) {
                    selectedClass = getClassFromNode(selectedNode);
                }
            }
        });
    }