| 35 | |
| 36 | @singleton() |
| 37 | export class ActivityBarController |
| 38 | extends Controller |
| 39 | implements IActivityBarController |
| 40 | { |
| 41 | private readonly activityBarService: IActivityBarService; |
| 42 | private readonly settingsService: ISettingsService; |
| 43 | private readonly monacoService: IMonacoService; |
| 44 | private readonly menuBarController: IMenuBarController; |
| 45 | private readonly builtinService: IBuiltinService; |
| 46 | |
| 47 | constructor() { |
| 48 | super(); |
| 49 | this.activityBarService = container.resolve(ActivityBarService); |
| 50 | this.settingsService = container.resolve(SettingsService); |
| 51 | this.monacoService = container.resolve(MonacoService); |
| 52 | this.menuBarController = container.resolve(MenuBarController); |
| 53 | this.builtinService = container.resolve(BuiltinService); |
| 54 | } |
| 55 | |
| 56 | public initView() { |
| 57 | const { activityBarData, contextMenuData } = |
| 58 | this.builtinService.getModules(); |
| 59 | if (activityBarData) { |
| 60 | this.activityBarService.add(activityBarData); |
| 61 | } |
| 62 | if (contextMenuData) { |
| 63 | this.activityBarService.addContextMenu(contextMenuData); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | public readonly onClick = ( |
| 68 | selectedKey: UniqueId, |
| 69 | selctedNode: IActivityBarItem |
| 70 | ) => { |
| 71 | this.emit(ActivityBarEvent.OnClick, selectedKey, selctedNode); |
| 72 | }; |
| 73 | |
| 74 | public readonly onChange = ( |
| 75 | prevSelected?: UniqueId, |
| 76 | nextSelected?: UniqueId |
| 77 | ) => { |
| 78 | this.emit(ActivityBarEvent.OnChange, prevSelected, nextSelected); |
| 79 | }; |
| 80 | |
| 81 | private gotoQuickCommand() { |
| 82 | this.monacoService.commandService.executeCommand( |
| 83 | CommandQuickAccessViewAction.ID |
| 84 | ); |
| 85 | } |
| 86 | |
| 87 | private onSelectColorTheme = () => { |
| 88 | this.monacoService.commandService.executeCommand( |
| 89 | SelectColorThemeAction.ID |
| 90 | ); |
| 91 | }; |
| 92 | |
| 93 | public readonly onContextMenuClick = ( |
| 94 | e: React.MouseEvent, |
nothing calls this directly
no test coverage detected