當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript labels.getPathLabel函數代碼示例

本文整理匯總了TypeScript中vs/base/common/labels.getPathLabel函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript getPathLabel函數的具體用法?TypeScript getPathLabel怎麽用?TypeScript getPathLabel使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了getPathLabel函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getPathLabel

	const folderPicks = folders.map(folder => {
		return {
			label: folder.name,
			description: getPathLabel(resources.dirname(folder.uri), void 0, environmentService),
			folder,
			resource: folder.uri,
			fileKind: FileKind.ROOT_FOLDER
		} as IFilePickOpenEntry;
	});
開發者ID:JarnoNijboer,項目名稱:vscode,代碼行數:9,代碼來源:workspaceCommands.ts

示例2: getResourceForCommand

	handler: (accessor, resource: URI) => {
		resource = getResourceForCommand(resource, accessor.get(IListService), accessor.get(IWorkbenchEditorService));
		if (resource) {
			const clipboardService = accessor.get(IClipboardService);
			clipboardService.writeText(resource.scheme === 'file' ? labels.getPathLabel(resource) : resource.toString());
		} else {
			const messageService = accessor.get(IMessageService);
			messageService.show(severity.Info, nls.localize('openFileToCopy', "Open a file first to copy its path"));
		}
	}
開發者ID:servicesgpr,項目名稱:vscode,代碼行數:10,代碼來源:fileCommands.ts

示例3: onDragStart

	public onDragStart(tree: _.ITree, data: _.IDragAndDropData, originalEvent: Mouse.DragMouseEvent): void {
		const sources: object[] = data.getData();

		let source: object = null;
		if (sources.length > 0) {
			source = sources[0];
		}

		// Apply some datatransfer types to allow for dragging the element outside of the application
		const resource = this.toResource(source);
		if (resource) {
			originalEvent.dataTransfer.setData('text/plain', getPathLabel(resource));
		}
	}
開發者ID:AlexxNica,項目名稱:sqlopsstudio,代碼行數:14,代碼來源:treeDnd.ts

示例4: getWorkspaceLabel

export function getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier), environmentService: IEnvironmentService, options?: { verbose: boolean }): string {

	// Workspace: Single Folder
	if (isSingleFolderWorkspaceIdentifier(workspace)) {
		return tildify(workspace, environmentService.userHome);
	}

	// Workspace: Untitled
	if (isParent(workspace.configPath, environmentService.workspacesHome, !isLinux /* ignore case */)) {
		return localize('untitledWorkspace', "Untitled (Workspace)");
	}

	// Workspace: Saved
	const filename = basename(workspace.configPath);
	const workspaceName = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1);
	if (options && options.verbose) {
		return localize('workspaceNameVerbose', "{0} (Workspace)", getPathLabel(join(dirname(workspace.configPath), workspaceName), null, environmentService));
	}

	return localize('workspaceName', "{0} (Workspace)", workspaceName);
}
開發者ID:jumpinjackie,項目名稱:sqlopsstudio,代碼行數:21,代碼來源:workspaces.ts

示例5: toResource

export const copyPathCommand = (accessor: ServicesAccessor, resource?: URI) => {

	// Without resource, try to look at the active editor
	if (!resource) {
		const editorGroupService = accessor.get(IEditorGroupService);
		const editorService = accessor.get(IWorkbenchEditorService);
		const activeEditor = editorService.getActiveEditor();

		resource = activeEditor ? toResource(activeEditor.input, { supportSideBySide: true }) : void 0;
		if (activeEditor) {
			editorGroupService.focusGroup(activeEditor.position); // focus back to active editor group
		}
	}

	if (resource) {
		const clipboardService = accessor.get(IClipboardService);
		clipboardService.writeText(resource.scheme === 'file' ? getPathLabel(resource) : resource.toString());
	} else {
		const messageService = accessor.get(IMessageService);
		messageService.show(severity.Info, nls.localize('openFileToCopy', "Open a file first to copy its path"));
	}
};
開發者ID:gokulakrishna9,項目名稱:vscode,代碼行數:22,代碼來源:fileCommands.ts

示例6: setFile

	public setFile(file: uri, provider: IWorkspaceFolderProvider, userHome: IUserHomeProvider): void {
		const parent = paths.dirname(file.fsPath);

		this.setValue(getBaseLabel(file), parent && parent !== '.' ? getPathLabel(parent, provider, userHome) : '', { title: file.fsPath });
	}
開發者ID:sameer-coder,項目名稱:vscode,代碼行數:5,代碼來源:iconLabel.ts

示例7:

		const text = resources.map(r => r.scheme === Schemas.file ? labels.getPathLabel(r) : r.toString()).join(lineDelimiter);
開發者ID:jinlongchen2018,項目名稱:vscode,代碼行數:1,代碼來源:fileCommands.ts

示例8:

		const text = resources.map(r => r.scheme === 'file' ? labels.getPathLabel(r) : r.toString()).join('\n');
開發者ID:JarnoNijboer,項目名稱:vscode,代碼行數:1,代碼來源:fileCommands.ts

示例9: setFile

	public setFile(file: uri, provider: IRootProvider, userHome: IUserHomeProvider): void {
		const parent = paths.dirname(file.fsPath);

		this.setValue(paths.basename(file.fsPath), parent && parent !== '.' ? getPathLabel(parent, provider, userHome) : '', { title: file.fsPath });
	}
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:5,代碼來源:iconLabel.ts


注:本文中的vs/base/common/labels.getPathLabel函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。