Context

ceramic.Entityelements.Context (Class)
Implements: tracker.Observable

Global context singleton for the elements UI system.

Provides centralized access to:

  • Theme configuration
  • User preferences and window states
  • Root view container
  • Focused window tracking
  • Shared assets management

The context automatically persists user data (window positions, sizes, etc.) to local storage and restores it on startup.

Access the singleton instance via Context.context.

Static Members

elements
context: Context

Global singleton instance of the UI context

Instance Members

elements
observedDirty: Bool

Default is false, automatically set to true when any of this instance's observable variables has changed.


elements
theme: Theme

The current UI theme controlling visual appearance


elements
user: UserData

User preferences and persistent data storage


elements
windowsData: ceramic.ReadOnlyMap<String, WindowData>

Read-only map of window data by window ID


elements
view: ceramic.View

The root view container for all UI elements


elements
focusedWindow: Window

The currently focused window (receives keyboard input)


elements
assets: ceramic.Assets

Shared assets instance for loading UI resources


elements
invalidateTheme(): Void

elements
addWindowData(windowData: WindowData): Void

Adds or updates window data in the persistent storage. Window data includes position, size, and other state information.

Name Type Description
windowData WindowData The window data to store (must have non-null id)

Private Members

elements
unobservedTheme: Theme

elements
emitObservedDirty(instance: Context, fromSerializedField: Bool): Void

Event when any observable value as changed on this instance.

Name Type
instance Context
fromSerializedField Bool

elements
emitThemeChange(current: Theme, previous: Theme): Void

Event when theme field changes.

Name Type
current Theme
previous Theme

elements
new(): Void

Private constructor for singleton pattern. Loads persisted user data and sets up auto-save.

Metadata

Name Parameters
:build tracker.macros.ObservableMacro.build()
:autoBuild tracker.macros.ObservableMacro.build()
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()
:allow elements.Im
:allow elements.ImSystem