props.put("mode", new String[] { MModeController.MODENAME /*TODO: other modes too?*/});
context.registerService(IModeControllerExtensionProvider.class.getName(),
new IModeControllerExtensionProvider() {
@Override
public void installExtension(ModeController modeController) {
final MenuBuilder menuBuilder = modeController.getUserInputListenerFactory().getMenuBuilder(MenuBuilder.class);
final $$$$Action action = new $$$$Action();
modeController.addAction(action);
modeController.addMenuContributor(new IMenuContributor() {
@Override
public void updateMenus(ModeController modeController, MenuBuilder builder) {
menuBuilder.addAction("/menu_bar/file", action, MenuBuilder.AS_CHILD);
}
});
}
/*TODO: further initializations*/}, props);
}