当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript LayoutProvider.getScrollable方法代码示例

本文整理汇总了TypeScript中vs/editor/common/viewLayout/viewLayout.LayoutProvider.getScrollable方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LayoutProvider.getScrollable方法的具体用法?TypeScript LayoutProvider.getScrollable怎么用?TypeScript LayoutProvider.getScrollable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vs/editor/common/viewLayout/viewLayout.LayoutProvider的用法示例。


在下文中一共展示了LayoutProvider.getScrollable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: createViewParts

	private createViewParts(): void {
		// These two dom nodes must be constructed up front, since references are needed in the layout provider (scrolling & co.)
		this.linesContent = createFastDomNode(document.createElement('div'));
		this.linesContent.setClassName(editorBrowser.ClassNames.LINES_CONTENT + ' monaco-editor-background');
		this.linesContent.setPosition('absolute');

		this.domNode = createFastDomNode(document.createElement('div'));
		this.domNode.setClassName(this._context.configuration.editor.viewInfo.editorClassName);

		this.overflowGuardContainer = createFastDomNode(document.createElement('div'));
		PartFingerprints.write(this.overflowGuardContainer.domNode, PartFingerprint.OverflowGuard);
		this.overflowGuardContainer.setClassName(editorBrowser.ClassNames.OVERFLOW_GUARD);

		this.viewParts = [];

		this._scrollbar = new EditorScrollbar(this._context, this.layoutProvider.getScrollable(), this.linesContent, this.domNode, this.overflowGuardContainer);
		this.viewParts.push(this._scrollbar);

		// View Lines
		this.viewLines = new ViewLines(this._context, this.linesContent, this.layoutProvider);

		// View Zones
		this.viewZones = new ViewZones(this._context, this.layoutProvider);
		this.viewParts.push(this.viewZones);

		// Decorations overview ruler
		let decorationsOverviewRuler = new DecorationsOverviewRuler(
			this._context, this.layoutProvider.getScrollHeight(),
			(lineNumber: number) => this.layoutProvider.getVerticalOffsetForLineNumber(lineNumber)
		);
		this.viewParts.push(decorationsOverviewRuler);


		let scrollDecoration = new ScrollDecorationViewPart(this._context);
		this.viewParts.push(scrollDecoration);

		let contentViewOverlays = new ContentViewOverlays(this._context);
		this.viewParts.push(contentViewOverlays);
		contentViewOverlays.addDynamicOverlay(new CurrentLineHighlightOverlay(this._context));
		contentViewOverlays.addDynamicOverlay(new SelectionsOverlay(this._context));
		contentViewOverlays.addDynamicOverlay(new DecorationsOverlay(this._context));
		contentViewOverlays.addDynamicOverlay(new IndentGuidesOverlay(this._context));

		let marginViewOverlays = new MarginViewOverlays(this._context);
		this.viewParts.push(marginViewOverlays);
		marginViewOverlays.addDynamicOverlay(new CurrentLineMarginHighlightOverlay(this._context));
		marginViewOverlays.addDynamicOverlay(new GlyphMarginOverlay(this._context));
		marginViewOverlays.addDynamicOverlay(new MarginViewLineDecorationsOverlay(this._context));
		marginViewOverlays.addDynamicOverlay(new LinesDecorationsOverlay(this._context));
		marginViewOverlays.addDynamicOverlay(new LineNumbersOverlay(this._context));

		let margin = new Margin(this._context);
		margin.getDomNode().appendChild(this.viewZones.marginDomNode.domNode);
		margin.getDomNode().appendChild(marginViewOverlays.getDomNode());
		this.viewParts.push(margin);

		// Content widgets
		this.contentWidgets = new ViewContentWidgets(this._context, this.domNode);
		this.viewParts.push(this.contentWidgets);

		this.viewCursors = new ViewCursors(this._context);
		this.viewParts.push(this.viewCursors);

		// Overlay widgets
		this.overlayWidgets = new ViewOverlayWidgets(this._context);
		this.viewParts.push(this.overlayWidgets);

		let rulers = new Rulers(this._context);
		this.viewParts.push(rulers);

		let minimap = new Minimap(this._context, this.layoutProvider, this._scrollbar);
		this.viewParts.push(minimap);

		// -------------- Wire dom nodes up

		if (decorationsOverviewRuler) {
			let overviewRulerData = this._scrollbar.getOverviewRulerLayoutInfo();
			overviewRulerData.parent.insertBefore(decorationsOverviewRuler.getDomNode(), overviewRulerData.insertBefore);
		}

		this.linesContent.domNode.appendChild(contentViewOverlays.getDomNode());
		this.linesContent.domNode.appendChild(rulers.domNode);
		this.linesContent.domNode.appendChild(this.viewZones.domNode.domNode);
		this.linesContent.domNode.appendChild(this.viewLines.getDomNode());
		this.linesContent.domNode.appendChild(this.contentWidgets.domNode);
		this.linesContent.domNode.appendChild(this.viewCursors.getDomNode());
		this.overflowGuardContainer.domNode.appendChild(margin.getDomNode());
		this.overflowGuardContainer.domNode.appendChild(this._scrollbar.getDomNode());
		this.overflowGuardContainer.domNode.appendChild(scrollDecoration.getDomNode());
		this.overflowGuardContainer.domNode.appendChild(this.overlayWidgets.getDomNode());
		this.overflowGuardContainer.domNode.appendChild(this.textArea.domNode);
		this.overflowGuardContainer.domNode.appendChild(this.textAreaCover.domNode);
		this.overflowGuardContainer.domNode.appendChild(minimap.getDomNode());
		this.domNode.domNode.appendChild(this.overflowGuardContainer.domNode);
		this.domNode.domNode.appendChild(this.contentWidgets.overflowingContentWidgetsDomNode);
	}
开发者ID:m-khosravi,项目名称:vscode,代码行数:96,代码来源:viewImpl.ts


注:本文中的vs/editor/common/viewLayout/viewLayout.LayoutProvider.getScrollable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。