本文整理汇总了TypeScript中vscode.StatusBarItem类的典型用法代码示例。如果您正苦于以下问题:TypeScript StatusBarItem类的具体用法?TypeScript StatusBarItem怎么用?TypeScript StatusBarItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StatusBarItem类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: updateWordCount
public updateWordCount() {
// Create as needed
if (!this._statusBarItem) {
this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left);
}
// Get the current text editor
let editor = window.activeTextEditor;
if (!editor) {
this._statusBarItem.hide();
return;
}
let doc = editor.document;
// Only update status if an MD file
if (doc.languageId === "markdown") {
let wordCount = this._getWordCount(doc);
// Update the status bar
this._statusBarItem.text = wordCount !== 1 ? `$(pencil) ${wordCount} Words` : '$(pencil) 1 Word';
this._statusBarItem.show();
} else {
this._statusBarItem.hide();
}
}
开发者ID:Osuka-Andala,项目名称:vscode-wordcount,代码行数:27,代码来源:extension.ts
示例2: initializeStatusBars
//Set up the initial status bars
private initializeStatusBars() {
if (this.ensureInitialized()) {
this._teamServicesStatusBarItem.command = CommandNames.OpenTeamSite;
this._teamServicesStatusBarItem.text = this._serverContext.RepoInfo.TeamProject;
this._teamServicesStatusBarItem.tooltip = Strings.NavigateToTeamServicesWebSite;
this._teamServicesStatusBarItem.show();
this._pullRequestStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 99);
this._pullRequestStatusBarItem.command = CommandNames.GetPullRequests;
this._pullRequestStatusBarItem.text = GitClient.GetPullRequestStatusText(0);
this._pullRequestStatusBarItem.tooltip = Strings.BrowseYourPullRequests;
this._pullRequestStatusBarItem.show();
this._buildStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 98);
this._buildStatusBarItem.command = CommandNames.OpenBuildSummaryPage;
this._buildStatusBarItem.text = `$(icon octicon-package) ` + `$(icon octicon-dash)`;
this._buildStatusBarItem.tooltip = Strings.NoBuildsFound;
this._buildStatusBarItem.show();
this._pinnedQueryStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 97);
this._pinnedQueryStatusBarItem.command = CommandNames.ViewPinnedQueryWorkItems;
this._pinnedQueryStatusBarItem.text = WitClient.GetPinnedQueryStatusText(0);
this._pinnedQueryStatusBarItem.tooltip = Strings.ViewYourPinnedQuery;
this._pinnedQueryStatusBarItem.show();
}
}
开发者ID:chrisdias,项目名称:vsts-vscode,代码行数:27,代码来源:team-extension.ts
示例3: updateWordCount
public updateWordCount() {
// Create as needed
if (!this._statusBarItem) {
this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left);
}
// Get the current text editor
let editor = window.activeTextEditor;
if (!editor) {
this._statusBarItem.hide();
return;
}
let doc = editor.document;
// Only update status if an MD file
if (doc.languageId === "yaml") {
let wordCount = this._getHints(doc, editor);
if (wordCount == null) {
editor.setDecorations(smallNumberDecorationType, []);
this._statusBarItem.hide();
} else {
editor.setDecorations(smallNumberDecorationType, wordCount);
this._statusBarItem.show();
this._statusBarItem.text = "Run tests";
}
} else {
this._statusBarItem.hide();
}
}
开发者ID:mulesoft-labs,项目名称:http-bat-vscode,代码行数:33,代码来源:extension.ts
示例4: removeStatusBarItem
function removeStatusBarItem() {
if (statusBarItem) {
statusBarItem.hide();
statusBarItem.dispose();
statusBarItem = null;
}
isStatusBarVisible = false;
}
开发者ID:rid9,项目名称:DateTime,代码行数:8,代码来源:extension.ts
示例5: dispose
dispose() {
this.clearBlame();
this._blameStatusBarItem && this._blameStatusBarItem.dispose();
this._modeStatusBarItem && this._modeStatusBarItem.dispose();
Container.lineTracker.stop(this);
this._disposable && this._disposable.dispose();
}
开发者ID:chrisleaman,项目名称:vscode-gitlens,代码行数:9,代码来源:statusBarController.ts
示例6: dispose
dispose() {
if (this._pullRequestStatusBarItem !== undefined) {
this._pullRequestStatusBarItem.dispose();
}
if (this._teamServicesStatusBarItem !== undefined) {
this._teamServicesStatusBarItem.dispose();
}
if (this._buildStatusBarItem !== undefined) {
this._buildStatusBarItem.dispose();
}
}
开发者ID:buckh,项目名称:vsts-vscode,代码行数:11,代码来源:team-extension.ts
示例7: hide
public hide(): void {
if (this.interval !== undefined) {
clearInterval(this.interval);
this.interval = undefined;
}
this.stopStatusBarItem.hide();
this.spinnerStatusBarItem.hide();
}
开发者ID:KalitaAlexey,项目名称:RustyCode,代码行数:11,代码来源:output_channel_task_status_bar_item.ts
示例8: updateStatus
function updateStatus(status: StatusBarItem): void {
const info = getEditorInfo();
status.text = info ? info.text : void 0;
status.tooltip = info ? info.tooltip : void 0;
status.color = info ? info.color : void 0;
if (info) {
status.show();
} else {
status.hide();
}
}
开发者ID:voodoos,项目名称:vscode-extension-samples,代码行数:12,代码来源:extension.ts
示例9: updateStatus
function updateStatus(status: StatusBarItem): void {
let text = getSelectedLines();
if (text) {
status.text = '$(megaphone) ' + text;
}
if (text) {
status.show();
} else {
status.hide();
}
}
开发者ID:rlugojr,项目名称:vscode-extension-samples,代码行数:12,代码来源:extension.ts
示例10: show
public show(): void {
this.stopStatusBarItem.show();
this.spinnerStatusBarItem.show();
const spinner = elegantSpinner();
const update = () => {
this.spinnerStatusBarItem.text = spinner();
};
this.interval = setInterval(update, 100);
}
开发者ID:KalitaAlexey,项目名称:RustyCode,代码行数:13,代码来源:output_channel_task_status_bar_item.ts
注:本文中的vscode.StatusBarItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论