IAction action = findChildAction(contextMenu, "onClick -> onButtonClick");
assertNotNull(action);
assertSame(EventsPropertyUtils.LISTENER_METHOD_IMAGE_DESCRIPTOR, action.getImageDescriptor());
// run, no change expected
String expectedSource = getJavaSourceToAssert();
action.run();
assertEquals(expectedSource, getJavaSourceToAssert());
}
// add new method using action
{
IMenuManager manager2 = findChildMenuManager(contextMenu, "Add event handler");