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