Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
be5d59a7
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
be5d59a7
编写于
6月 08, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Return view in openView API
上级
cc5c1030
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
29 addition
and
25 deletion
+29
-25
src/vs/workbench/browser/parts/views/panelViewlet.ts
src/vs/workbench/browser/parts/views/panelViewlet.ts
+2
-1
src/vs/workbench/browser/parts/views/views.ts
src/vs/workbench/browser/parts/views/views.ts
+2
-7
src/vs/workbench/browser/parts/views/viewsViewlet.ts
src/vs/workbench/browser/parts/views/viewsViewlet.ts
+5
-7
src/vs/workbench/common/views.ts
src/vs/workbench/common/views.ts
+8
-2
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
+12
-8
未找到文件。
src/vs/workbench/browser/parts/views/panelViewlet.ts
浏览文件 @
be5d59a7
...
...
@@ -27,6 +27,7 @@ import { PanelView, IPanelViewOptions, IPanelOptions, Panel } from 'vs/base/brow
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
IView
}
from
'
vs/workbench/common/views
'
;
export
interface
IPanelColors
extends
IColorMapping
{
dropBackground
?:
ColorIdentifier
;
...
...
@@ -41,7 +42,7 @@ export interface IViewletPanelOptions extends IPanelOptions {
title
:
string
;
}
export
abstract
class
ViewletPanel
extends
Panel
{
export
abstract
class
ViewletPanel
extends
Panel
implements
IView
{
private
static
AlwaysShowActionsConfig
=
'
workbench.view.alwaysShowHeaderActions
'
;
...
...
src/vs/workbench/browser/parts/views/views.ts
浏览文件 @
be5d59a7
...
...
@@ -7,7 +7,7 @@ import 'vs/css!./media/views';
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IViewsService
,
ViewsRegistry
,
IViewsViewlet
,
ViewContainer
,
IViewDescriptor
,
IViewContainersRegistry
,
Extensions
as
ViewContainerExtensions
,
TEST_VIEW_CONTAINER_ID
}
from
'
vs/workbench/common/views
'
;
import
{
IViewsService
,
ViewsRegistry
,
IViewsViewlet
,
ViewContainer
,
IViewDescriptor
,
IViewContainersRegistry
,
Extensions
as
ViewContainerExtensions
,
TEST_VIEW_CONTAINER_ID
,
IView
}
from
'
vs/workbench/common/views
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
ViewletRegistry
,
Extensions
as
ViewletExtensions
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
...
...
@@ -173,11 +173,6 @@ class ViewDescriptorCollection extends Disposable {
}
}
export
interface
IView
{
viewDescriptor
:
IViewDescriptor
;
visible
:
boolean
;
}
export
interface
IViewState
{
visible
:
boolean
;
collapsed
:
boolean
;
...
...
@@ -510,7 +505,7 @@ export class ViewsService extends Disposable implements IViewsService {
this
.
_register
(
Registry
.
as
<
ViewletRegistry
>
(
ViewletExtensions
.
Viewlets
).
onDidRegister
(
viewlet
=>
this
.
viewletService
.
setViewletEnablement
(
viewlet
.
id
,
this
.
storageService
.
getBoolean
(
`viewservice.
${
viewlet
.
id
}
.enablement`
,
StorageScope
.
GLOBAL
,
viewlet
.
id
!==
TEST_VIEW_CONTAINER_ID
))));
}
openView
(
id
:
string
,
focus
:
boolean
):
TPromise
<
void
>
{
openView
(
id
:
string
,
focus
:
boolean
):
TPromise
<
IView
>
{
const
viewDescriptor
=
ViewsRegistry
.
getView
(
id
);
if
(
viewDescriptor
)
{
const
viewletDescriptor
=
this
.
viewletService
.
getViewlet
(
viewDescriptor
.
container
.
id
);
...
...
src/vs/workbench/browser/parts/views/viewsViewlet.ts
浏览文件 @
be5d59a7
...
...
@@ -13,7 +13,7 @@ import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import
{
firstIndex
}
from
'
vs/base/common/arrays
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IViewDescriptor
,
IViewsViewlet
,
IViewContainersRegistry
,
Extensions
as
ViewContainerExtensions
}
from
'
vs/workbench/common/views
'
;
import
{
IViewDescriptor
,
IViewsViewlet
,
IViewContainersRegistry
,
Extensions
as
ViewContainerExtensions
,
IView
}
from
'
vs/workbench/common/views
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -198,7 +198,7 @@ export abstract class ViewContainerViewlet extends PanelViewlet implements IView
.
then
(()
=>
void
0
);
}
openView
(
id
:
string
,
focus
?:
boolean
):
TPromise
<
void
>
{
openView
(
id
:
string
,
focus
?:
boolean
):
TPromise
<
IView
>
{
if
(
focus
)
{
this
.
focus
();
}
...
...
@@ -207,11 +207,9 @@ export abstract class ViewContainerViewlet extends PanelViewlet implements IView
this
.
toggleViewVisibility
(
id
);
}
view
=
this
.
getView
(
id
);
if
(
view
)
{
view
.
setExpanded
(
true
);
view
.
focus
();
}
return
TPromise
.
as
(
null
);
view
.
setExpanded
(
true
);
view
.
focus
();
return
TPromise
.
as
(
view
);
}
movePanel
(
from
:
ViewletPanel
,
to
:
ViewletPanel
):
void
{
...
...
src/vs/workbench/common/views.ts
浏览文件 @
be5d59a7
...
...
@@ -194,9 +194,15 @@ export const ViewsRegistry: IViewsRegistry = new class implements IViewsRegistry
}
};
export
interface
IView
{
readonly
id
:
string
;
}
export
interface
IViewsViewlet
extends
IViewlet
{
openView
(
id
:
string
,
focus
?:
boolean
):
TPromise
<
void
>
;
openView
(
id
:
string
,
focus
?:
boolean
):
TPromise
<
IView
>
;
}
...
...
@@ -205,7 +211,7 @@ export const IViewsService = createDecorator<IViewsService>('viewsService');
export
interface
IViewsService
{
_serviceBrand
:
any
;
openView
(
id
:
string
,
focus
?:
boolean
):
TPromise
<
void
>
;
openView
(
id
:
string
,
focus
?:
boolean
):
TPromise
<
IView
>
;
}
// Custom views
...
...
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
be5d59a7
...
...
@@ -57,7 +57,7 @@ import { ThrottledDelayer } from 'vs/base/common/async';
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IViewDescriptorRef
,
PersistentContributableViewsModel
,
IAddedViewDescriptorRef
}
from
'
vs/workbench/browser/parts/views/views
'
;
import
{
IViewDescriptor
,
IViewsViewlet
}
from
'
vs/workbench/common/views
'
;
import
{
IViewDescriptor
,
IViewsViewlet
,
IView
}
from
'
vs/workbench/common/views
'
;
import
{
IPanelDndController
,
Panel
}
from
'
vs/base/browser/ui/splitview/panelview
'
;
export
interface
ISpliceEvent
<
T
>
{
...
...
@@ -1473,14 +1473,18 @@ export class SCMViewlet extends PanelViewlet implements IViewModel, IViewsViewle
return
super
.
isSingleView
()
&&
this
.
repositoryPanels
.
length
+
this
.
contributedViews
.
visibleViewDescriptors
.
length
===
1
;
}
openView
(
id
:
string
,
focus
?:
boolean
):
TPromise
<
void
>
{
this
.
contributedViews
.
setVisible
(
id
,
true
);
const
panel
=
this
.
panels
.
filter
(
panel
=>
panel
instanceof
ViewletPanel
&&
panel
.
id
===
id
)[
0
];
if
(
panel
)
{
panel
.
setExpanded
(
true
);
panel
.
focus
();
openView
(
id
:
string
,
focus
?:
boolean
):
TPromise
<
IView
>
{
if
(
focus
)
{
this
.
focus
();
}
return
TPromise
.
as
(
null
);
let
panel
=
this
.
panels
.
filter
(
panel
=>
panel
instanceof
ViewletPanel
&&
panel
.
id
===
id
)[
0
];
if
(
!
panel
)
{
this
.
contributedViews
.
setVisible
(
id
,
true
);
}
panel
=
this
.
panels
.
filter
(
panel
=>
panel
instanceof
ViewletPanel
&&
panel
.
id
===
id
)[
0
];
panel
.
setExpanded
(
true
);
panel
.
focus
();
return
TPromise
.
as
(
panel
);
}
hide
(
repository
:
ISCMRepository
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录