-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwidget-frontend-module.ts
More file actions
52 lines (49 loc) · 1.76 KB
/
Copy pathwidget-frontend-module.ts
File metadata and controls
52 lines (49 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*******************************************************************************
* Copyright (C) 2021-2022 Wellness TechGroup
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* onelifedesigning - initial API and implementation
******************************************************************************/
import { ContainerModule } from '@theia/core/shared/inversify';
import { SmartCLIDEDeploymentWidget } from './widget-widget';
import { SmartCLIDEDeploymentWidgetContribution } from './widget-contribution';
import {
bindViewContribution,
FrontendApplicationContribution,
WidgetFactory,
} from '@theia/core/lib/browser';
import { WebSocketConnectionProvider } from '@theia/core/lib/browser';
import {
SmartCLIDEBackendService,
SMARTCLIDE_BACKEND_PATH,
} from '../common/protocol';
export default new ContainerModule((bind) => {
bindViewContribution(bind, SmartCLIDEDeploymentWidgetContribution);
bind(FrontendApplicationContribution).toService(
SmartCLIDEDeploymentWidgetContribution
);
bind(SmartCLIDEDeploymentWidget).toSelf();
bind(WidgetFactory)
.toDynamicValue((ctx) => ({
id: SmartCLIDEDeploymentWidget.ID,
createWidget: () =>
ctx.container.get<SmartCLIDEDeploymentWidget>(
SmartCLIDEDeploymentWidget
),
}))
.inSingletonScope();
bind(SmartCLIDEBackendService)
.toDynamicValue((ctx) => {
const connection = ctx.container.get(WebSocketConnectionProvider);
return connection.createProxy<SmartCLIDEBackendService>(
SMARTCLIDE_BACKEND_PATH
);
})
.inSingletonScope();
});