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

fixes #16667

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