本文整理汇总了TypeScript中vs/editor/browser/editorBrowser.IContentWidget类的典型用法代码示例。如果您正苦于以下问题:TypeScript IContentWidget类的具体用法?TypeScript IContentWidget怎么用?TypeScript IContentWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IContentWidget类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {
this._context = context;
this._viewDomNode = viewDomNode;
this._actual = actual;
this.domNode = createFastDomNode(this._actual.getDomNode());
this.id = this._actual.getId();
this.allowEditorOverflow = this._actual.allowEditorOverflow || false;
this.suppressMouseDown = this._actual.suppressMouseDown || false;
this._fixedOverflowWidgets = this._context.configuration.editor.viewInfo.fixedOverflowWidgets;
this._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth;
this._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;
this._lineHeight = this._context.configuration.editor.lineHeight;
this._position = null;
this._preference = null;
this._isVisible = false;
this._renderData = null;
this.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');
this._updateMaxWidth();
this.domNode.setVisibility('hidden');
this.domNode.setAttribute('widgetId', this.id);
}
开发者ID:Chan-PH,项目名称:vscode,代码行数:25,代码来源:contentWidgets.ts
示例2: addWidget
public addWidget(widget: IContentWidget): void {
const domNode = createFastDomNode(widget.getDomNode());
const widgetData: IWidgetData = {
allowEditorOverflow: widget.allowEditorOverflow || false,
widget: widget,
position: null,
preference: null,
isVisible: false,
domNode: domNode
};
this._widgets[widget.getId()] = widgetData;
domNode.setPosition((this._context.configuration.editor.viewInfo.fixedOverflowWidgets && widget.allowEditorOverflow) ? 'fixed' : 'absolute');
domNode.setMaxWidth(this._contentWidth);
domNode.setVisibility('hidden');
domNode.setAttribute('widgetId', widget.getId());
if (widgetData.allowEditorOverflow) {
this.overflowingContentWidgetsDomNode.appendChild(domNode.domNode);
} else {
this.domNode.appendChild(domNode.domNode);
}
this.setShouldRender();
}
开发者ID:m-khosravi,项目名称:vscode,代码行数:26,代码来源:contentWidgets.ts
示例3: setWidgetPosition
public setWidgetPosition(widget: IContentWidget, position: editorCommon.IPosition, preference:ContentWidgetPositionPreference[]): void {
let widgetData = this._widgets[widget.getId()];
widgetData.position = position;
widgetData.preference = preference;
this.setShouldRender();
}
开发者ID:firebull1,项目名称:vscode,代码行数:8,代码来源:contentWidgets.ts
示例4: removeWidget
public removeWidget(widget: IContentWidget): void {
const widgetId = widget.getId();
if (this._widgets.hasOwnProperty(widgetId)) {
const myWidget = this._widgets[widgetId];
delete this._widgets[widgetId];
const domNode = myWidget.domNode.domNode;
domNode.parentNode.removeChild(domNode);
domNode.removeAttribute('monaco-visible-content-widget');
this.setShouldRender();
}
}
开发者ID:Chan-PH,项目名称:vscode,代码行数:13,代码来源:contentWidgets.ts
示例5: removeWidget
public removeWidget(widget: IContentWidget): void {
let widgetId = widget.getId();
if (this._widgets.hasOwnProperty(widgetId)) {
let widgetData = this._widgets[widgetId];
delete this._widgets[widgetId];
let domNode = widgetData.widget.getDomNode();
domNode.parentNode.removeChild(domNode);
domNode.removeAttribute('monaco-visible-content-widget');
this.shouldRender = true;
}
}
开发者ID:1424667164,项目名称:vscode,代码行数:13,代码来源:contentWidgets.ts
示例6: addWidget
public addWidget(widget: IContentWidget): void {
let widgetData: IWidgetData = {
allowEditorOverflow: widget.allowEditorOverflow || false,
widget: widget,
position: null,
preference: null,
isVisible: false
};
this._widgets[widget.getId()] = widgetData;
let domNode = widget.getDomNode();
domNode.style.position = 'absolute';
StyleMutator.setMaxWidth(domNode, this._contentWidth);
StyleMutator.setVisibility(domNode, 'hidden');
domNode.setAttribute('widgetId', widget.getId());
if (widgetData.allowEditorOverflow) {
this.overflowingContentWidgetsDomNode.appendChild(domNode);
} else {
this.domNode.appendChild(domNode);
}
this.shouldRender = true;
}
开发者ID:1424667164,项目名称:vscode,代码行数:24,代码来源:contentWidgets.ts
示例7: setWidgetPosition
public setWidgetPosition(widget: IContentWidget, position: IPosition, preference: ContentWidgetPositionPreference[]): void {
const myWidget = this._widgets[widget.getId()];
myWidget.setPosition(position, preference);
this.setShouldRender();
}
开发者ID:Chan-PH,项目名称:vscode,代码行数:6,代码来源:contentWidgets.ts
示例8: setWidgetPosition
public setWidgetPosition(widget: IContentWidget, position: IPosition | null | undefined, range: IRange | null | undefined, preference: ContentWidgetPositionPreference[] | null | undefined): void {
const myWidget = this._widgets[widget.getId()];
myWidget.setPosition(position, range, preference);
this.setShouldRender();
}
开发者ID:VishalMadhvani,项目名称:vscode,代码行数:6,代码来源:contentWidgets.ts
注:本文中的vs/editor/browser/editorBrowser.IContentWidget类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论