本文整理汇总了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()
});
}