提交 e23fe636 编写于 作者: J Johannes Rieken

make zone widget abstract

上级 f348d02a
......@@ -214,7 +214,7 @@ class MarkerNavigationWidget extends ZoneWidget {
this._wireModelAndView();
}
public fillContainer(container: HTMLElement): void {
protected _fillContainer(container: HTMLElement): void {
this._container = container;
dom.addClass(this._container, 'marker-widget');
......
......@@ -572,7 +572,7 @@ export class ReferenceWidget extends PeekViewWidget {
this._lastHeight = height;
}
public onWidth(widthInPixel: number): void {
public _onWidth(widthInPixel: number): void {
this._sash.width = widthInPixel;
this._preview.layout();
}
......
......@@ -80,7 +80,7 @@ export class PeekViewWidget extends ZoneWidget implements IPeekViewService {
super.show(where, heightInLines);
}
public fillContainer(container: HTMLElement): void {
protected _fillContainer(container: HTMLElement): void {
$(container).addClass('peekview-widget');
this._headElement = <HTMLDivElement>$('.head').getHTMLElement();
......@@ -140,7 +140,7 @@ export class PeekViewWidget extends ZoneWidget implements IPeekViewService {
// implement me
}
public doLayout(heightInPixel: number, widthInPixel: number): void {
public _doLayout(heightInPixel: number, widthInPixel: number): void {
if (heightInPixel < 0) {
// Looks like the view zone got folded away!
......
......@@ -89,7 +89,7 @@ class OverlayWidgetDelegate implements IOverlayWidget {
}
export class ZoneWidget implements IHorizontalSashLayoutProvider {
export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
private _viewZone: ViewZoneDelegate = null;
private _overlayWidget: OverlayWidgetDelegate = null;
......@@ -114,7 +114,7 @@ export class ZoneWidget implements IHorizontalSashLayoutProvider {
this._disposables.add(this.editor.addListener2(EventType.EditorLayout, (info: IEditorLayoutInfo) => {
var width = this._getWidth(info);
this.domNode.style.width = width + 'px';
this.onWidth(width);
this._onWidth(width);
}));
}
......@@ -126,7 +126,7 @@ export class ZoneWidget implements IHorizontalSashLayoutProvider {
this.container = document.createElement('div');
dom.addClass(this.container, 'zone-widget-container');
this.domNode.appendChild(this.container);
this.fillContainer(this.container);
this._fillContainer(this.container);
this._initSash();
}
......@@ -144,7 +144,7 @@ export class ZoneWidget implements IHorizontalSashLayoutProvider {
let containerHeight = height - this._decoratingElementsHeight();
this.container.style.height = `${containerHeight}px`;
this.doLayout(containerHeight, this._getWidth());
this._doLayout(containerHeight, this._getWidth());
this._resizeSash.layout();
}
......@@ -248,7 +248,7 @@ export class ZoneWidget implements IHorizontalSashLayoutProvider {
this.container.style.overflow = 'hidden';
this.doLayout(containerHeight, width);
this._doLayout(containerHeight, width);
this.editor.setSelection(where);
......@@ -276,15 +276,13 @@ export class ZoneWidget implements IHorizontalSashLayoutProvider {
}
}
public fillContainer(container: HTMLElement): void {
// implement in subclass
}
protected abstract _fillContainer(container: HTMLElement): void;
public onWidth(widthInPixel: number): void {
protected _onWidth(widthInPixel: number): void {
// implement in subclass
}
public doLayout(heightInPixel: number, widthInPixel: number): void {
protected _doLayout(heightInPixel: number, widthInPixel: number): void {
// implement in subclass
}
......
......@@ -58,7 +58,7 @@ export class BreakpointWidget extends ZoneWidget {
BreakpointWidget.INSTANCE.show({ lineNumber, column: 1 }, 2);
}
public fillContainer(container: HTMLElement): void {
protected _fillContainer(container: HTMLElement): void {
dom.addClass(container, 'breakpoint-widget');
const uri = this.editor.getModel().getAssociatedResource();
const breakpoint = this.debugService.getModel().getBreakpoints().filter(bp => bp.lineNumber === this.lineNumber && bp.source.uri.toString() === uri.toString()).pop();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册