Skip to content

Commit

Permalink
drop: test onclick statusbar item
Browse files Browse the repository at this point in the history
Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto committed May 9, 2022
1 parent 3aa36d0 commit c6dd3f5
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// *****************************************************************************

import { injectable, inject } from '@theia/core/shared/inversify';
import { CommandRegistry, MenuModelRegistry } from '@theia/core/lib/common';
import { CommonMenus, AbstractViewContribution, FrontendApplicationContribution, FrontendApplication } from '@theia/core/lib/browser';
import { CommandRegistry, MenuModelRegistry, MessageService } from '@theia/core/lib/common';
import { CommonMenus, AbstractViewContribution, FrontendApplicationContribution, FrontendApplication, StatusBar, StatusBarAlignment } from '@theia/core/lib/browser';
import { GettingStartedWidget } from './getting-started-widget';
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
import { WorkspaceService } from '@theia/workspace/lib/browser';
Expand All @@ -35,6 +35,12 @@ export class GettingStartedContribution extends AbstractViewContribution<Getting
@inject(FrontendApplicationStateService)
protected readonly stateService: FrontendApplicationStateService;

@inject(MessageService)
protected readonly messageService: MessageService;

@inject(StatusBar)
protected readonly statusBar: StatusBar;

@inject(WorkspaceService)
protected readonly workspaceService: WorkspaceService;

Expand All @@ -60,6 +66,13 @@ export class GettingStartedContribution extends AbstractViewContribution<Getting
registry.registerCommand(GettingStartedCommand, {
execute: () => this.openView({ reveal: true }),
});
registry.registerCommand({ id: 'statusbar-test', label: 'StatusBar Test'}, {
execute: () => this.statusBar.setElement('statusbar-entry-id', {
text: 'StatusBar Test',
alignment: StatusBarAlignment.LEFT,
onclick: () => this.messageService.info('"onclick" works.')
})
});
}

override registerMenus(menus: MenuModelRegistry): void {
Expand Down

0 comments on commit c6dd3f5

Please sign in to comment.