提交 9c3cdc20 编写于 作者: B Benjamin Pasero

some comments

上级 3dad25db
......@@ -17,7 +17,7 @@ import { join } from 'vs/base/common/paths';
import { editorBackground } from 'vs/platform/theme/common/colorRegistry';
import { INextEditorPartService } from 'vs/workbench/services/editor/common/nextEditorPartService';
import { EditorInput, EditorOptions } from 'vs/workbench/common/editor';
import { NextEditorViewer, GridOrientation } from './nextEditorViewer';
import { NextEditorsViewer, GridOrientation } from 'vs/workbench/browser/parts/editor2/nextEditorsViewer';
// import { IStorageService } from 'vs/platform/storage/common/storage';
export class NextEditorPart extends Part implements INextEditorPartService {
......@@ -29,7 +29,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
// private dimension: Dimension;
// private memento: object;
private viewer: NextEditorViewer;
private viewer: NextEditorsViewer;
constructor(
id: string,
......@@ -43,7 +43,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
// this.memento = this.getMemento(this.storageService, Scope.WORKSPACE);
this.viewer = new NextEditorViewer();
this.viewer = new NextEditorsViewer();
this.initStyles();
}
......@@ -54,7 +54,20 @@ export class NextEditorPart extends Part implements INextEditorPartService {
// TODO@grid editor opening event and prevention
// TODO@grid support options
return this.viewer.split([], GridOrientation.HORIZONTAL, input, options);
// TODO@grid delegate the management of instantiated ("live"?) editors into a helper class
// that associates editors to a group id. editors should get disposed once a group closes
// Flow
// - editors viewer is the main grid control that owns EditorGroups and GridViews to add HTML into (this enables empty groups too!)
// - a helper class manages instantiation/lifecycle of ("live") editors (maybe also the title control? maybe all UI associated to show a group?)
// - how does the input gets opened in the editor group? is it 2 calls, one for editorgroup and one for showing it as HTML?
// - ^ is a bit fishy, would be nice to have this all combined somehow?
// - idea: have a EditorGroupView helper that is the thing added into a GridView and it also has a openEditor method which sets
// the editor to the editor group as well as renders the UI pieces
const group = this.viewer.split([], GridOrientation.HORIZONTAL);
return TPromise.as(void 0);
}
private initStyles(): void {
......
......@@ -5,16 +5,15 @@
'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';
// import { TPromise } from 'vs/base/common/winjs.base';
import { EditorGroup } from 'vs/workbench/common/editor/editorStacksModel';
export enum GridOrientation {
VERTICAL,
HORIZONTAL
}
export class NextEditorViewer {
export class NextEditorsViewer {
private _element: HTMLElement;
// private model: NextEditorViewModel;
......@@ -27,14 +26,19 @@ export class NextEditorViewer {
return this._element;
}
split(location: number[], orientation: GridOrientation, input: EditorInput, options?: EditorOptions): TPromise<void> {
split(location: number[], orientation: GridOrientation): EditorGroup /* IEditorGroupView */ {
// TODO this should return some GridView/IEditorGroupView type which combines a newly created EditorGroup and HTML container
return TPromise.as(void 0);
return void 0;
}
show(id: GroupIdentifier, input: EditorInput, options?: EditorOptions): TPromise<void> {
return TPromise.as(void 0);
groupAt(location: number[]): EditorGroup /* IEditorGroupView */ {
return void 0;
}
get groups(): EditorGroup[] /* IEditorGroupView */ {
return [];
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册