當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript contextview.IContextViewProvider類代碼示例

本文整理匯總了TypeScript中vs/base/browser/ui/contextview/contextview.IContextViewProvider的典型用法代碼示例。如果您正苦於以下問題:TypeScript IContextViewProvider類的具體用法?TypeScript IContextViewProvider怎麽用?TypeScript IContextViewProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了IContextViewProvider類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: hide

	public hide(): void {
		super.hide();

		if (this.contextViewProvider) {
			this.contextViewProvider.hideContextView();
		}
	}
開發者ID:jinlongchen2018,項目名稱:vscode,代碼行數:7,代碼來源:dropdown.ts

示例2: showMessage

	public showMessage(): void {
		let div: HTMLElement;
		let layout = () => div.style.width = dom.getTotalWidth(this.selectElement) + 'px';

		this.contextViewProvider.showContextView({
			getAnchor: () => this.selectElement,
			anchorAlignment: AnchorAlignment.RIGHT,
			render: (container: HTMLElement) => {
				div = dom.append(container, $('.monaco-inputbox-container'));
				layout();

				const renderOptions: RenderOptions = {
					inline: true,
					className: 'monaco-inputbox-message'
				};

				let spanElement: HTMLElement = (this.message.formatContent
					? renderFormattedText(this.message.content, renderOptions)
					: renderText(this.message.content, renderOptions)) as any;
				dom.addClass(spanElement, this.classForType(this.message.type));

				const styles = this.stylesForType(this.message.type);
				spanElement.style.backgroundColor = styles.background ? styles.background.toString() : null;
				spanElement.style.border = styles.border ? `1px solid ${styles.border}` : null;

				dom.append(div, spanElement);

				return null;
			},
			layout: layout
		});
	}
開發者ID:burhandodhy,項目名稱:azuredatastudio,代碼行數:32,代碼來源:listBox.ts

示例3:

	/*protected*/ show(): void {
		this.$el.addClass('active');

		this._contextViewProvider.showContextView({
			getAnchor: () => this.$el.getHTMLElement(),

			render: (container) => {
				return this.renderContents(container);
			},

			onDOMEvent: (e, activeElement) => {
				this.onEvent(e, activeElement);
			},

			onHide: () => {
				this.$el.removeClass('active');
			}
		});
	}
開發者ID:Contagious-Marketing,項目名稱:vscode,代碼行數:19,代碼來源:dropdown.ts

示例4: show

	public show(): void {
		super.show();

		addClass(this.element, 'active');

		this.contextViewProvider.showContextView({
			getAnchor: () => this.getAnchor(),

			render: (container) => {
				return this.renderContents(container);
			},

			onDOMEvent: (e, activeElement) => {
				this.onEvent(e, activeElement);
			},

			onHide: () => this.onHide()
		});
	}
開發者ID:jinlongchen2018,項目名稱:vscode,代碼行數:19,代碼來源:dropdown.ts

示例5: onBlur

	public onBlur(): void {
		if (!this.isValid) {
			this.contextViewProvider.hideContextView();
		}
	}
開發者ID:burhandodhy,項目名稱:azuredatastudio,代碼行數:5,代碼來源:listBox.ts


注:本文中的vs/base/browser/ui/contextview/contextview.IContextViewProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。