本文整理匯總了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();
}
}
示例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
});
}
示例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');
}
});
}
示例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()
});
}
示例5: onBlur
public onBlur(): void {
if (!this.isValid) {
this.contextViewProvider.hideContextView();
}
}