Added Edit_OnClick(), fixed issues MAGN4505

Issue:http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4505
@Benglin Please review it. Thanks
if menuItem is not null, is there a case that element is null ? @sharadkjaiswal