Add copy context menu in balancedialog.

Refactor balancedialog test.