Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3dad25db
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,发现更多精彩内容 >>
提交
3dad25db
编写于
4月 19, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grid - scaffold more things wip
上级
025af255
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
83 addition
and
8 deletion
+83
-8
src/vs/workbench/browser/parts/editor2/nextEditorPart.ts
src/vs/workbench/browser/parts/editor2/nextEditorPart.ts
+19
-6
src/vs/workbench/browser/parts/editor2/nextEditorViewer.ts
src/vs/workbench/browser/parts/editor2/nextEditorViewer.ts
+62
-0
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+1
-1
src/vs/workbench/services/editor/common/editorService.ts
src/vs/workbench/services/editor/common/editorService.ts
+1
-1
未找到文件。
src/vs/workbench/browser/parts/editor2/nextEditorPart.ts
浏览文件 @
3dad25db
...
@@ -17,6 +17,7 @@ import { join } from 'vs/base/common/paths';
...
@@ -17,6 +17,7 @@ import { join } from 'vs/base/common/paths';
import
{
editorBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
editorBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
INextEditorPartService
}
from
'
vs/workbench/services/editor/common/nextEditorPartService
'
;
import
{
INextEditorPartService
}
from
'
vs/workbench/services/editor/common/nextEditorPartService
'
;
import
{
EditorInput
,
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
EditorInput
,
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
NextEditorViewer
,
GridOrientation
}
from
'
./nextEditorViewer
'
;
// import { IStorageService } from 'vs/platform/storage/common/storage';
// import { IStorageService } from 'vs/platform/storage/common/storage';
export
class
NextEditorPart
extends
Part
implements
INextEditorPartService
{
export
class
NextEditorPart
extends
Part
implements
INextEditorPartService
{
...
@@ -28,6 +29,8 @@ export class NextEditorPart extends Part implements INextEditorPartService {
...
@@ -28,6 +29,8 @@ export class NextEditorPart extends Part implements INextEditorPartService {
// private dimension: Dimension;
// private dimension: Dimension;
// private memento: object;
// private memento: object;
private
viewer
:
NextEditorViewer
;
constructor
(
constructor
(
id
:
string
,
id
:
string
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
...
@@ -40,13 +43,18 @@ export class NextEditorPart extends Part implements INextEditorPartService {
...
@@ -40,13 +43,18 @@ export class NextEditorPart extends Part implements INextEditorPartService {
// this.memento = this.getMemento(this.storageService, Scope.WORKSPACE);
// this.memento = this.getMemento(this.storageService, Scope.WORKSPACE);
this
.
viewer
=
new
NextEditorViewer
();
this
.
initStyles
();
this
.
initStyles
();
}
}
public
openEditor
(
input
:
EditorInput
,
options
?:
EditorOptions
):
TPromise
<
void
>
{
public
openEditor
(
input
:
EditorInput
,
options
?:
EditorOptions
):
TPromise
<
void
>
{
console
.
log
(
'
open:
'
,
input
);
return
TPromise
.
as
(
void
0
);
// TODO@grid arguments validation
// TODO@grid editor opening event and prevention
// TODO@grid support options
return
this
.
viewer
.
split
([],
GridOrientation
.
HORIZONTAL
,
input
,
options
);
}
}
private
initStyles
():
void
{
private
initStyles
():
void
{
...
@@ -64,7 +72,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
...
@@ -64,7 +72,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
const
container
=
this
.
getContainer
();
const
container
=
this
.
getContainer
();
container
.
style
.
backgroundColor
=
this
.
getColor
(
editorBackground
);
container
.
style
.
backgroundColor
=
this
.
getColor
(
editorBackground
);
// TODO@
next
set editor group color depending on group size
// TODO@
grid
set editor group color depending on group size
// Content area
// Content area
// const content = this.getContentArea();
// const content = this.getContentArea();
...
@@ -84,10 +92,15 @@ export class NextEditorPart extends Part implements INextEditorPartService {
...
@@ -84,10 +92,15 @@ export class NextEditorPart extends Part implements INextEditorPartService {
}
}
public
createContentArea
(
parent
:
HTMLElement
):
HTMLElement
{
public
createContentArea
(
parent
:
HTMLElement
):
HTMLElement
{
// Container
const
contentArea
=
document
.
createElement
(
'
div
'
);
const
contentArea
=
document
.
createElement
(
'
div
'
);
addClass
(
contentArea
,
'
content
'
);
addClass
(
contentArea
,
'
content
'
);
parent
.
appendChild
(
contentArea
);
parent
.
appendChild
(
contentArea
);
// Viewer
contentArea
.
appendChild
(
this
.
viewer
.
element
);
return
contentArea
;
return
contentArea
;
}
}
...
@@ -96,7 +109,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
...
@@ -96,7 +109,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
// this.dimension = sizes[1];
// this.dimension = sizes[1];
// TODO@
next
propagate layout
// TODO@
grid
propagate layout
this
.
_onLayout
.
fire
(
dimension
);
this
.
_onLayout
.
fire
(
dimension
);
...
@@ -105,7 +118,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
...
@@ -105,7 +118,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
public
shutdown
():
void
{
public
shutdown
():
void
{
// TODO@
next
shutdown
// TODO@
grid
shutdown
// - persist part view state
// - persist part view state
// - pass on to instantiated editors
// - pass on to instantiated editors
...
@@ -117,7 +130,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
...
@@ -117,7 +130,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
// Emitters
// Emitters
this
.
_onLayout
.
dispose
();
this
.
_onLayout
.
dispose
();
// TODO@
next
dispose
// TODO@
grid
dispose
// - all visible and instantiated editors
// - all visible and instantiated editors
// - tokens for opening
// - tokens for opening
...
...
src/vs/workbench/browser/parts/editor2/nextEditorViewer.ts
0 → 100644
浏览文件 @
3dad25db
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
EditorInput
,
EditorOptions
,
GroupIdentifier
}
from
'
vs/workbench/common/editor
'
;
// import { EditorGroup } from '../../../common/editor/editorStacksModel';
export
enum
GridOrientation
{
VERTICAL
,
HORIZONTAL
}
export
class
NextEditorViewer
{
private
_element
:
HTMLElement
;
// private model: NextEditorViewModel;
constructor
()
{
this
.
_element
=
document
.
createElement
(
'
div
'
);
// this.model = new NextEditorViewModel(new TestGrid());
}
get
element
():
HTMLElement
{
return
this
.
_element
;
}
split
(
location
:
number
[],
orientation
:
GridOrientation
,
input
:
EditorInput
,
options
?:
EditorOptions
):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
show
(
id
:
GroupIdentifier
,
input
:
EditorInput
,
options
?:
EditorOptions
):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
}
// interface IGridPrimitives {
// split();
// move();
// close();
// }
// class TestGrid implements IGridPrimitives {
// split() {}
// move() {}
// close() {}
// }
// class NextEditorViewModel {
// private groups: EditorGroup[];
// constructor(grid: IGridPrimitives) {
// this.groups = [];
// }
// }
\ No newline at end of file
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
3dad25db
...
@@ -206,7 +206,7 @@ export class Workbench implements IPartService {
...
@@ -206,7 +206,7 @@ export class Workbench implements IPartService {
private
activitybarPart
:
ActivitybarPart
;
private
activitybarPart
:
ActivitybarPart
;
private
sidebarPart
:
SidebarPart
;
private
sidebarPart
:
SidebarPart
;
private
panelPart
:
PanelPart
;
private
panelPart
:
PanelPart
;
private
noOpEditorPart
:
NoOpEditorPart
;
// TODO@
next
adopt methods in next editor part
private
noOpEditorPart
:
NoOpEditorPart
;
// TODO@
grid
adopt methods in next editor part
private
editorPart
:
NextEditorPart
;
private
editorPart
:
NextEditorPart
;
private
statusbarPart
:
StatusbarPart
;
private
statusbarPart
:
StatusbarPart
;
private
quickOpen
:
QuickOpenController
;
private
quickOpen
:
QuickOpenController
;
...
...
src/vs/workbench/services/editor/common/editorService.ts
浏览文件 @
3dad25db
...
@@ -139,7 +139,7 @@ export interface IEditorPart {
...
@@ -139,7 +139,7 @@ export interface IEditorPart {
getActiveEditorInput
():
IEditorInput
;
getActiveEditorInput
():
IEditorInput
;
}
}
// TODO@
next
temporary
// TODO@
grid
temporary
export
class
NoOpEditorPart
implements
IEditorPart
,
IEditorGroupService
{
export
class
NoOpEditorPart
implements
IEditorPart
,
IEditorGroupService
{
_serviceBrand
:
ServiceIdentifier
<
any
>
;
_serviceBrand
:
ServiceIdentifier
<
any
>
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录