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


TypeScript builder.Builder類代碼示例

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


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

示例1: test

	test('Part Layout with Content only', function () {
		let b = new Builder(document.getElementById(fixtureId));
		b.div().hide();

		let part = new MyPart3();
		part.create(b.getHTMLElement());

		assert(!document.getElementById('myPart.title'));
		assert(document.getElementById('myPart.content'));
	});
開發者ID:liunian,項目名稱:vscode,代碼行數:10,代碼來源:part.test.ts

示例2: findElement

export function findElement(container: Builder, className: string): HTMLElement {
	var elementBuilder: Builder = container;
	while (elementBuilder.getHTMLElement()) {
		var htmlElement = elementBuilder.getHTMLElement();
		if (htmlElement.className.startsWith(className)) {
			break;
		}
		elementBuilder = elementBuilder.child(0);
	}
	return elementBuilder.getHTMLElement();
}
開發者ID:burhandodhy,項目名稱:azuredatastudio,代碼行數:11,代碼來源:optionsDialogHelper.ts

示例3: StandardKeyboardEvent

	constructor(container: any) {
		super();

		this.$el = $('a.monaco-button').attr({
			'tabIndex': '0',
			'role': 'button'
		}).appendTo(container);

		this.$el.on(DOM.EventType.CLICK, (e) => {
			if (!this.enabled) {
				DOM.EventHelper.stop(e);
				return;
			}

			this.emit(DOM.EventType.CLICK, e);
		});

		this.$el.on(DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
			let event = new StandardKeyboardEvent(e);
			let eventHandled = false;
			if (this.enabled && event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
				this.emit(DOM.EventType.CLICK, e);
				eventHandled = true;
			} else if (event.equals(KeyCode.Escape)) {
				this.$el.domBlur();
				eventHandled = true;
			}

			if (eventHandled) {
				DOM.EventHelper.stop(event, true);
			}
		});
	}
開發者ID:aminroosta,項目名稱:vscode,代碼行數:33,代碼來源:button.ts

示例4:

		this.$el.on(DOM.EventType.MOUSE_OVER, (e: MouseEvent) => {
			if (!this.$el.hasClass('disabled')) {
				const hoverBackground = this.buttonHoverBackground ? this.buttonHoverBackground.toString() : null;
				if (hoverBackground) {
					this.$el.style('background-color', hoverBackground);
				}
			}
		});
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:8,代碼來源:button.ts

示例5: applyStyles

	private applyStyles(): void {
		if (this.$el) {
			const background = this.buttonBackground ? this.buttonBackground.toString() : null;
			const foreground = this.buttonForeground ? this.buttonForeground.toString() : null;

			this.$el.style('color', foreground);
			this.$el.style('background-color', background);
		}
	}
開發者ID:wangcheng678,項目名稱:vscode,代碼行數:9,代碼來源:button.ts

示例6: StandardKeyboardEvent

	constructor(container: any, options?: IButtonOptions) {
		super();

		this.options = options || Object.create(null);
		mixin(this.options, defaultOptions, false);

		this.buttonBackground = this.options.buttonBackground;
		this.buttonHoverBackground = this.options.buttonHoverBackground;
		this.buttonForeground = this.options.buttonForeground;
		this.buttonBorder = this.options.buttonBorder;

		this.$el = $('a.monaco-button').attr({
			'tabIndex': '0',
			'role': 'button'
		}).appendTo(container);

		this.$el.on(DOM.EventType.CLICK, (e) => {
			if (!this.enabled) {
				DOM.EventHelper.stop(e);
				return;
			}

			this.emit(DOM.EventType.CLICK, e);
		});

		this.$el.on(DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
			let event = new StandardKeyboardEvent(e);
			let eventHandled = false;
			if (this.enabled && event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
				this.emit(DOM.EventType.CLICK, e);
				eventHandled = true;
			} else if (event.equals(KeyCode.Escape)) {
				this.$el.domBlur();
				eventHandled = true;
			}

			if (eventHandled) {
				DOM.EventHelper.stop(event, true);
			}
		});

		this.$el.on(DOM.EventType.MOUSE_OVER, (e: MouseEvent) => {
			if (!this.$el.hasClass('disabled')) {
				const hoverBackground = this.buttonHoverBackground ? this.buttonHoverBackground.toString() : null;
				if (hoverBackground) {
					this.$el.style('background-color', hoverBackground);
				}
			}
		});

		this.$el.on(DOM.EventType.MOUSE_OUT, (e: MouseEvent) => {
			this.applyStyles(); // restore standard styles
		});

		this.applyStyles();
	}
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:56,代碼來源:button.ts

示例7: off

	private off(): void {
		this.bit.style.width = 'inherit';
		this.bit.style.opacity = '1';
		this.element.removeClass(css_active);
		this.element.removeClass(css_infinite);
		this.element.removeClass(css_discrete);

		this.workedVal = 0;
		this.totalWork = undefined;
	}
開發者ID:jumpinjackie,項目名稱:sqlopsstudio,代碼行數:10,代碼來源:progressbar.ts

示例8: setContainer

	public setContainer(container: HTMLElement): void {
		if (this.$el) {
			this.$el.off(['click', 'mousedown']);
			this.$el = null;
		}
		if (container) {
			this.$el = $(container);
			this.$el.on('mousedown', (e: Event) => this.onMouseDown(e as MouseEvent));
		}
	}
開發者ID:SeanKilleen,項目名稱:vscode,代碼行數:10,代碼來源:contextMenuHandler.ts

示例9: infinite

	/**
	 * Use this mode to indicate progress that has no total number of work units.
	 */
	public infinite(): ProgressBar {
		this.bit.style.width = '2%';
		this.bit.style.opacity = '1';

		this.element.removeClass(css_discrete);
		this.element.removeClass(css_done);
		this.element.addClass(css_active);
		this.element.addClass(css_infinite);

		return this;
	}
開發者ID:jumpinjackie,項目名稱:sqlopsstudio,代碼行數:14,代碼來源:progressbar.ts

示例10: ActionItem

	constructor(container: HTMLElement, options: IBaseDropdownOptions) {
		super();

		this.toDispose = [];

		this.$el = $('.dropdown').appendTo(container);

		this.$label = $('.dropdown-label');

		if (options.tick || options.action) {
			this.$label.addClass('tick');
		}

		let labelRenderer = options.labelRenderer;

		if (!labelRenderer && options.action) {
			this.$action = $('.dropdown-action').appendTo(this.$el);

			let item = new ActionItem(null, options.action, {
				icon: true,
				label: true
			});

			item.actionRunner = this;
			item.render(this.$action.getHTMLElement());

			labelRenderer = (container: HTMLElement): IDisposable => {
				container.innerText = '';
				return item;
			};
		}

		if (!labelRenderer) {
			labelRenderer = (container: HTMLElement): IDisposable => {
				$(container).text(options.label || '');
				return null;
			};
		}

		this.$label.on(['mousedown', EventType.Tap], (e: Event) => {
			e.preventDefault();
			e.stopPropagation();

			this.toggleDropdown();
		}).appendTo(this.$el);

		let cleanupFn = labelRenderer(this.$label.getHTMLElement());

		if (cleanupFn) {
			this.toDispose.push(cleanupFn);
		}

		this.toDispose.push(new Gesture(this.$label.getHTMLElement()));
	}
開發者ID:Contagious-Marketing,項目名稱:vscode,代碼行數:54,代碼來源:dropdown.ts


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