Add setLegend() and bind action buttons.
You can set different action buttons for edit process