AboutSupportDeveloper GuideVersion 41.132.100.57

Interface LayoutManager<T>Experimental

NOTE: Internal use only. This type is reserved for Workspace Browser implementation.

Responsible for aggregating all layout snapshots and storing layout instances

interface LayoutManager<T> {
    applyLayoutSnapshot(snapshot: T): Promise<void>;
    getLayoutIdentityForView(viewIdentity: Identity): undefined | LayoutIdentity;
    getLayoutSnapshot(): Promise<T>;
    isLayoutVisible(__namedParameters: LayoutIdentity): boolean;
    removeLayout(LayoutIdentity: LayoutIdentity): Promise<void>;
    resolveLayoutIdentity(identity?: Identity | LayoutIdentity): undefined | LayoutIdentity;
    showLayout(layoutIdentity: LayoutIdentity): Promise<void>;
    size(): number;
}

Type Parameters

Methods

  • Experimental

    To enable multiple layouts, override this method and do not call super.applyLayoutSnapshot()

    This hook is called by OpenFin during fin.Platform.Layout.init() call, to pass a snapshot to derived classes which will be used launch a platform window. Use this hook to set your local UI state and begin rendering the containers for your layouts UI.

    Ensure you call fin.Platform.Layout.create() on every layout in snapshot.layouts when that layout is ready to be created in your application.

    If you add custom data to the app manifest snapshot.windows.layoutSnapshot key, this data will be included in the snapshot type.

    The default implementation throws if it is called with a snapshot containing more than one layout.

    Parameters

    • snapshot: T

    Returns Promise<void>

    if Object.keys(snapshot).length > 1

  • Experimental

    Returns Promise<T>

    T

  • Experimental

    Parameters

    Returns boolean

  • Experimental

    A hook provided to the consumer when it's time to remove a layout. Use this hook to update your local state and remove the layout for the given LayoutIdentity. Note that this hook does not call fin.Platform.Layout.destroy() for you, instead it is to signify to your application it's time to destroy this layout.

    Note that if the Window Option WindowOptions.closeOnLastViewRemoved is true, and the last View in this layout is closed, this hook will be called before the window closes.

    Parameters

    Returns Promise<void>

  • Experimental

    A hook provided to the consumer for controlling how OpenFin routes Layout API calls. Override this method to control the target layout for Layout API calls.

    Example use case: You have hidden all the layouts and are showing a dialog that will execute an API call (ex: Layout.replace()) - override this method and save the "last visible" layout identity and return it.

    By default, OpenFin will use a series of checks to determine which Layout the API call must route to in this order of precedence:

    • try to resolve the layout from the layoutIdentity, throws if missing
    • if there is only 1 layout, resolves that one
    • enumerates all layouts checks visibility via element offsetTop/Left + window.innerHeight/Width
    • returns undefined

    Parameters

    Returns undefined | LayoutIdentity

    LayoutIdentity | undefined

  • Experimental

    Must be overridden when working with multiple layouts

    Hook for allowing OpenFin to show a given layout. It's recommended to enumerate your layout containers and find the one matching layoutIdentity.layoutName and show that container and hide the others.

    Parameters

    Returns Promise<void>

  • Experimental

    Returns number