Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2aadcb93
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,发现更多精彩内容 >>
提交
2aadcb93
编写于
10月 26, 2016
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #14527
上级
f8ecbf72
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
14 deletion
+32
-14
src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts
...ch/parts/extensions/electron-browser/extensionsActions.ts
+32
-14
未找到文件。
src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts
浏览文件 @
2aadcb93
...
@@ -278,24 +278,26 @@ export class DropDownMenuActionItem extends ActionItem {
...
@@ -278,24 +278,26 @@ export class DropDownMenuActionItem extends ActionItem {
private
disposables
:
IDisposable
[]
=
[];
private
disposables
:
IDisposable
[]
=
[];
private
_extension
:
IExtension
;
private
_extension
:
IExtension
;
constructor
(
action
:
IAction
,
private
menuAction
s
:
IAction
[],
private
contextMenuService
:
IContextMenuService
)
{
constructor
(
action
:
IAction
,
private
menuAction
Groups
:
IExtensionAction
[]
[],
private
contextMenuService
:
IContextMenuService
)
{
super
(
null
,
action
,
{
icon
:
true
,
label
:
true
});
super
(
null
,
action
,
{
icon
:
true
,
label
:
true
});
this
.
disposables
=
[...
menuActions
];
for
(
const
menuActions
of
menuActionGroups
)
{
this
.
disposables
=
[...
this
.
disposables
,
...
menuActions
];
}
}
}
get
extension
():
IExtension
{
return
this
.
_extension
;
}
get
extension
():
IExtension
{
return
this
.
_extension
;
}
set
extension
(
extension
:
IExtension
)
{
set
extension
(
extension
:
IExtension
)
{
this
.
_extension
=
extension
;
this
.
_extension
=
extension
;
for
(
const
menuAction
of
this
.
menuAction
s
)
{
for
(
const
menuAction
s
of
this
.
menuActionGroup
s
)
{
if
(
!
(
menuAction
instanceof
Separator
)
)
{
for
(
const
menuAction
of
menuActions
)
{
(
<
IExtensionAction
>
menuAction
)
.
extension
=
extension
;
menuAction
.
extension
=
extension
;
}
}
}
}
}
}
public
showMenu
():
void
{
public
showMenu
():
void
{
const
actions
=
this
.
menuActions
.
filter
(
a
=>
a
instanceof
Separator
||
a
.
enabled
);
const
actions
=
this
.
getActions
(
);
let
elementPosition
=
DOM
.
getDomNodePagePosition
(
this
.
builder
.
getHTMLElement
());
let
elementPosition
=
DOM
.
getDomNodePagePosition
(
this
.
builder
.
getHTMLElement
());
const
anchor
=
{
x
:
elementPosition
.
left
,
y
:
elementPosition
.
top
+
elementPosition
.
height
+
10
};
const
anchor
=
{
x
:
elementPosition
.
left
,
y
:
elementPosition
.
top
+
elementPosition
.
height
+
10
};
this
.
contextMenuService
.
showContextMenu
({
this
.
contextMenuService
.
showContextMenu
({
...
@@ -304,6 +306,17 @@ export class DropDownMenuActionItem extends ActionItem {
...
@@ -304,6 +306,17 @@ export class DropDownMenuActionItem extends ActionItem {
});
});
}
}
private
getActions
():
IAction
[]
{
let
actions
=
[];
for
(
const
menuActions
of
this
.
menuActionGroups
)
{
const
filtered
=
menuActions
.
filter
(
a
=>
a
.
enabled
);
if
(
filtered
.
length
>
0
)
{
actions
=
[...
actions
,
...
filtered
,
new
Separator
()];
}
}
return
actions
.
length
?
actions
.
slice
(
0
,
actions
.
length
-
1
)
:
actions
;
}
dispose
():
void
{
dispose
():
void
{
super
.
dispose
();
super
.
dispose
();
this
.
disposables
=
dispose
(
this
.
disposables
);
this
.
disposables
=
dispose
(
this
.
disposables
);
...
@@ -315,8 +328,13 @@ export class ManageExtensionActionItem extends DropDownMenuActionItem {
...
@@ -315,8 +328,13 @@ export class ManageExtensionActionItem extends DropDownMenuActionItem {
action
:
IAction
,
action
:
IAction
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IContextMenuService
contextMenuService
:
IContextMenuService
)
{
@
IContextMenuService
contextMenuService
:
IContextMenuService
)
{
super
(
action
,
[
instantiationService
.
createInstance
(
EnableForWorkspaceAction
,
localize
(
'
enableForWorkspaceAction.label
'
,
"
Enable (Workspace)
"
)),
instantiationService
.
createInstance
(
EnableGloballyAction
,
localize
(
'
enableAlwaysAction.label
'
,
"
Enable
"
)),
super
(
action
,
[
instantiationService
.
createInstance
(
DisableForWorkspaceAction
,
localize
(
'
disableForWorkspaceAction.label
'
,
"
Disable (Workspace)
"
)),
instantiationService
.
createInstance
(
DisableGloballyAction
,
localize
(
'
disableAlwaysAction.label
'
,
"
Disable
"
)),
new
Separator
(),
instantiationService
.
createInstance
(
UninstallAction
)],
contextMenuService
);
[
instantiationService
.
createInstance
(
EnableForWorkspaceAction
,
localize
(
'
enableForWorkspaceAction.label
'
,
"
Enable (Workspace)
"
)),
instantiationService
.
createInstance
(
EnableGloballyAction
,
localize
(
'
enableAlwaysAction.label
'
,
"
Enable
"
)),
instantiationService
.
createInstance
(
DisableForWorkspaceAction
,
localize
(
'
disableForWorkspaceAction.label
'
,
"
Disable (Workspace)
"
)),
instantiationService
.
createInstance
(
DisableGloballyAction
,
localize
(
'
disableAlwaysAction.label
'
,
"
Disable
"
))],
[
instantiationService
.
createInstance
(
UninstallAction
)]
],
contextMenuService
);
}
}
}
}
...
@@ -371,7 +389,7 @@ export class ManageExtensionAction extends Action {
...
@@ -371,7 +389,7 @@ export class ManageExtensionAction extends Action {
}
}
}
}
export
class
EnableForWorkspaceAction
extends
Action
{
export
class
EnableForWorkspaceAction
extends
Action
implements
IExtensionAction
{
static
ID
=
'
extensions.enableForWorkspace
'
;
static
ID
=
'
extensions.enableForWorkspace
'
;
static
LABEL
=
localize
(
'
enableForWorkspaceAction
'
,
"
Workspace
"
);
static
LABEL
=
localize
(
'
enableForWorkspaceAction
'
,
"
Workspace
"
);
...
@@ -412,7 +430,7 @@ export class EnableForWorkspaceAction extends Action {
...
@@ -412,7 +430,7 @@ export class EnableForWorkspaceAction extends Action {
}
}
}
}
export
class
EnableGloballyAction
extends
Action
{
export
class
EnableGloballyAction
extends
Action
implements
IExtensionAction
{
static
ID
=
'
extensions.enableGlobally
'
;
static
ID
=
'
extensions.enableGlobally
'
;
static
LABEL
=
localize
(
'
enableGloballyAction
'
,
"
Always
"
);
static
LABEL
=
localize
(
'
enableGloballyAction
'
,
"
Always
"
);
...
@@ -504,7 +522,7 @@ export class EnableAction extends Action {
...
@@ -504,7 +522,7 @@ export class EnableAction extends Action {
}
}
export
class
DisableForWorkspaceAction
extends
Action
{
export
class
DisableForWorkspaceAction
extends
Action
implements
IExtensionAction
{
static
ID
=
'
extensions.disableForWorkspace
'
;
static
ID
=
'
extensions.disableForWorkspace
'
;
static
LABEL
=
localize
(
'
disableForWorkspaceAction
'
,
"
Workspace
"
);
static
LABEL
=
localize
(
'
disableForWorkspaceAction
'
,
"
Workspace
"
);
...
@@ -543,7 +561,7 @@ export class DisableForWorkspaceAction extends Action {
...
@@ -543,7 +561,7 @@ export class DisableForWorkspaceAction extends Action {
}
}
}
}
export
class
DisableGloballyAction
extends
Action
{
export
class
DisableGloballyAction
extends
Action
implements
IExtensionAction
{
static
ID
=
'
extensions.disableGlobally
'
;
static
ID
=
'
extensions.disableGlobally
'
;
static
LABEL
=
localize
(
'
disableGloballyAction
'
,
"
Always
"
);
static
LABEL
=
localize
(
'
disableGloballyAction
'
,
"
Always
"
);
...
@@ -636,7 +654,7 @@ export class EnableActionItem extends DropDownMenuActionItem {
...
@@ -636,7 +654,7 @@ export class EnableActionItem extends DropDownMenuActionItem {
action
:
IAction
,
action
:
IAction
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IContextMenuService
contextMenuService
:
IContextMenuService
)
{
@
IContextMenuService
contextMenuService
:
IContextMenuService
)
{
super
(
action
,
[
instantiationService
.
createInstance
(
EnableForWorkspaceAction
,
EnableForWorkspaceAction
.
LABEL
),
instantiationService
.
createInstance
(
EnableGloballyAction
,
EnableGloballyAction
.
LABEL
)
],
contextMenuService
);
super
(
action
,
[
[
instantiationService
.
createInstance
(
EnableForWorkspaceAction
,
EnableForWorkspaceAction
.
LABEL
),
instantiationService
.
createInstance
(
EnableGloballyAction
,
EnableGloballyAction
.
LABEL
)]
],
contextMenuService
);
}
}
}
}
...
@@ -645,7 +663,7 @@ export class DisableActionItem extends DropDownMenuActionItem {
...
@@ -645,7 +663,7 @@ export class DisableActionItem extends DropDownMenuActionItem {
action
:
IAction
,
action
:
IAction
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IContextMenuService
contextMenuService
:
IContextMenuService
)
{
@
IContextMenuService
contextMenuService
:
IContextMenuService
)
{
super
(
action
,
[
instantiationService
.
createInstance
(
DisableForWorkspaceAction
,
DisableForWorkspaceAction
.
LABEL
),
instantiationService
.
createInstance
(
DisableGloballyAction
,
DisableGloballyAction
.
LABEL
)
],
contextMenuService
);
super
(
action
,
[
[
instantiationService
.
createInstance
(
DisableForWorkspaceAction
,
DisableForWorkspaceAction
.
LABEL
),
instantiationService
.
createInstance
(
DisableGloballyAction
,
DisableGloballyAction
.
LABEL
)]
],
contextMenuService
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录