Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
16dd5f9f
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,发现更多精彩内容 >>
提交
16dd5f9f
编写于
10月 19, 2016
作者:
P
Pine Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up
上级
4cc76f54
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
24 addition
and
21 deletion
+24
-21
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+22
-19
src/vs/workbench/services/activity/common/activityService.ts
src/vs/workbench/services/activity/common/activityService.ts
+2
-2
未找到文件。
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
16dd5f9f
...
...
@@ -27,6 +27,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
export
class
ActivitybarPart
extends
Part
implements
IActivityService
{
public
_serviceBrand
:
any
;
private
viewletSwitcherBar
:
ActionBar
;
private
activityActionItems
:
{
[
actionId
:
string
]:
IActionItem
;
};
private
compositeIdToActions
:
{
[
compositeId
:
string
]:
ActivityAction
;
};
...
...
@@ -81,17 +82,6 @@ export class ActivitybarPart extends Part implements IActivityService {
this
.
viewletSwitcherBar
.
push
(
this
.
getAllEnabledExternalViewlets
().
map
(
d
=>
this
.
toAction
(
d
)),
{
label
:
true
,
icon
:
true
});
}
// Get an ordered list of all enabled external viewlets
private
getAllEnabledExternalViewlets
():
ViewletDescriptor
[]
{
const
externalViewletsToShow
:
ViewletDescriptor
[]
=
[];
this
.
enabledExternalViewlets
.
forEach
(
viewletId
=>
{
if
(
this
.
registeredViewlets
[
viewletId
])
{
externalViewletsToShow
.
push
(
this
.
registeredViewlets
[
viewletId
]);
}
});
return
externalViewletsToShow
;
}
private
onActiveCompositeChanged
(
composite
:
IComposite
):
void
{
if
(
this
.
compositeIdToActions
[
composite
.
getId
()])
{
this
.
compositeIdToActions
[
composite
.
getId
()].
activate
();
...
...
@@ -128,10 +118,6 @@ export class ActivitybarPart extends Part implements IActivityService {
this
.
storageService
.
store
(
ActivitybarPart
.
ENABLED_EXTERNAL_VIEWLETS
,
JSON
.
stringify
(
this
.
enabledExternalViewlets
));
}
getExternalViewletIdToOpen
():
string
{
return
this
.
externalViewletIdToOpen
;
}
public
showActivity
(
compositeId
:
string
,
badge
:
IBadge
,
clazz
?:
string
):
void
{
const
action
=
this
.
compositeIdToActions
[
compositeId
];
if
(
action
)
{
...
...
@@ -184,9 +170,20 @@ export class ActivitybarPart extends Part implements IActivityService {
this
.
viewletSwitcherBar
.
push
(
viewletActions
,
{
label
:
true
,
icon
:
true
});
}
// Get an ordered list of all enabled external viewlets
private
getAllEnabledExternalViewlets
():
ViewletDescriptor
[]
{
const
externalViewletsToShow
:
ViewletDescriptor
[]
=
[];
this
.
enabledExternalViewlets
.
forEach
(
viewletId
=>
{
if
(
this
.
registeredViewlets
[
viewletId
])
{
externalViewletsToShow
.
push
(
this
.
registeredViewlets
[
viewletId
]);
}
});
return
externalViewletsToShow
;
}
private
toAction
(
composite
:
ViewletDescriptor
):
ActivityAction
{
const
action
=
this
.
instantiationService
.
createInstance
(
ViewletActivityAction
,
composite
.
id
+
'
.activity-bar-action
'
,
composite
);
action
.
onOpenViewlet
((
viewletId
)
=>
{
action
.
onOpen
External
Viewlet
((
viewletId
)
=>
{
this
.
externalViewletIdToOpen
=
viewletId
;
});
...
...
@@ -196,6 +193,10 @@ export class ActivitybarPart extends Part implements IActivityService {
return
action
;
};
getExternalViewletIdToOpen
():
string
{
return
this
.
externalViewletIdToOpen
;
}
private
getKeybindingLabel
(
id
:
string
):
string
{
const
keys
=
this
.
keybindingService
.
lookupKeybindings
(
id
).
map
(
k
=>
this
.
keybindingService
.
getLabelFor
(
k
));
if
(
keys
&&
keys
.
length
)
{
...
...
@@ -219,8 +220,8 @@ class ViewletActivityAction extends ActivityAction {
private
static
preventDoubleClickDelay
=
300
;
private
lastRun
:
number
=
0
;
private
_onOpenViewlet
=
new
Emitter
<
string
>
();
get
onOpen
Viewlet
():
Event
<
string
>
{
return
this
.
_onOpen
Viewlet
.
event
;
};
private
_onOpen
External
Viewlet
=
new
Emitter
<
string
>
();
get
onOpen
ExternalViewlet
():
Event
<
string
>
{
return
this
.
_onOpenExternal
Viewlet
.
event
;
};
constructor
(
id
:
string
,
...
...
@@ -247,7 +248,9 @@ class ViewletActivityAction extends ActivityAction {
if
(
!
sideBarHidden
&&
activeViewlet
&&
activeViewlet
.
getId
()
===
this
.
viewlet
.
id
)
{
this
.
partService
.
setSideBarHidden
(
true
);
}
else
{
this
.
_onOpenViewlet
.
fire
(
this
.
viewlet
.
id
);
if
(
this
.
viewlet
.
isExternal
)
{
this
.
_onOpenExternalViewlet
.
fire
(
this
.
viewlet
.
id
);
}
this
.
viewletService
.
openViewlet
(
this
.
viewlet
.
id
,
true
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
activate
();
}
...
...
src/vs/workbench/services/activity/common/activityService.ts
浏览文件 @
16dd5f9f
...
...
@@ -72,12 +72,12 @@ export interface IActivityService {
clearActivity
(
compositeId
:
string
):
void
;
/**
* Get all registered viewlets and whether they are enabled/disabled.
* Get all registered
external
viewlets and whether they are enabled/disabled.
*/
getRegisteredViewletsIsEnabled
():
{
[
viewletId
:
string
]:
boolean
};
/**
* Enable/disable viewlet.
* Enable/disable
an external
viewlet.
*/
toggleViewlet
(
viewletId
:
string
):
void
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录