Finsemble: The Window Descriptor

The Window Descriptor


The Finsemble Window Descriptor is an object that defines a window's default size and position, its name, initialization data, and how it interacts with the rest of a finsemble application. This object can be accessed inside of a finsemble window by parsing FSBL.Clients.WindowClient.options.customData.[window|component|foreign];

Top-level properties

  1. window This is a superset of the OpenFin windowOptions object. Any property on the OpenFin windowOptions object is available to modify when spawning a new window.
  2. component This is data that you'd like your component to have upon startup (e.g, default state, etc).
  3. foreign This describes how your component interacts with the rest of your finsemble application.

Defaults

    {
        "window": {
            "url": componentPath,
            "frame": false,
            "resizable": true,
            "autoShow": true,
            "defaultTop": "center",
            "defaultLeft": "center",
            "defaultWidth": 800,
            "defaultHeight": 600
            },
        "component": {
            "type": componentName
        },
        "foreign": {
            "services": {
                "workspaceService": {
                    "isArrangable": true
                },
                "launcherService": {
                    "inject": remote
                }
            },
            "components": {
                "App Launcher": {
                    "launchableByUser": true
                },
                "Window Manager": {
                    "FSBLHeader": true,
                    "persistWindowState": true                            
                },
                "Toolbar": {
                    "iconClass": componentName
                }
            }
        }
    };

Customizing your component's default behavior.

Window

url default=undefined

Where you want to pull your component from. This can be anywhere; however, if it doesn't include FSBL, you will not be able to communicate with other components. You can get around this limitation by setting foreign.components.services.launcherService.inject = true;

defaultLeft default='center', defaultTop default='center'

Can be 'center' or a whole number. Fractional numbers will crash the application; if you want to calculate dimensions based on the user's monitor, be sure to round the result. A defaultLeft or defaultTop of 'center' will cause the program to spawn the component on the monitor where the action was initiated.

defaultWidth default=800, defaultHeight default=600

Width and height must be whole numbers.

Component

type

This is the name of your component in the toolbar's menu. By default, we just reverse out of the CamelCase component name and capitalize the first letter in each word.

Foreign

Components

Window Manager

FSBLHeader default=true

Whether to include a header bar that allows for minimize, maximize, restore, linking, etc.

showLinker default=false

Whether to include the linker button.

persistWindowState default=true

Whether to persist the window's position and size to the active workspace.

Toolbar

iconClass default=null

This is the class for an icon that is next to your component's name in the toolbar. If it isn't provided, a generic icon is shown.

App Launcher

launchableByUser default=true

Whether to add the component to the App Launcher.

Services

WorkspaceService

isArrangable default=true

Whether the component should respond when the workspaceService arranges the windows on a monitor.

launcherService

inject default=false

Whether to inject FSBL.js into the component on spawn. By default, this is false. This is used when spawning adhoc components that you did not create.