本文整理匯總了TypeScript中vs/base/browser/ui/contextview/contextview.IContextViewProvider.showContextView方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IContextViewProvider.showContextView方法的具體用法?TypeScript IContextViewProvider.showContextView怎麽用?TypeScript IContextViewProvider.showContextView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/base/browser/ui/contextview/contextview.IContextViewProvider
的用法示例。
在下文中一共展示了IContextViewProvider.showContextView方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: 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
});
}
示例2:
/*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');
}
});
}
示例3: 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()
});
}