AboutSupportDeveloper GuideVersion 41.132.100.56

Static namespace for OpenFin API methods that interact with the _Window class, available under fin.Window.

Hierarchy

  • Base
    • _WindowModule

Accessors

  • get me(): Identity
  • Returns Identity

    me should only be accessed from the fin global (FinApi.me); access through entity classes is not guaranteed to behave sensibly in all calling contexts.

Methods

  • Creates a new Window.

    Parameters

    Returns Promise<Window>

    async function createWindow() {
    const winOption = {
    name:'child',
    defaultWidth: 300,
    defaultHeight: 300,
    url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.create.html',
    frame: true,
    autoShow: true
    };
    return await fin.Window.create(winOption);
    }

    createWindow().then(() => console.log('Window is created')).catch(err => console.log(err));
  • Asynchronously returns a Window object that represents the current window

    Returns Promise<Window>

    fin.Window.getCurrent()
    .then(wnd => console.log('current window'))
    .catch(err => console.log(err));
  • Synchronously returns a Window object that represents the current window

    Returns Window

    const wnd = fin.Window.getCurrentSync();
    const info = await wnd.getInfo();
    console.log(info);
  • Asynchronously returns an API handle for the given Window identity.

    Parameters

    Returns Promise<Window>

    Wrapping a Window identity that does not yet exist will not throw an error, and instead returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing for a Window throughout its entire lifecycle.

    async function createWin() {
    const app = await fin.Application.start({
    name: 'myApp',
    uuid: 'app-1',
    url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.wrap.html',
    autoShow: true
    });
    return await app.getWindow();
    }
    createWin().then(() => fin.Window.wrap({ uuid: 'app-1', name: 'myApp' }))
    .then(win => console.log('wrapped window'))
    .catch(err => console.log(err));
  • Synchronously returns an API handle for the given Window identity.

    Parameters

    Returns Window

    Wrapping a Window identity that does not yet exist will not throw an error, and instead returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing for a Window throughout its entire lifecycle.

    async function createWin() {
    const app = await fin.Application.start({
    name: 'myApp',
    uuid: 'app-1',
    url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.wrapSync.html',
    autoShow: true
    });
    return await app.getWindow();
    }
    await createWin();
    let win = fin.Window.wrapSync({ uuid: 'app-1', name: 'myApp' });