Options
All
  • Public
  • Public/Protected
  • All
Menu

Sample DockProvider definition.

The icon for DockProvider must be in a raster image format. An SVG is not processed.

Import required dependencies.

import { Dock, DockProvider, DockButtonNames } from '@openfin/workspace';
import { CustomDropdownItemActionPayload, init } from "@openfin/workspace-platform";

Create provider object to pass to the static register function of the Dock type.

const provider: DockProvider = {
id: 'provider-id',
title: 'Sample Dock',
icon: 'https://www.openfin.co/favicon-32x32.png',
buttons: [
{
tooltip: 'Sample Button 1',
iconUrl: 'https://www.openfin.co/favicon-32x32.png',
action: {
id: 'sampleButton1'
}
},
{
type: DockButtonNames.DropdownButton,
tooltip: 'Sample Dropdown Button',
iconUrl: 'https://www.openfin.co/favicon-32x32.png',
options: [
{
tooltip: 'Dropdown Button 1',
iconUrl: 'https://www.openfin.co/favicon-32x32.png',
action: {
id: 'dropdownButton1',
customData: "dropdownButton1 clicked"
}
},
{
tooltip: 'Dropdown Button 2',
iconUrl: 'https://www.openfin.co/favicon-32x32.png',
action: {
id: 'dropdownButton2',
customData: "dropdownButton2 clicked"
}
}
]
}
]
};

Initialize workspace with customActions to be invoked by dock dropdown.

await init({
browser: {},
customActions: {
"dropdownButton1": async (payload: CustomDropdownItemActionPayload) => {
alert(payload.customData)
},
"dropdownButton2": async (payload: CustomDropdownItemActionPayload) => {
alert(payload.customData)
}
}
});

Register Dock provider object.

await Dock.register(provider);

Show Dock.

await Dock.show();

Hierarchy

Index

Properties

buttons?: DockButton[]

Buttons for platform-specific custom actions to display on the Dock.

clientAPIVersion?: string

version of client SDK, set by the API

disableUserRearrangement?: boolean

If true, the user will not be able to rearrange the buttons on the Dock.

default

false

icon: string

Icon for the provider.

id: string

Unique identifier for the provider.

skipSavedDockProviderConfig?: boolean

By default, the Dock will save the user's configuration and restore it on the next launch.

If true, the currently stored configuration will be ignored and the Dock will use the configuration provided by the provider.

default

false

title: string

A UI friendly title for the provider platform.

Controls the visibility of buttons for workspace components on the Dock. All components are visible by default, but you can hide any of them.

default
  • All components are visible. (['switchWorkspace', 'home', 'notifications', 'store'])

Generated using TypeDoc