Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WorkspaceFrontendContribution

Hierarchy

  • WorkspaceFrontendContribution

Implements

  • CommandContribution
  • KeybindingContribution
  • MenuContribution
  • FrontendApplicationContribution

Index

Constructors

constructor

Properties

Protected Readonly applicationShell

applicationShell: ApplicationShell

Protected Readonly commandRegistry

commandRegistry: CommandRegistry

Protected Readonly contextKeyService

contextKeyService: ContextKeyService

Protected Readonly encodingRegistry

encodingRegistry: EncodingRegistry

Protected Readonly fileDialogService

fileDialogService: FileDialogService

Protected Readonly fileService

fileService: FileService

Protected Readonly labelProvider

labelProvider: LabelProvider

Protected Readonly messageService

messageService: MessageService

Protected Readonly openerService

openerService: OpenerService

Protected Readonly preferenceConfigurations

preferenceConfigurations: PreferenceConfigurations

Protected preferences

preferences: PreferenceProxy<WorkspaceConfiguration>

Protected Readonly quickOpenWorkspace

quickOpenWorkspace: QuickOpenWorkspace

Protected Readonly selectionService

selectionService: SelectionService

Protected Readonly toDisposeOnUpdateEncodingOverrides

toDisposeOnUpdateEncodingOverrides: DisposableCollection = ...

Protected Readonly workspaceService

workspaceService: WorkspaceService

Protected Readonly workspaceStorage

workspaceStorage: StorageService

Methods

Protected canBeSavedAs

  • canBeSavedAs(widget: undefined | Widget): widget is Widget & SaveableSource & Navigatable
  • This method ensures a few things about widget:

    • widget.getResourceUri() actually returns a URI.
    • widget.saveable.createSnapshot is defined.
    • widget.saveable.revert is defined.

    Parameters

    • widget: undefined | Widget

    Returns widget is Widget & SaveableSource & Navigatable

Protected closeWorkspace

  • closeWorkspace(): Promise<void>

configure

  • configure(): void

Private confirmOverwrite

  • confirmOverwrite(uri: default): Promise<boolean>

Private copyAndSave

  • copyAndSave(sourceWidget: Widget & SaveableSource & Navigatable, target: default, overwrite: boolean): Promise<void>

Protected doOpen

  • doOpen(): Promise<undefined | default>

Protected doOpenFile

  • doOpenFile(): Promise<undefined | default>

Protected doOpenFolder

  • doOpenFolder(): Promise<undefined | default>
  • Opens a folder after prompting the Open Folder dialog. Resolves to undefined, if

    • the workspace root is not set,
    • the folder to open does not exist, or
    • it was not a directory, but a file resource.

    Otherwise, resolves to the URI of the folder.

    Returns Promise<undefined | default>

Protected doOpenWorkspace

  • doOpenWorkspace(): Promise<undefined | default>
  • Opens a workspace after raising the Open Workspace dialog. Resolves to the URI of the recently opened workspace, if it was successful. Otherwise, resolves to undefined.

    Caveat: this behaves differently on different platforms, the workspace.supportMultiRootWorkspace preference value does matter, and electron/browser version has impact too. See here for more details.

    Legend:

    • workspace.supportMultiRootWorkspace is false: => N
    • workspace.supportMultiRootWorkspace is true: => Y
    • Folders only: => F
    • Workspace files only: => W
    • Folders and workspace files: => FW

    |---------|-----------|-----------|------------|------------| | | browser Y | browser N | electron Y | electron N | |---------|-----------|-----------|------------|------------| | Linux | FW | F | W | F | | Windows | FW | F | W | F | | OS X | FW | F | FW | FW | |---------|-----------|-----------|------------|------------|

    Returns Promise<undefined | default>

Private getCurrentWorkspaceUri

  • getCurrentWorkspaceUri(): undefined | default

Private isElectron

  • isElectron(): boolean

Protected openWorkspaceOpenFileDialogProps

  • openWorkspaceOpenFileDialogProps(): Promise<OpenFileDialogProps>

registerCommands

  • registerCommands(commands: CommandRegistry): void

registerKeybindings

  • registerKeybindings(keybindings: KeybindingRegistry): void

registerMenus

  • registerMenus(menus: MenuModelRegistry): void

Protected saveAs

  • saveAs(sourceWidget: Widget & SaveableSource & Navigatable): Promise<void>

Protected saveWorkspaceAs

  • saveWorkspaceAs(): Promise<void>

Protected updateEncodingOverrides

  • updateEncodingOverrides(): void

Protected updateStyles

  • updateStyles(): void

Protected updateWorkspaceStateKey

  • updateWorkspaceStateKey(): "empty" | "workspace" | "folder"