RestoreHelpers

Layouts v1 API is deprecated and no longer supported as of OpenFin 16+. Please use Platform API instead.

Index

Functions

createChild

  • Given a WorkspaceWindow for a non-open window, this function will create the window, position it, and update its visibility, state, and frame to fit with the restoring workspace.

    Called by the standardRestoreHandler for any non-open windows in the WorkspaceApp.

    throws

    Error: If there is an existing child window with the same name.

    Parameters

    • workspaceWindow: WorkspaceWindow

      Object containing details of the window identity and how it should be created.

    Returns Promise<void>

createOrPositionChild

  • An additional helper function that can be used to create custom restore handlers.

    Given a WorkspaceWindow it will determine if the window is open and then call createChild or positionChild as appropriate.

    Parameters

    • workspaceWindow: WorkspaceWindow

      Object containing details of the window identity and how it should be positioned/created.

    Returns Promise<void>

positionChild

  • Given a WorkspaceWindow object for a currently open window, this will position and update the visibility, state and frame of that window to fit with the restoring workspace.

    Called by the standardRestoreHandler for any currently running windows in the workspace.

    throws

    Error: If the window described by workspaceWindow is not currently running.

    Parameters

    • workspaceWindow: WorkspaceWindow

      Object containing details of the window identity and how it should be positioned.

    Returns Promise<void>

standardRestoreHandler

  • A simple restore handler that can be passed to setRestoreHandler when no custom logic is needed.

    This restore handler will open any child windows which are not currently running, and move new and existing child windows to their expected positions for the workspace being restored.

    import {workspaces, restoreHelpers} from 'openfin-layouts';
    
    workspaces.setRestoreHandler(restoreHelpers.standardRestoreHandler);

    Parameters

    Returns Promise<WorkspaceApp>