Hi Fabio Manniti,
In addition to what Polina Suggested; you may also try to use existing list and tree widget with a add button.
Selected list item will give the child to be added and selected tree item will give the parent.
Then we can create a custom service (which takes the above parent and child) to add a new row with this. And we can add a button to call our custom service.
I hope it helps.