提交 884bc1b3 编写于 作者: B Benjamin Pasero

fixes #16667

上级 1d17520a
...@@ -32,7 +32,9 @@ export class TreeExplorerViewlet extends Viewlet { ...@@ -32,7 +32,9 @@ export class TreeExplorerViewlet extends Viewlet {
this.viewletState = new TreeExplorerViewletState(); this.viewletState = new TreeExplorerViewletState();
this.viewletId = viewletId; this.viewletId = viewletId;
this.treeNodeProviderId = this.getTreeProviderName(viewletId);
const tokens = viewletId.split('.');
this.treeNodeProviderId = tokens[tokens.length - 1];
} }
public getId(): string { public getId(): string {
...@@ -63,19 +65,34 @@ export class TreeExplorerViewlet extends Viewlet { ...@@ -63,19 +65,34 @@ export class TreeExplorerViewlet extends Viewlet {
} }
private addTreeView(): void { private addTreeView(): void {
// Hide header (root node) by default const headerSize = 0; // Hide header (root node) by default
const headerSize = 0;
this.view = this.instantiationService.createInstance(TreeExplorerView, this.viewletState, this.treeNodeProviderId, this.getActionRunner(), headerSize); this.view = this.instantiationService.createInstance(TreeExplorerView, this.viewletState, this.treeNodeProviderId, this.getActionRunner(), headerSize);
this.view.render(this.viewletContainer.getHTMLElement(), Orientation.VERTICAL); this.view.render(this.viewletContainer.getHTMLElement(), Orientation.VERTICAL);
} }
private getTreeProviderName(viewletId: string): string { public focus(): void {
const tokens = viewletId.split('.'); super.focus();
return tokens[tokens.length - 1];
if (this.view) {
this.view.focusBody();
}
}
public shutdown(): void {
if (this.view) {
this.view.shutdown();
}
super.shutdown();
} }
public dispose(): void { public dispose(): void {
this.view = null; if (this.view) {
this.view = null;
this.view.dispose();
}
super.dispose();
} }
} }
...@@ -72,6 +72,7 @@ export class TreeExplorerView extends CollapsibleViewletView { ...@@ -72,6 +72,7 @@ export class TreeExplorerView extends CollapsibleViewletView {
public getActions(): IAction[] { public getActions(): IAction[] {
const refresh = this.instantiationService.createInstance(RefreshViewExplorerAction, this); const refresh = this.instantiationService.createInstance(RefreshViewExplorerAction, this);
return [refresh]; return [refresh];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册