LayoutActions
Actions the panel may perform related to the user's current layout via context.layout.
Methods
addPanel()
addPanel(params): void;
Use context.layout.addPanel to add a panel adjacent to the current panel in the layout.
The value of position must be set to "sibling".
The value of type can refer to a panel from a custom extension as extensionname.panelname,
where extensionname is the extension name from package.json and panelname is the name
provided when the extension registers a panel.
getState is set to a function that returns the state (also known as panel settings) for the
new panel, or return undefined to use the new panel's default settings.
// Add new panel
context.layout.addPanel({
position: "sibling",
type: "MyExtension.MyPanel",
getState: () => ({}),
});
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { position: "sibling"; type: string; updateIfExists?: boolean; getState: unknown; } | - |
params.position | "sibling" | Where to position the panel. Currently, only "sibling" is supported which indicates the new panel will be adjacent to the calling panel. |
params.type | string | The type of panel to open. For extension panels, this "extensionName.panelName" where extensionName is the name field from the extension's package.json, and panelName is the name provided to registerPanel(). |
params.updateIfExists? | boolean | Whether to update an existing sibling panel of the same type, if it already exists. If false or omitted, a new panel will always be added. Deprecated This parameter is only supported for built-in panels at this time. |
params.getState | - |
Returns
void