mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Implement custom viewlet tile actions
This commit is contained in:
@@ -42,7 +42,7 @@ class TreeExplorerNodeProvider implements InternalTreeExplorerNodeProvider {
|
||||
readonly _onRefresh: Emitter<InternalTreeExplorerNodeContent> = new Emitter<InternalTreeExplorerNodeContent>();
|
||||
readonly onRefresh: Event<InternalTreeExplorerNodeContent> = this._onRefresh.event;
|
||||
|
||||
constructor(private providerId: string, private rootNode: InternalTreeExplorerNodeContent, private _proxy: ExtHostTreeShape,
|
||||
constructor(public readonly id: string, private rootNode: InternalTreeExplorerNodeContent, private _proxy: ExtHostTreeShape,
|
||||
private messageService: IMessageService,
|
||||
private commandService: ICommandService
|
||||
) {
|
||||
@@ -53,11 +53,11 @@ class TreeExplorerNodeProvider implements InternalTreeExplorerNodeProvider {
|
||||
}
|
||||
|
||||
resolveChildren(node: InternalTreeExplorerNodeContent): TPromise<InternalTreeExplorerNodeContent[]> {
|
||||
return this._proxy.$resolveChildren(this.providerId, node).then(children => children, err => this.messageService.show(Severity.Error, err));
|
||||
return this._proxy.$resolveChildren(this.id, node).then(children => children, err => this.messageService.show(Severity.Error, err));
|
||||
}
|
||||
|
||||
executeCommand(node: InternalTreeExplorerNodeContent): TPromise<any> {
|
||||
return this._proxy.$getInternalCommand(this.providerId, node).then(command => {
|
||||
return this._proxy.$getInternalCommand(this.id, node).then(command => {
|
||||
return this.commandService.executeCommand(command.id, ...command.arguments);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,22 +42,22 @@ class TreeExplorerNodeProvider implements InternalTreeExplorerNodeProvider {
|
||||
readonly _onRefresh: Emitter<InternalTreeExplorerNodeContent> = new Emitter<InternalTreeExplorerNodeContent>();
|
||||
readonly onRefresh: Event<InternalTreeExplorerNodeContent> = this._onRefresh.event;
|
||||
|
||||
constructor(private providerId: string, private _proxy: ExtHostTreeExplorersShape,
|
||||
constructor(public readonly id: string, private _proxy: ExtHostTreeExplorersShape,
|
||||
private messageService: IMessageService,
|
||||
private commandService: ICommandService
|
||||
) {
|
||||
}
|
||||
|
||||
provideRootNode(): TPromise<InternalTreeExplorerNodeContent> {
|
||||
return this._proxy.$provideRootNode(this.providerId).then(rootNode => rootNode, err => this.messageService.show(Severity.Error, err));
|
||||
return this._proxy.$provideRootNode(this.id).then(rootNode => rootNode, err => this.messageService.show(Severity.Error, err));
|
||||
}
|
||||
|
||||
resolveChildren(node: InternalTreeExplorerNodeContent): TPromise<InternalTreeExplorerNodeContent[]> {
|
||||
return this._proxy.$resolveChildren(this.providerId, node).then(children => children, err => this.messageService.show(Severity.Error, err));
|
||||
return this._proxy.$resolveChildren(this.id, node).then(children => children, err => this.messageService.show(Severity.Error, err));
|
||||
}
|
||||
|
||||
executeCommand(node: InternalTreeExplorerNodeContent): TPromise<any> {
|
||||
return this._proxy.$getInternalCommand(this.providerId, node).then(command => {
|
||||
return this._proxy.$getInternalCommand(this.id, node).then(command => {
|
||||
return this.commandService.executeCommand(command.id, ...command.arguments);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user