public sealed class EditorWorkspaceThe editor's IWorkspace: a view list keyed by document type, and the shell's arrangement.
Remarks
⚠ Opening an asset in a tab is still the host's, handed in. It resolves the document through IDocumentHost and the editor's open scenes, which are Vixen.Editor.Core's words this assembly refuses; the panel id, its placement and the arrangement are here.
Fields and properties (6)
public const string AssetPrefixWhat a panel showing an asset's editor is called in an arrangement.
public const string ThemeFileWhere the user's theme overrides live, in the user's store.
public RecentDocuments RecentThe documents recently opened in a tab or saved, by location, newest first (#656).
public Action<IEditableDocument>? RevertingHow the host reverts a document from its tab, or for the document's own revert.
public IReadOnlyList<DocumentView> ViewsEvery registered view, in registration order.
public string ThemeTokensThe theme tokens the user has written over the shipped palette, as the YAML they are kept in.
Events (1)
public Action<UiElement, IEditableDocument>? ShownRaised after Show built a view, with the view's root and its document.
Methods (17)
public EditorWorkspace(Func<AssetId, bool>? open = null)A view list with no shell behind it — what a test or a sweep over the standard views builds.
public EditorWorkspace(EditorShell shell, EditorUserStore store, Func<AssetId, bool>? open = null)The workspace of a running editor.
public static string PanelOf(AssetId asset)The id of the panel an asset's editor is shown in.
public static bool TryReadPanel(string id, out AssetId asset)Reads an asset panel's id back, which is what restoring an arrangement needs.
public IDisposable Add(DocumentView view)Registers a view, and hands back the removal.
public bool TryGetView(IEditableDocument document, out DocumentView? view)Finds the view for a document.
public bool TryGetView(Type documentType, out DocumentView? view)Finds a view registered for a type or for one of its bases, without a document to ask.
public UiElement? Show(IEditableDocument document, UiElement panel)Builds a document's view into a panel, which then hosts the document.
public bool Open(AssetId asset)Opens an asset in a panel of its own — the document a double-click opens, in the tab a double-click brings forward.
public T ViewState<T>(string view) where T : class, new()The durable state of one view — what it is looking at, which must outlive the panel showing it.
public void Place(string panelId)public string SaveLayout()Keeps the arrangement on screen in the user's store, named after the preset it came from.
public bool ApplyThemeTokens(string text)Keeps new theme tokens and restyles the editor with them; an empty text is the shipped palette.
public void ReloadStyles()Reads the theme tokens again and restyles the editor, so a hand edit of the file shows without a restart.
public void LoadStyles()Reads the theme tokens and restyles the editor with them, without saying so — what start-up does.
public void Restore()Puts back the user's keymap, theme and arrangement — what start-up does, once.
public void Persist()Writes the arrangement and the keymap — what closing does.
Used by (13)
- AssetTabsVixen.Editor.App
- DocumentHostTestsVixen.Editor.AssetEditors.Tests
- EditorApplicationVixen.Editor.App
- EditorWorkspaceTestsVixen.Editor.Ui.Tests
- HelpAndWorkspaceModuleTestsVixen.Editor.App.Tests
- LayerStackPanelTestsVixen.Editor.Texturing.Tests
- RecentDocumentsMenuTestsVixen.Editor.App.Tests
- RemovalVixen.Editor.Ui
- StandardDocumentPairingTestsVixen.Editor.AssetEditors.Tests
- StandardEditorsVixen.Editor.AssetEditors
- TextureGraphPanelTestsVixen.Editor.Texturing.Tests
- TexturingFixtureVixen.Editor.Texturing.Tests
- ViewStateTestsVixen.Editor.Ui.Tests