|
|
@@ -1,5 +1,10 @@
|
|
|
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
|
import { Command, CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core/lib/common';
|
|
|
+import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application-contribution';
|
|
|
+import { PreferenceContribution } from '@theia/core/lib/common/preferences/preference-schema';
|
|
|
+import { modula2UIPreferenceSchema } from './modula2-ui-preferences';
|
|
|
+import { Modula2ThemeCommands, SwitchThemeCommand, ToggleThemeCommand } from './modula2-theme-commands';
|
|
|
+import { Modula2UIFontContribution } from './modula2-ui-font-contribution';
|
|
|
|
|
|
const category = 'Modula-2';
|
|
|
|
|
|
@@ -10,7 +15,7 @@ const Commands = {
|
|
|
class CommandsContribution implements CommandContribution {
|
|
|
registerCommands(commands: CommandRegistry): void {
|
|
|
commands.registerCommand(Commands.about, {
|
|
|
- execute: () => window.alert('Modula-2 IDE\\n\\nGNU Modula-2 workbench for Eclipse Theia.')
|
|
|
+ execute: () => window.alert('Modula-2 IDE\n\nGNU Modula-2 workbench for Eclipse Theia.')
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
@@ -20,10 +25,15 @@ class MenusContribution implements MenuContribution {
|
|
|
const submenu = ['menubar', 'modula2'];
|
|
|
menus.registerSubmenu(submenu, 'Modula-2');
|
|
|
menus.registerMenuAction(submenu, { commandId: Commands.about.id });
|
|
|
+ menus.registerMenuAction(submenu, { commandId: SwitchThemeCommand.id });
|
|
|
+ menus.registerMenuAction(submenu, { commandId: ToggleThemeCommand.id });
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export default new ContainerModule(bind => {
|
|
|
+ bind(PreferenceContribution).toConstantValue({ schema: modula2UIPreferenceSchema });
|
|
|
bind(CommandContribution).to(CommandsContribution).inSingletonScope();
|
|
|
+ bind(CommandContribution).to(Modula2ThemeCommands).inSingletonScope();
|
|
|
+ bind(FrontendApplicationContribution).to(Modula2UIFontContribution).inSingletonScope();
|
|
|
bind(MenuContribution).to(MenusContribution).inSingletonScope();
|
|
|
});
|