### Import : ```js const WorkspaceManager = brackets.getModule("view/WorkspaceManager") ``` ## view/WorkspaceManager Manages layout of panels surrounding the editor area, and size of the editor area (but not its contents). Updates panel sizes when the window is resized. Maintains the max resizing limits for panels, based on currently available window size. Events: `workspaceUpdateLayout` When workspace size changes for any reason (including panel show/hide panel resize, or the window resize). The 2nd arg is the available workspace height. The 3rd arg is a refreshHint flag for internal use (passed in to recomputeLayout) * [view/WorkspaceManager](#module_view/WorkspaceManager) * _static_ * [.PANEL_TYPE_BOTTOM_PANEL](#module_view/WorkspaceManager.PANEL_TYPE_BOTTOM_PANEL) : string * [.PANEL_TYPE_PLUGIN_PANEL](#module_view/WorkspaceManager.PANEL_TYPE_PLUGIN_PANEL) : string * _inner_ * [.EVENT_WORKSPACE_UPDATE_LAYOUT](#module_view/WorkspaceManager..EVENT_WORKSPACE_UPDATE_LAYOUT) * [.EVENT_WORKSPACE_PANEL_SHOWN](#module_view/WorkspaceManager..EVENT_WORKSPACE_PANEL_SHOWN) * [.EVENT_WORKSPACE_PANEL_HIDDEN](#module_view/WorkspaceManager..EVENT_WORKSPACE_PANEL_HIDDEN) * [.createBottomPanel(id, $panel, [minSize])](#module_view/WorkspaceManager..createBottomPanel) ⇒ Panel * [.createPluginPanel(id, $panel, [minSize], $toolbarIcon, [initialSize])](#module_view/WorkspaceManager..createPluginPanel) ⇒ Panel * [.getAllPanelIDs()](#module_view/WorkspaceManager..getAllPanelIDs) ⇒ Array * [.getPanelForID(panelID)](#module_view/WorkspaceManager..getPanelForID) ⇒ Object * [.recomputeLayout(refreshHint)](#module_view/WorkspaceManager..recomputeLayout) * [.isPanelVisible(panelID)](#module_view/WorkspaceManager..isPanelVisible) ⇒ boolean * [.setPluginPanelWidth(width)](#module_view/WorkspaceManager..setPluginPanelWidth) * [.addEscapeKeyEventHandler(consumerName, eventHandler)](#module_view/WorkspaceManager..addEscapeKeyEventHandler) ⇒ boolean * [.removeEscapeKeyEventHandler(consumerName)](#module_view/WorkspaceManager..removeEscapeKeyEventHandler) ⇒ boolean ### view/WorkspaceManager.PANEL\_TYPE\_BOTTOM\_PANEL : string Constant representing the type of bottom panel **Kind**: static property of [view/WorkspaceManager](#module_view/WorkspaceManager) ### view/WorkspaceManager.PANEL\_TYPE\_PLUGIN\_PANEL : string Constant representing the type of plugin panel **Kind**: static property of [view/WorkspaceManager](#module_view/WorkspaceManager) ### view/WorkspaceManager.EVENT\_WORKSPACE\_UPDATE\_LAYOUT Event triggered when the workspace layout updates. **Kind**: inner constant of [view/WorkspaceManager](#module_view/WorkspaceManager) ### view/WorkspaceManager.EVENT\_WORKSPACE\_PANEL\_SHOWN Event triggered when a panel is shown. **Kind**: inner constant of [view/WorkspaceManager](#module_view/WorkspaceManager) ### view/WorkspaceManager.EVENT\_WORKSPACE\_PANEL\_HIDDEN Event triggered when a panel is hidden. **Kind**: inner constant of [view/WorkspaceManager](#module_view/WorkspaceManager) ### view/WorkspaceManager.createBottomPanel(id, $panel, [minSize]) ⇒ Panel Creates a new resizable panel beneath the editor area and above the status bar footer. Panel is initially invisible. The panel's size & visibility are automatically saved & restored as a view-state preference. **Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager) | Param | Type | Description | | --- | --- | --- | | id | string | Unique id for this panel. Use package-style naming, e.g. "myextension.feature.panelname" | | $panel | jQueryObject | DOM content to use as the panel. Need not be in the document yet. Must have an id attribute, for use as a preferences key. | | [minSize] | number | Minimum height of panel in px. | ### view/WorkspaceManager.createPluginPanel(id, $panel, [minSize], $toolbarIcon, [initialSize]) ⇒ Panel Creates a new resizable plugin panel associated with the given toolbar icon. Panel is initially invisible. The panel's size & visibility are automatically saved & restored. Only one panel can be associated with a toolbar icon. **Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager) | Param | Type | Description | | --- | --- | --- | | id | string | Unique id for this panel. Use package-style naming, e.g. "myextension.panelname". will overwrite an existing panel id if present. | | $panel | jQueryObject | DOM content to use as the panel. Need not be in the document yet. Must have an id attribute, for use as a preferences key. | | [minSize] | number | Minimum height of panel in px. | | $toolbarIcon | jQueryObject | An icon that should be present in main-toolbar to associate this panel to. The panel will be shown only if the icon is visible on the toolbar and the user clicks on the icon. | | [initialSize] | number | Optional Initial size of panel in px. If not given, panel will use minsize or current size. | ### view/WorkspaceManager.getAllPanelIDs() ⇒ Array Returns an array of all panel ID's **Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager) **Returns**: Array - List of ID's of all bottom panels ### view/WorkspaceManager.getPanelForID(panelID) ⇒ Object Gets the Panel interface for the given ID. Can return undefined if no panel with the ID is found. **Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager) **Returns**: Object - Panel object for the ID or undefined | Param | Type | | --- | --- | | panelID | string | ### view/WorkspaceManager.recomputeLayout(refreshHint) Called when an external widget has appeared and needs some of the space occupied by the mainview manager **Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager) | Param | Type | Description | | --- | --- | --- | | refreshHint | boolean | true to refresh the editor, false if not | ### view/WorkspaceManager.isPanelVisible(panelID) ⇒ boolean Responsible to check if the panel is visible or not. Returns true if visible else false. **Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager) | Param | | --- | | panelID | ### view/WorkspaceManager.setPluginPanelWidth(width) Programmatically sets the plugin panel content width to the given value in pixels. The total toolbar width is adjusted to account for the plugin icons bar. Width is clamped to respect panel minWidth and max size (75% of window). No-op if no panel is currently visible. **Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager) | Param | Type | Description | | --- | --- | --- | | width | number | Desired content width in pixels | ### view/WorkspaceManager.addEscapeKeyEventHandler(consumerName, eventHandler) ⇒ boolean If any widgets related to the editor needs to handle the escape key event, add it here. returning true from the registered handler will prevent primary escape key toggle panel behavior of phoenix. Note that returning true will no stop the event bubbling, that has to be controlled with the event parameter forwarded to the handler. **Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager) **Returns**: boolean - true if added | Param | Type | Description | | --- | --- | --- | | consumerName | string | a unique name for your consumer | | eventHandler | function | If the eventHandler returns true for this callback, the escape key event will not lead to panel toggle default behavior. | ### view/WorkspaceManager.removeEscapeKeyEventHandler(consumerName) ⇒ boolean Removing the escape key event consumer. **Kind**: inner method of [view/WorkspaceManager](#module_view/WorkspaceManager) **Returns**: boolean - true if removed | Param | Type | Description | | --- | --- | --- | | consumerName | string | used to register the consumer. |