@Override
public JMenuItem getMenuPresenter() {
JMenu menu = new JMenu(NbBundle.getMessage(Generate.class, "CTL_Generate"));
final GeneratorController generatorController = Lookup.getDefault().lookup(GeneratorController.class);
if (generatorController != null) {
for (final Generator gen : generatorController.getGenerators()) {
String menuName = gen.getName() + "...";
JMenuItem menuItem = new JMenuItem(new AbstractAction(menuName) {
public void actionPerformed(ActionEvent e) {
generatorController.generate(gen);
}
});
menu.add(menuItem);
}
}