Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f19446e6
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f19446e6
编写于
10月 19, 2016
作者:
P
Pine Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid re-rendering the tree when icon is clicked
上级
045aeddd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
7 deletion
+29
-7
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+20
-3
src/vs/workbench/parts/explorers/browser/treeExplorerViewlet.ts
.../workbench/parts/explorers/browser/treeExplorerViewlet.ts
+1
-0
src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts
...rkbench/parts/explorers/browser/views/treeExplorerView.ts
+2
-4
src/vs/workbench/services/activity/common/activityService.ts
src/vs/workbench/services/activity/common/activityService.ts
+6
-0
未找到文件。
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
f19446e6
...
...
@@ -34,6 +34,10 @@ export class ActivitybarPart extends Part implements IActivityService {
private
viewletsToggleStatus
:
{
[
viewletId
:
string
]:
boolean
;
};
private
registeredViewlets
:
string
[];
// Since the internal viewlet can't get the external viewlet's id upon initialization,
// internal viewlet initializes with id like 'workbench.view.customTreeExplorerViewlet.1'.
// This maps the internal viewlet id to externalId like 'workbench.view.customTreeExplorerViewlet.myTree'
private
internalViewletIdMap
:
{
[
externalViewletId
:
string
]:
string
;
};
private
externalViewletIdToOpen
:
string
;
private
VIEWLETS_TOGGLE_STATUS
=
'
workbench.activityBar.viewletsToggleStatus
'
;
...
...
@@ -56,6 +60,8 @@ export class ActivitybarPart extends Part implements IActivityService {
this
.
registeredViewlets
=
[];
this
.
internalViewletIdMap
=
{};
this
.
registerListeners
();
}
...
...
@@ -117,6 +123,10 @@ export class ActivitybarPart extends Part implements IActivityService {
return
this
.
externalViewletIdToOpen
;
}
setInternalViewletId
(
externalViewletId
:
string
,
internalViewletId
:
string
):
void
{
this
.
internalViewletIdMap
[
externalViewletId
]
=
internalViewletId
;
}
public
showActivity
(
compositeId
:
string
,
badge
:
IBadge
,
clazz
?:
string
):
void
{
const
action
=
this
.
compositeIdToActions
[
compositeId
];
if
(
action
)
{
...
...
@@ -174,7 +184,7 @@ export class ActivitybarPart extends Part implements IActivityService {
}
private
toAction
(
composite
:
ViewletDescriptor
):
ActivityAction
{
const
action
=
this
.
instantiationService
.
createInstance
(
ViewletActivityAction
,
composite
.
id
+
'
.activity-bar-action
'
,
composite
);
const
action
=
this
.
instantiationService
.
createInstance
(
ViewletActivityAction
,
composite
.
id
+
'
.activity-bar-action
'
,
composite
,
this
.
internalViewletIdMap
);
action
.
onOpenViewlet
((
viewletId
)
=>
{
this
.
externalViewletIdToOpen
=
viewletId
;
});
...
...
@@ -212,7 +222,9 @@ class ViewletActivityAction extends ActivityAction {
get
onOpenViewlet
():
Event
<
string
>
{
return
this
.
_onOpenViewlet
.
event
;
};
constructor
(
id
:
string
,
private
viewlet
:
ViewletDescriptor
,
id
:
string
,
private
viewlet
:
ViewletDescriptor
,
private
internalViewletIdMap
:
{
[
externalViewletId
:
string
]:
string
;
},
@
IViewletService
private
viewletService
:
IViewletService
,
@
IPartService
private
partService
:
IPartService
)
{
...
...
@@ -236,7 +248,12 @@ class ViewletActivityAction extends ActivityAction {
this
.
partService
.
setSideBarHidden
(
true
);
}
else
{
this
.
_onOpenViewlet
.
fire
(
this
.
viewlet
.
id
);
this
.
viewletService
.
openViewlet
(
this
.
viewlet
.
id
,
true
).
done
(
null
,
errors
.
onUnexpectedError
);
// If the viewlet is external and has been initialized, find the internal viewlet id for opening
if
(
this
.
viewlet
.
isExternal
&&
this
.
internalViewletIdMap
[
this
.
viewlet
.
id
])
{
this
.
viewletService
.
openViewlet
(
this
.
internalViewletIdMap
[
this
.
viewlet
.
id
],
true
).
done
(
null
,
errors
.
onUnexpectedError
);
}
else
{
this
.
viewletService
.
openViewlet
(
this
.
viewlet
.
id
,
true
).
done
(
null
,
errors
.
onUnexpectedError
);
}
this
.
activate
();
}
...
...
src/vs/workbench/parts/explorers/browser/treeExplorerViewlet.ts
浏览文件 @
f19446e6
...
...
@@ -38,6 +38,7 @@ export class TreeExplorerViewlet extends Viewlet {
this
.
externalViewletId
=
this
.
activityService
.
getExternalViewletIdToOpen
();
this
.
treeNodeProviderId
=
this
.
getTreeProviderName
(
this
.
externalViewletId
);
this
.
activityService
.
setInternalViewletId
(
this
.
externalViewletId
,
VIEWLET_ID_ROOT
+
TreeExplorerViewlet
.
_idCounter
);
TreeExplorerViewlet
.
_idCounter
++
;
}
...
...
src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts
浏览文件 @
f19446e6
...
...
@@ -90,13 +90,11 @@ export class TreeExplorerView extends CollapsibleViewletView {
}
create
():
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
return
this
.
updateInput
(
);
}
setVisible
(
visible
:
boolean
):
TPromise
<
void
>
{
return
super
.
setVisible
(
visible
).
then
(()
=>
{
this
.
updateInput
().
done
();
});
return
super
.
setVisible
(
visible
);
}
private
updateInput
():
TPromise
<
void
>
{
...
...
src/vs/workbench/services/activity/common/activityService.ts
浏览文件 @
f19446e6
...
...
@@ -85,4 +85,10 @@ export interface IActivityService {
* Get the external viewlet id to open
*/
getExternalViewletIdToOpen
():
string
;
/**
* Tell activitybar the internal viewlet id corresponding to the external viewlet id
* once the viewlet is initialized
*/
setInternalViewletId
(
externalViewletId
:
string
,
internalViewletId
:
string
):
void
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录