Applications are constructed by providing an object of configuration options.
Optional
options: Partial<Configuration> = {}Options used to configure the Application instance
Application instance configuration options.
If this Application uses tabbed navigation groups, this mapping is updated whenever the changeTab method is called. Reports the active tab for each group. Subclasses may override this property to define default tabs for each group.
The current position of the application with respect to the window.document.body.
Private
#idPrivate
#renderableFlag that this Application instance is renderable. Applications are not renderable unless a subclass defines the _renderHTML and _replaceHTML methods.
Private
#elementThe outermost HTMLElement of this rendered Application. For window applications this is ApplicationV2##frame. For non-window applications this ApplicationV2##content.
Private
#contentThe HTMLElement within which inner HTML is rendered. For non-window applications this is the same as ApplicationV2##element.
Private
#minimizationData pertaining to the minimization status of the Application.
Private
#positionThe rendered position of the Application.
Private
#statePrivate
#semaphoreA Semaphore used to enqueue asynchronous operations.
Private
#controlsIs the window control buttons menu currently expanded?
Private
#eventsA mapping of registered events.
Static
BASE_Designates which upstream Application class in this class' inheritance chain is the base application. Any DEFAULT_OPTIONS of super-classes further upstream of the BASE_APPLICATION are ignored. Hook events for super-classes further upstream of the BASE_APPLICATION are not dispatched.
Static
DEFAULT_The default configuration options which are assigned to every instance of this Application class.
Static
RENDER_The sequence of rendering states that describe the Application life-cycle.
Static
emittedStatic
Private
#frontWhich application is currently "in front" with the maximum z-index
Convenience references to window header elements.
The CSS class list of this Application instance
The HTML element ID of this Application instance.
A convenience reference to the title of the Application window.
The HTMLElement which renders this Application into the DOM.
Is this Application instance currently minimized?
Is this Application instance currently rendered?
The current render state of the Application.
Does this Application instance render within an outer window frame?
Render the Application, creating its HTMLElement and replacing its innerHTML. Add it to the DOM if it is not currently rendered and rendering is forced. Otherwise, re-render its contents.
Optional
options: boolean | RenderOptions = {}Options which configure application rendering behavior. A boolean is interpreted as the "force" option.
Optional
_options: RenderOptions = {}Legacy options for backwards-compatibility with the original ApplicationV1#render signature.
A Promise which resolves to the rendered Application instance
Render an HTMLElement for the Application. An Application subclass must implement this method in order for the Application to be renderable.
Context data for the render operation
Options which configure application rendering behavior
The result of HTML rendering may be implementation specific. Whatever value is returned here is passed to _replaceHTML
Close the Application, removing it from the DOM.
Optional
options: ApplicationClosingOptions = {}Options which modify how the application is closed.
A Promise which resolves to the closed Application instance
Update the Application element position using provided data which is merged with the prior position.
Optional
position: Partial<ApplicationPosition>New Application positioning data
The updated application position
Change the active tab within a tab group in this Application instance.
The name of the tab which should become active
The name of the tab group which defines the set of tabs
Optional
options: { Additional options which affect tab navigation
An interaction event which caused the tab change, if any
An explicit navigation element being modified
Force changing the tab even if the new tab is already active
Update application position after changing the tab?
Add a new event listener for a certain type of event.
The type of event being registered for
The listener function called when the event occurs
Optional
options: { Options which configure the event listener
Should the event only be responded to once and then removed
Remove an event listener for a certain type of event.
The type of event being removed
The listener function being removed
Protected
_initializeProtected
Initialize configuration options for the Application instance. The default behavior of this method is to intelligently merge options for each class with those of their parents.
Options provided directly to the constructor
Configured options for the application instance
Protected
_configureProtected
Modify the provided options passed to a render request.
Options which configure application rendering behavior
Protected
_prepareProtected
Prepare application rendering context data for a given render request.
Options which configure application rendering behavior
Context data for the render operation
Protected
_getProtected
Configure the array of header control menu options
Protected
_headerProtected
Iterate over header control buttons, filtering for controls which are visible for the current client.
Protected
_replaceHTMLProtected
Replace the HTML of the application with the result provided by the rendering backend. An Application subclass should implement this method in order for the Application to be renderable.
The result returned by the application rendering backend
The content element into which the rendered result must be inserted
Options which configure application rendering behavior
Protected
_renderProtected
Render the outer framing HTMLElement which wraps the inner HTML of the Application.
Options which configure application rendering behavior
Protected
_renderProtected
Render a header control button.
Protected
_updateProtected
When the Application is rendered, optionally update aspects of the window frame.
Options provided at render-time
Protected
_insertProtected
_removeProtected
_updateProtected
Translate a requested application position updated into a resolved allowed position for the Application. Subclasses may override this method to implement more advanced positioning behavior.
Requested Application positioning data
Resolved Application positioning data
Protected
_canProtected
Test whether this Application is allowed to be rendered.
Provided render options
Return false to prevent rendering
An Error to display a warning message
Protected
_preProtected
Actions performed before a first render of the Application.
Prepared context data
Provided render options
Protected
_onProtected
Actions performed after a first render of the Application. Post-render steps are not awaited by the render process.
Prepared context data
Provided render options
Protected
_preProtected
Actions performed before any render of the Application. Pre-render steps are awaited by the render process.
Prepared context data
Provided render options
Protected
_onProtected
Actions performed after any render of the Application. Post-render steps are not awaited by the render process.
Prepared context data
Provided render options
Protected
_preProtected
Actions performed before closing the Application. Pre-close steps are awaited by the close process.
Provided render options
Protected
_onProtected
Actions performed after closing the Application. Post-close steps are not awaited by the close process.
Provided render options
Protected
_preProtected
Actions performed before the Application is re-positioned. Pre-position steps are not awaited because setPosition is synchronous.
The requested application position
Protected
_onProtected
Actions performed after the Application is re-positioned.
The requested application position
Protected
_attachProtected
_onProtected
A generic event handler for action clicks which can be extended by subclasses. Action handlers defined in DEFAULT_OPTIONS are called first. This method is only called for actions which have no defined handler.
The originating click event
The capturing HTML element which defined a [data-action]
Protected
_onProtected
Handle submission for an Application which uses the form element.
The form configuration for which this handler is bound
The form submission event
Private
#renderManage the rendering step of the Application life-cycle. This private method delegates out to several protected methods which can be defined by the subclass.
Optional
options: RenderOptionsOptions which configure application rendering behavior
A Promise which resolves to the rendered Application instance
Private
#closeManage the closing step of the Application life-cycle. This private method delegates out to several protected methods which can be defined by the subclass.
Optional
options: ApplicationClosingOptionsOptions which modify how the application is closed
A Promise which resolves to the rendered Application instance
Private
#applyApply validated position changes to the element.
The new position data to apply.
Private
#doPerform an event in the application life-cycle. Await an internal life-cycle method defined by the class. Optionally dispatch an event for any registered listeners.
A handler function to call
Options which configure event handling
Await the result of the handler function?
Arguments passed to the handler function
Debugging text to log for the event
An event name to dispatch for registered listeners
A hook name to dispatch for this and all parent classes
Arguments passed to the requested hook function
A promise which resoles once the handler is complete
Private
#onPrivate
#onPrivate
#onPrivate
#onPrivate
#startPrivate
#endPrivate
#onHandle a pointer move event while dragging or resizing the window frame.
The amount the cursor has moved since the last frame, or undefined if the movement occurred between frames.
Private
#onPrivate
#onPrivate
#onPrivate
#onPrivate
#onStatic
inheritanceIterate over the inheritance chain of this Application. The chain includes this Application itself and all parents until the base application is encountered.
ApplicationV2.BASE_APPLICATION
Static
parseCSSDimension
The Application class is responsible for rendering an HTMLElement into the Foundry Virtual Tabletop user interface.
Alias
ApplicationV2