Workspaceinterface
An object describing a workspace
Properties (35)
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| allowDrop⚓︎ | boolean | x | x | Indicates if dropping outsize windows to the workspace is allowed |
| allowDropBottom⚓︎ | boolean | x | x | Indicates if dropping windows in the bottom-most zone of the workspace is allowed |
| allowDropLeft⚓︎ | boolean | x | x | Indicates if dropping windows in the left-most zone of the workspace is allowed |
| allowDropRight⚓︎ | boolean | x | x | Indicates if dropping windows in the right-most zone of the workspace is allowed |
| allowDropTop⚓︎ | boolean | x | x | Indicates if dropping windows in the top-most zone of the workspace is allowed |
| allowExtract⚓︎ | boolean | x | x | Indicates if extracting windows from the workspace is allowed |
| allowSplitters⚓︎ | boolean | x | x | Indicates if dragging of splitters is allowed in the workspace |
| allowSystemHibernation⚓︎ | boolean | x | x | Indicates whether the Workspace can be hibernated via the platform configuration.
This setting doesn't apply to programmatic hibernation via the |
| allowWindowReorder⚓︎ | boolean | x | x | Indicates if reordering windows in the workspace is allowed |
| allowWorkspaceTabExtract⚓︎ | boolean | x | x | Controls whether the workspace tab can be extracted. Available only in io.Connect Desktop. |
| allowWorkspaceTabReorder⚓︎ | boolean | x | x | Controls whether the workspace tab can be reordered |
| children⚓︎ | WorkspaceElement[] | x | A collection containing the immediate children of this workspace |
|
| frame⚓︎ | Frame | x | An object representing the frame containing this workspace |
|
| frameId⚓︎ | string | x | The string id of the frame containing this workspace |
|
| height⚓︎ | number | x | x | Returns the current height of the workspace |
| icon⚓︎ | string | x | x | The icon related to the workspace in the same format as it was passed |
| id⚓︎ | string | x | An unique string identifier of the workspace |
|
| isHibernated⚓︎ | boolean | x | x | Indicates if the workspace is hibernated |
| isPinned⚓︎ | boolean | x | x | Indicates if the workspace is in a pinned state or not |
| isSelected⚓︎ | boolean | x | x | Indicates if the workspace is selected in its frame. Can be undefined if using with an older version of io.Connect Desktop or io.Connect Browser. |
| layoutName⚓︎ | string | undefined | x | The name of the originating layout of the current workspace if any |
|
| loadingStrategy⚓︎ | LoadingStrategy | x | x | Indicates the loading strategy for the Workspace. Available only in io.Connect Desktop. |
| maxHeight⚓︎ | number | x | x | Returns the maximum height of the workspace, calculated by the constraints of all elements inside it |
| maxWidth⚓︎ | number | x | x | Returns the maximum width of the workspace, calculated by the constraints of all elements inside it |
| minHeight⚓︎ | number | x | x | Returns the minimum height of the workspace, calculated by the constraints of all elements inside it |
| minWidth⚓︎ | number | x | x | Returns the minimum width of the workspace, calculated by the constraints of all elements inside it |
| positionIndex⚓︎ | number | x | The position of this workspace regarding it's siblings |
|
| showAddWindowButtons⚓︎ | boolean | x | x | Indicates if the window add buttons within this workspace are visible to the user |
| showCloseButton⚓︎ | boolean | x | x | Indicates if the close button for this workspace is visible to the user |
| showEjectButtons⚓︎ | boolean | x | x | Indicates if the eject buttons of the windows within this workspace are visible to the user |
| showSaveButton⚓︎ | boolean | x | x | Indicates if the save button for this workspace is visible to the user |
| showWindowCloseButtons⚓︎ | boolean | x | x | Indicates if the close buttons of the windows within this workspace are visible to the user |
| title⚓︎ | string | x | The title of the workspace |
|
| width⚓︎ | number | x | x | Returns the current width of the workspace |
| windowDragMode⚓︎ | "keepInside" | "autoEject" | x | x | Mode for dragging the windows that are part of the Workspace. If set to |
51 Methods
addColumn()⚓︎
(definition?: BoxDefinition) => Promise<Column>
Adds a new column to this workspace.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| definition⚓︎ | BoxDefinition | x | An object describing the available column settings. |
addGroup()⚓︎
(definition?: BoxDefinition) => Promise<Group>
Adds a new group to this workspace.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| definition⚓︎ | BoxDefinition | x | An object describing the available group settings. |
addRow()⚓︎
(definition?: BoxDefinition) => Promise<Row>
Adds a new row to this workspace.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| definition⚓︎ | BoxDefinition | x | An object describing the available row settings. |
addWindow()⚓︎
(definition: WorkspaceWindowDefinition) => Promise<WorkspaceWindow>
Adds a new window to this workspace.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| definition⚓︎ | WorkspaceWindowDefinition | An object describing the available window settings. |
bundleToColumn()⚓︎
() => Promise<void>
Transforms this workspace into a workspace with one immediate child of type column and all existing elements are inserted as a child to that row.
bundleToRow()⚓︎
() => Promise<void>
Transforms this workspace into a workspace with one immediate child of type row and all existing elements are inserted as a child to that row.
getAllBoxes()⚓︎
(predicate?: (box: WorkspaceBox) => boolean) => WorkspaceBox[]
Returns all boxes in this workspace, which satisfy the provided predicate. If no predicate was provided, will return all boxes.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| predicate⚓︎ | (box: WorkspaceBox) => boolean | x | A filtering function (predicate) called for each box present in this workspace. |
getAllColumns()⚓︎
Returns all columns in this workspace, which satisfy the provided predicate. If no predicate was provided, will return all column.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| predicate⚓︎ | (columns: Column) => boolean | x | A filtering function (predicate) called for each column present in this workspace. |
getAllGroups()⚓︎
getAllRows()⚓︎
getAllWindows()⚓︎
(predicate?: (window: WorkspaceWindow) => boolean) => WorkspaceWindow[]
Returns all windows in this workspace, which satisfy the provided predicate. If no predicate was provided, will return all windows.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| predicate⚓︎ | (window: WorkspaceWindow) => boolean | x | A filtering function (predicate) called for each window present in this workspace. |
getBox()⚓︎
(predicate: (box: WorkspaceBox) => boolean) => WorkspaceBox
Returns the first box in this workspace, which satisfies the provided predicate.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| predicate⚓︎ | (box: WorkspaceBox) => boolean | A filtering function (predicate) called for each box present in this workspace. |
getColumn()⚓︎
getGroup()⚓︎
getRow()⚓︎
getWindow()⚓︎
(predicate: (window: WorkspaceWindow) => boolean) => WorkspaceWindow
Returns the first window in this workspace, which satisfies the provided predicate.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| predicate⚓︎ | (window: WorkspaceWindow) => boolean | A filtering function (predicate) called for each window present in this workspace. |
hibernate()⚓︎
() => Promise<void>
Puts the workspace in a hibernated state. All the windows are closed, but the workspace structure remains.
hideLoadingAnimation()⚓︎
() => Promise<void>
Hides the loading animation of the workspace. Available only in io.Connect Desktop.
lock()⚓︎
(config?: WorkspaceLockConfig | ((config: WorkspaceLockConfig) => WorkspaceLockConfig)) => Promise<void>
Locks the workspace using a provided config object, which restricts various modification functionalities of the workspace
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| config⚓︎ | WorkspaceLockConfig | ((config: WorkspaceLockConfig) => WorkspaceLockConfig) | x | This can be either an object or a function. When the object is provided, it overrides all other lock properties. When a function is provided, it will be called with the current lock settings and it should return a lock config, which will override the current settings. The function is recommended in all cases where overriding of the settings is not desired. |
onClosed()⚓︎
(callback: (closed?: WorkspaceClosedData) => void) => Promise<Unsubscribe>
Notifies when this workspace is closed.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (closed?: WorkspaceClosedData) => void | Callback function to handle the event. |
onContextUpdated()⚓︎
(callback: (data: any) => void) => Promise<Unsubscribe>
Notifies when the context for this workspace was updated.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (data: any) => void | Callback function to handle the event. |
onHibernated()⚓︎
(callback: () => void) => Promise<Unsubscribe>
Notifies when the Workspace is hibernated. Returns an unsubscribe function.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | () => void | Callback function for handling the event. |
onLockConfigurationChanged()⚓︎
(callback: (config: WorkspaceLockConfig) => void) => Promise<Unsubscribe>
Notifies when the a change in the lock configuration of the workspace has been made
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (config: WorkspaceLockConfig) => void | Callback function to handle the event. Receives the new lock configuration as a parameter. |
onResumed()⚓︎
(callback: () => void) => Promise<Unsubscribe>
Notifies when the Workspace is resumed after being hibernated. Returns an unsubscribe function.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | () => void | Callback function for handling the event. |
onTabReordered()⚓︎
(callback: () => void) => Promise<Unsubscribe>
Notifies when the Workspace tab has been reordered. Returns an unsubscribe function.
io.Connect Browser 4.4Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | () => void | Callback function for handling the event. Available only in io.Connect Browser. |
onWindowAdded()⚓︎
(callback: (window: WorkspaceWindow) => void) => Promise<Unsubscribe>
Notifies when a new window was added to this workspace and returns an unsubscribe function. An added window means that the window has a place in the workspace (it is a valid workspace element), but does not guarantee that the contents of the window are loaded.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (window: WorkspaceWindow) => void | Callback function to handle the event. Receives the added window as a parameter. |
onWindowLoaded()⚓︎
(callback: (window: WorkspaceWindow) => void) => Promise<Unsubscribe>
Notifies when a window's content was loaded in this workspace and returns an unsubscribe function. A loaded window is a window, which was added to a workspace, it's contents were loaded and is present in the windows collection.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (window: WorkspaceWindow) => void | Callback function to handle the event. Receives the loaded window as a parameter. |
onWindowMaximized()⚓︎
(callback: (window: WorkspaceWindow) => void) => Promise<Unsubscribe>
Notifies when a window was maximized in this workspace and returns an unsubscribe function. A maximized window means that the window has been maximized either by an API call or from the maximize button by the user.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (window: WorkspaceWindow) => void | Callback function to handle the event. Receives the maximized window as a parameter. |
onWindowRemoved()⚓︎
(callback: (removed: { windowId?: string; workspaceId: string; frameId: string }) => void) => Promise<Unsubscribe>
Notifies when a window was removed from this workspace and returns an unsubscribe function. Not supported in io.Connect Browser.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (removed: { windowId?: string; workspaceId: string; frameId: string }) => void | Callback function to handle the event. Receives an object containing the ids of the removed window, and the respective workspace and frame as a parameter. |
onWindowRestored()⚓︎
(callback: (window: WorkspaceWindow) => void) => Promise<Unsubscribe>
Notifies when a window was restored in this workspace and returns an unsubscribe function. A restored window means that the window has been restored from a maximized state either by an API call or from the restored button by the user.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (window: WorkspaceWindow) => void | Callback function to handle the event. Receives the restored window as a parameter. |
onWindowSelected()⚓︎
(callback: (window: WorkspaceWindow) => void) => Promise<Unsubscribe>
Notifies when a window was selected in this workspace and returns an unsubscribe function.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (window: WorkspaceWindow) => void | Callback function to handle the event. Receives the selected window as a parameter. |
onWindowTabReordered()⚓︎
(callback: (window: WorkspaceWindow) => void) => Promise<Unsubscribe>
Notifies when the tab of a window participating in the Workspace has been reordered. Returns an unsubscribe function.
io.Connect Browser 4.4Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (window: WorkspaceWindow) => void | Callback function for handling the event. Receives as an argument the |
pin()⚓︎
(options?: WorkspacePinOptions) => Promise<void>
Changes the state of the workspace to pinned - moves the workspace tab to the index before all unpinned tabs, removes the save button, title, close button and shows the workspace icon
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| options⚓︎ | WorkspacePinOptions | x |
|
refreshReference()⚓︎
() => Promise<void>
Updates this workspace reference to reflect the current state of the workspace.
remove()⚓︎
(predicate: (child: WorkspaceElement) => boolean) => Promise<void>
Removes the first element of this workspace which satisfies the predicate.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| predicate⚓︎ | (child: WorkspaceElement) => boolean | A filtering function (predicate) called for each element in this workspace. |
removeChild()⚓︎
(predicate: (child: WorkspaceElement) => boolean) => Promise<void>
Removes the first immediate child of this workspaces which satisfies the predicate.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| predicate⚓︎ | (child: WorkspaceElement) => boolean | A filtering function (predicate) called for immediate child of this workspace. |
resume()⚓︎
() => Promise<void>
Resumes a hibernated workspace. All the windows prior to the hibernation are reloaded.
saveLayout()⚓︎
(name: string, config?: SaveLayoutConfig) => Promise<void>
Saves the current workspace structure as a layout. In io.Connect Browser this will throw an error if the name matches the name of a read-only layout.
Parameters (2)
| Name | Type | Required | Description |
|---|---|---|---|
| name⚓︎ | string | A string representing the name (also ID) of the new workspace layout. |
|
| config⚓︎ | SaveLayoutConfig | x | An optional object used to set various options for saving the workspace layout. |
setContext()⚓︎
(data: any) => Promise<void>
Sets the context for this workspace. This operation will completely overwrite the existing context.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| data⚓︎ | any | The new context value. |
setIcon()⚓︎
(icon: string) => Promise<void>
Changes the workspace icon to the specified one
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| icon⚓︎ | string | x |
setLoadingStrategy()⚓︎
(strategy: LoadingStrategy) => Promise<void>
Sets the loading strategy for the Workspace at runtime.
This will override the current loading strategy for the Workspace that may have been specified via configuration or programmatically
when creating or restoring the Workspace. The loading strategy specified via this method will be preserved in the Workspace Layout
only if the Workspace is saved afterwards and the "persistCurrentStrategy" flag is set to true in the Workspaces App definition.
Available only in io.Connect Desktop.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| strategy⚓︎ | LoadingStrategy | Loading strategy for the Workspace. |
setTitle()⚓︎
(title: string) => Promise<void>
Sets a new title for this workspace.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| title⚓︎ | string | The new title value. |
setWindowDragMode()⚓︎
(mode: "keepInside" | "autoEject") => Promise<void>
Sets the mode for dragging the windows that are part of the Workspace. Available only in io.Connect Desktop.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| mode⚓︎ | "keepInside" | "autoEject" | Mode for dragging the Workspace windows. If set to |
showLoadingAnimation()⚓︎
() => Promise<void>
Shows the loading animation of the workspace. Available only in io.Connect Desktop.
snapshot()⚓︎
() => Promise<WorkspaceSnapshot>
Returns a snapshot object describing the full current state of this workspace.
unpin()⚓︎
() => Promise<void>
Changes the state of the workspace to normal - moves the workspace tab to the index after all pinned tabs, returns the save button, title, close button and hides the workspace icon