ATL-374: Refactored the Output services.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2020-09-15 18:00:17 +02:00
committed by Akos Kitta
parent f26dae185b
commit 5f5193932f
53 changed files with 829 additions and 948 deletions

View File

@@ -10,17 +10,13 @@ import { Searchable } from '../../../common/protocol/searchable';
import { ArduinoComponent } from '../../../common/protocol/arduino-component';
import { FilterableListContainer } from './filterable-list-container';
import { ListItemRenderer } from './list-item-renderer';
import { CoreServiceClientImpl } from '../../core-service-client-impl';
import { ArduinoDaemonClientImpl } from '../../arduino-daemon-client-impl';
import { NotificationCenter } from '../../notification-center';
@injectable()
export abstract class ListWidget<T extends ArduinoComponent> extends ReactWidget {
@inject(CoreServiceClientImpl)
protected readonly coreServiceClient: CoreServiceClientImpl;
@inject(ArduinoDaemonClientImpl)
protected readonly daemonClient: ArduinoDaemonClientImpl;
@inject(NotificationCenter)
protected readonly notificationCenter: NotificationCenter;
/**
* Do not touch or use it. It is for setting the focus on the `input` after the widget activation.
@@ -49,9 +45,9 @@ export abstract class ListWidget<T extends ArduinoComponent> extends ReactWidget
protected init(): void {
this.update();
this.toDispose.pushAll([
this.coreServiceClient.onIndexUpdated(() => this.refresh(undefined)),
this.daemonClient.onDaemonStarted(() => this.refresh(undefined)),
this.daemonClient.onDaemonStopped(() => this.refresh(undefined))
this.notificationCenter.onIndexUpdated(() => this.refresh(undefined)),
this.notificationCenter.onDaemonStarted(() => this.refresh(undefined)),
this.notificationCenter.onDaemonStopped(() => this.refresh(undefined))
]);
}