@Override
	public void valueChanged(TreeSelectionEvent e) {
		if(component != null)
			editor.remove(component);
        
		DialogNode node = getSelectedNode();
		if(node == null)
			return;
		DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
		if(node.type == EnumNodeType.CATEGORY){
			DialogCategory category = (DialogCategory) node.getUserObject();
			editor.add(BorderLayout.CENTER, component = new GuiCategoryEdit((DefaultTreeModel)tree.getModel(), node, category));
		}
		else if(node.type == EnumNodeType.DIALOG){
			Dialog dialog = (Dialog) node.getUserObject();
			editor.add(BorderLayout.CENTER, component = new GuiDialogEdit((DefaultTreeModel)tree.getModel(), node, dialog));
		}
		else if(node.type == EnumNodeType.OPTION){
			DialogOption option = (DialogOption) node.getUserObject();
			editor.add(BorderLayout.CENTER, component = new GuiOptionEdit(tree, node, option));
		}
		editor.getContentPane().validate();
		editor.repaint();
	}