Class: LauncherClient

Launcher Client


The Launcher client handles spawning windows. It also maintains the list of spawnable components.

Methods

getActiveDescriptors
(cb)

clients/launcherClient.js, line 210

Gets the window descriptors for all open windows. This returns a list of applications and all of their child windows. This will also return windows that are not part of your workspace.

Name Type Description
cb function

Callback

Example
FSBL.Clients.LauncherClient.getActiveDescriptors(function(err,response){
	var windowDescriptors = response;
	var childWindows=windowDescriptors[0].childWindows;
});

getComponentDefaultConfig
(componentType, cb)

clients/launcherClient.js, line 79

Get the defaults for an individual component.

Name Type Description
componentType String

The type of the component you are looking for

cb function

Callback to be invoked after function is completed.

Example
FSBL.Clients.launcherClient.getComponentDefaultConfig('Advanced Chart', function(err, data){
	//do something with the default values for Advanced chart.
});

getComponentDefaults
(cb)

clients/launcherClient.js, line 250

Gets the default configs for a components.

Name Type Description
cb function

Callback

getComponentList
(cb)

clients/launcherClient.js, line 60

Get a list of spawnable components. This is useful if you need to list all of your components (e.g., in a toolbar).

Name Type Description
cb function

Callback to be invoked after function is completed.

Example

Something like this could be done to retrieve the list of components inside of something like a Toolbar or a launcher.

var self=this; 
FSBL.Clients.LauncherClient.getComponentList(function(err, data){
	self.setState({
		componentList: data
	 });
});

getWindow
(windowName, cb)

clients/launcherClient.js, line 171

Gets the window information for a provided window.

Name Type Description
windowName string

The name of the window you are looking for

cb function optional

Callback

Example
//Gets the window info for the Advanced Chart window.
FSBL.Clients.LauncherClient.getWindow(windowName,function(err,response){
	var windowInfo =  response;
});

isWindowOpen
(windowName, cb)

clients/launcherClient.js, line 190

Checks to see if a window is currently open...not necessarily visible

Name Type Description
windowName string

The name of the window you are looking for

cb function

Callback

Example
//Checks if Advanced Chart window if opens.
	FSBL.Clients.LauncherClient.isWindowOpen(windowName, function(err,response){
		var windowOpen =  response;//true or false;
	});

spawn
(component, params, cb)

clients/launcherClient.js, line 111

Asks the Launcher service to spawn a window. The examples below shows the basic functionality that the launcher offers. Please see the Window Spawning tutorial for advanced functionality.

Name Type Description
component String

Type of the component to launch

params object
Name Type Description
options LauncherClient~windowDescriptor

Properties to merge with the default windowDescriptor.

addToWorkspace Object

Whether to add window to workspace.

cb function optional

Callback to be invoked after function is completed.'

Example
//Spawns an advanced chart with the default positioning.
FSBL.Clients.LauncherClient.spawn("Advanced Chart");
//Spawns an advanced chart in the center of the monitor from where the spawn call originated. If A component on monitor 3 invokes Spawn and passes in a defaultLeft of 'center', it will spawn on monitor 3.
FSBL.Clients.LauncherClient.spawn("Advanced Chart", {
	addToWorkspace:true,
	options:{
		defaultLeft: 'center',
		defaultTop: 'center'
	}
	}, function(err, response){
		var windowName = response;
	});

Type Definitions

windowDescriptorobject

Finsemble windowDescriptor. 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.

Properties:
Name Type Argument Default Description
url string

url to load.

defaultTop number

Top pixel of the window. The top left of the screen is 0.

defaultLeft number

Left edge of the window.

defaultWidth number

Window width.

defaultHeight number

Window height

showTaskbarIcon boolean <optional>
true

Whether to show the icon in the taskbar.

minWidth number <optional>
0

Minimum width that the window can be resized to.

minHeight number <optional>
0

Minimum height that the window can be resized to.

autoShow boolean <optional>
true

Whether the window should render in the background. If this option is set to false, you must tell the window to show itself at some point. You can use WindowClient#show.

frame boolean <optional>
false

Whether the window should be rendered with a sytem frame.

resizable boolean <optional>
true

Whether the window can be resized.

maximizable boolean <optional>
true

Whether the window can be maximized.

alwaysOnTop boolean <optional>
false

Whether the window should always sit on top of other finsemble windows.

fixedPosition boolean <optional>
false

Whether the window should remain where it was spawned.

resizeRegion Object <optional>
Properties
Name Type Argument Default Description
size number <optional>
10
bottomCorner number <optional>
10