Calling Display MenuItem:
new MenuFunction(menuItemDisplayStr(MyDisplayMenuItem), MenuItemType::Display).run();
Calling Output MenuItem:
new MenuFunction(menuItemOutputStr(MyOutputMenuItem), MenuItemType::Output).run();
Following code can be used to pass an argument to the menuitem:
Args args = new Args();
args.record(myArgumentRecord);
args.caller(this);
new MenuFunction(menuItemOutputStr(NameOfOutputMenuItem), MenuItemType::Output).run(args);