Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6483a2df
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,发现更多精彩内容 >>
提交
6483a2df
编写于
1月 22, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
panel: share close panel action
上级
3611a725
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
10 deletion
+22
-10
src/vs/workbench/browser/parts/compositePart.ts
src/vs/workbench/browser/parts/compositePart.ts
+13
-1
src/vs/workbench/browser/parts/panel/panelPart.ts
src/vs/workbench/browser/parts/panel/panelPart.ts
+7
-3
src/vs/workbench/parts/debug/browser/repl.ts
src/vs/workbench/parts/debug/browser/repl.ts
+1
-3
src/vs/workbench/parts/output/browser/outputPanel.ts
src/vs/workbench/parts/output/browser/outputPanel.ts
+1
-3
未找到文件。
src/vs/workbench/browser/parts/compositePart.ts
浏览文件 @
6483a2df
...
@@ -38,7 +38,7 @@ import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingServic
...
@@ -38,7 +38,7 @@ import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingServic
export
abstract
class
CompositePart
<
T
extends
Composite
>
extends
Part
{
export
abstract
class
CompositePart
<
T
extends
Composite
>
extends
Part
{
pr
ivate
instantiationService
:
IInstantiationService
;
pr
otected
instantiationService
:
IInstantiationService
;
private
activeCompositeListeners
:
{
():
void
;
}[];
private
activeCompositeListeners
:
{
():
void
;
}[];
private
instantiatedCompositeListeners
:
{
():
void
;
}[];
private
instantiatedCompositeListeners
:
{
():
void
;
}[];
private
mapCompositeToCompositeContainer
:
{
[
compositeId
:
string
]:
Builder
;
};
private
mapCompositeToCompositeContainer
:
{
[
compositeId
:
string
]:
Builder
;
};
...
@@ -365,6 +365,10 @@ export abstract class CompositePart<T extends Composite> extends Part {
...
@@ -365,6 +365,10 @@ export abstract class CompositePart<T extends Composite> extends Part {
let
primaryActions
:
IAction
[]
=
composite
.
getActions
();
let
primaryActions
:
IAction
[]
=
composite
.
getActions
();
let
secondaryActions
:
IAction
[]
=
composite
.
getSecondaryActions
();
let
secondaryActions
:
IAction
[]
=
composite
.
getSecondaryActions
();
// From Part
primaryActions
.
push
(...
this
.
getActions
());
secondaryActions
.
push
(...
this
.
getSecondaryActions
());
// From Contributions
// From Contributions
let
actionBarRegistry
=
<
IActionBarRegistry
>
Registry
.
as
(
Extensions
.
Actionbar
);
let
actionBarRegistry
=
<
IActionBarRegistry
>
Registry
.
as
(
Extensions
.
Actionbar
);
primaryActions
.
push
(...
actionBarRegistry
.
getActionBarActionsForContext
(
this
.
actionContributionScope
,
composite
));
primaryActions
.
push
(...
actionBarRegistry
.
getActionBarActionsForContext
(
this
.
actionContributionScope
,
composite
));
...
@@ -474,6 +478,14 @@ export abstract class CompositePart<T extends Composite> extends Part {
...
@@ -474,6 +478,14 @@ export abstract class CompositePart<T extends Composite> extends Part {
this
.
messageService
.
show
(
Severity
.
Error
,
types
.
isString
(
error
)
?
new
Error
(
error
)
:
error
);
this
.
messageService
.
show
(
Severity
.
Error
,
types
.
isString
(
error
)
?
new
Error
(
error
)
:
error
);
}
}
protected
getActions
():
IAction
[]
{
return
[];
}
protected
getSecondaryActions
():
IAction
[]
{
return
[];
}
public
layout
(
dimension
:
Dimension
):
Dimension
[]
{
public
layout
(
dimension
:
Dimension
):
Dimension
[]
{
// Pass to super
// Pass to super
...
...
src/vs/workbench/browser/parts/panel/panelPart.ts
浏览文件 @
6483a2df
...
@@ -8,7 +8,7 @@ import nls = require('vs/nls');
...
@@ -8,7 +8,7 @@ import nls = require('vs/nls');
import
{
TPromise
,
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
,
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
KeyMod
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyMod
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
Builder
}
from
'
vs/base/browser/builder
'
;
import
{
Builder
}
from
'
vs/base/browser/builder
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Scope
}
from
'
vs/workbench/browser/actionBarRegistry
'
;
import
{
Scope
}
from
'
vs/workbench/browser/actionBarRegistry
'
;
...
@@ -92,6 +92,10 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
...
@@ -92,6 +92,10 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
return
this
.
showComposite
(
panel
);
return
this
.
showComposite
(
panel
);
}
}
protected
getActions
():
IAction
[]
{
return
[
this
.
instantiationService
.
createInstance
(
ClosePanelAction
,
ClosePanelAction
.
ID
,
ClosePanelAction
.
LABEL
)]
}
public
getActivePanel
():
IPanel
{
public
getActivePanel
():
IPanel
{
return
this
.
getActiveComposite
();
return
this
.
getActiveComposite
();
}
}
...
@@ -106,7 +110,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
...
@@ -106,7 +110,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
}
}
export
class
ClosePanelAction
extends
Action
{
class
ClosePanelAction
extends
Action
{
static
ID
=
'
workbench.action.closePanel
'
;
static
ID
=
'
workbench.action.closePanel
'
;
static
LABEL
=
nls
.
localize
(
'
closePanel
'
,
"
Close
"
);
static
LABEL
=
nls
.
localize
(
'
closePanel
'
,
"
Close
"
);
...
@@ -124,7 +128,7 @@ export class ClosePanelAction extends Action {
...
@@ -124,7 +128,7 @@ export class ClosePanelAction extends Action {
}
}
}
}
export
class
TogglePanelAction
extends
Action
{
class
TogglePanelAction
extends
Action
{
static
ID
=
'
workbench.action.togglePanel
'
;
static
ID
=
'
workbench.action.togglePanel
'
;
static
LABEL
=
nls
.
localize
(
'
togglePanel
'
,
"
Toggle Panel Visibility
"
);
static
LABEL
=
nls
.
localize
(
'
togglePanel
'
,
"
Toggle Panel Visibility
"
);
...
...
src/vs/workbench/parts/debug/browser/repl.ts
浏览文件 @
6483a2df
...
@@ -18,7 +18,6 @@ import debug = require('vs/workbench/parts/debug/common/debug');
...
@@ -18,7 +18,6 @@ import debug = require('vs/workbench/parts/debug/common/debug');
import
debugactions
=
require
(
'
vs/workbench/parts/debug/electron-browser/debugActions
'
);
import
debugactions
=
require
(
'
vs/workbench/parts/debug/electron-browser/debugActions
'
);
import
replhistory
=
require
(
'
vs/workbench/parts/debug/common/replHistory
'
);
import
replhistory
=
require
(
'
vs/workbench/parts/debug/common/replHistory
'
);
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
import
{
ClosePanelAction
}
from
'
vs/workbench/browser/parts/panel/panelPart
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IContextViewService
,
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IContextViewService
,
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
...
@@ -162,8 +161,7 @@ export class Repl extends Panel {
...
@@ -162,8 +161,7 @@ export class Repl extends Panel {
public
getActions
():
actions
.
IAction
[]
{
public
getActions
():
actions
.
IAction
[]
{
if
(
!
this
.
actions
)
{
if
(
!
this
.
actions
)
{
this
.
actions
=
[
this
.
actions
=
[
this
.
instantiationService
.
createInstance
(
debugactions
.
ClearReplAction
,
debugactions
.
ClearReplAction
.
ID
,
debugactions
.
ClearReplAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
debugactions
.
ClearReplAction
,
debugactions
.
ClearReplAction
.
ID
,
debugactions
.
ClearReplAction
.
LABEL
)
this
.
instantiationService
.
createInstance
(
ClosePanelAction
,
ClosePanelAction
.
ID
,
ClosePanelAction
.
LABEL
)
];
];
this
.
actions
.
forEach
(
a
=>
{
this
.
actions
.
forEach
(
a
=>
{
...
...
src/vs/workbench/parts/output/browser/outputPanel.ts
浏览文件 @
6483a2df
...
@@ -22,7 +22,6 @@ import {OUTPUT_PANEL_ID, IOutputService} from 'vs/workbench/parts/output/common/
...
@@ -22,7 +22,6 @@ import {OUTPUT_PANEL_ID, IOutputService} from 'vs/workbench/parts/output/common/
import
{
OutputEditorInput
}
from
'
vs/workbench/parts/output/common/outputEditorInput
'
;
import
{
OutputEditorInput
}
from
'
vs/workbench/parts/output/common/outputEditorInput
'
;
import
{
SwitchOutputAction
,
SwitchOutputActionItem
,
ClearOutputAction
}
from
'
vs/workbench/parts/output/browser/outputActions
'
;
import
{
SwitchOutputAction
,
SwitchOutputActionItem
,
ClearOutputAction
}
from
'
vs/workbench/parts/output/browser/outputActions
'
;
import
{
IWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
ClosePanelAction
}
from
'
vs/workbench/browser/parts/panel/panelPart
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
export
class
OutputPanel
extends
StringEditor
{
export
class
OutputPanel
extends
StringEditor
{
...
@@ -55,8 +54,7 @@ export class OutputPanel extends StringEditor {
...
@@ -55,8 +54,7 @@ export class OutputPanel extends StringEditor {
if
(
!
this
.
actions
)
{
if
(
!
this
.
actions
)
{
this
.
actions
=
[
this
.
actions
=
[
this
.
instantiationService
.
createInstance
(
SwitchOutputAction
),
this
.
instantiationService
.
createInstance
(
SwitchOutputAction
),
this
.
instantiationService
.
createInstance
(
ClearOutputAction
),
this
.
instantiationService
.
createInstance
(
ClearOutputAction
)
this
.
instantiationService
.
createInstance
(
ClosePanelAction
,
ClosePanelAction
.
ID
,
ClosePanelAction
.
LABEL
)
];
];
this
.
actions
.
forEach
(
a
=>
{
this
.
actions
.
forEach
(
a
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录