statusbar.ts 1.9 KB
Newer Older
E
Erich Gamma 已提交
1 2 3 4 5 6 7
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

'use strict';

J
Johannes Rieken 已提交
8 9
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IDisposable } from 'vs/base/common/lifecycle';
B
Benjamin Pasero 已提交
10
import { ThemeColor } from 'vs/platform/theme/common/themeService';
E
Erich Gamma 已提交
11 12 13

export var IStatusbarService = createDecorator<IStatusbarService>('statusbarService');

14 15 16 17
export enum StatusbarAlignment {
	LEFT, RIGHT
}

E
Erich Gamma 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
/**
 * A declarative way of describing a status bar entry
 */
export interface IStatusbarEntry {

	/**
	 * The text to show for the entry. You can embed icons in the text by leveraging the syntax:
	 *
	 * `My text ${icon name} contains icons like ${icon name} this one.`
	 */
	text: string;

	/**
	 * An optional tooltip text to show when you hover over the entry
	 */
	tooltip?: string;

	/**
	 * An optional color to use for the entry
	 */
38
	color?: string | ThemeColor;
E
Erich Gamma 已提交
39 40 41 42 43

	/**
	 * An optional id of a command that is known to the workbench to execute on click
	 */
	command?: string;
44 45 46 47 48

	/**
	 * An optional extension ID if this entry is provided from an extension.
	 */
	extensionId?: string;
E
Erich Gamma 已提交
49 50 51
}

export interface IStatusbarService {
B
polish  
Benjamin Pasero 已提交
52

53
	_serviceBrand: any;
E
Erich Gamma 已提交
54 55 56 57 58 59

	/**
	 * Adds an entry to the statusbar with the given alignment and priority. Use the returned IDisposable
	 * to remove the statusbar entry.
	 */
	addEntry(entry: IStatusbarEntry, alignment: StatusbarAlignment, priority?: number): IDisposable;
60 61 62 63 64

	/**
	 * Prints something to the status bar area with optional auto dispose and delay.
	 */
	setStatusMessage(message: string, autoDisposeAfter?: number, delayBy?: number): IDisposable;
E
Erich Gamma 已提交
65
}