WorkspaceManager
Import :
const WorkspaceManager = brackets.getModule("view/WorkspaceManager")
PANEL_TYPE_BOTTOM_PANEL : string
Constant representing the type of bottom panel
Kind: global variable
PANEL_TYPE_PLUGIN_PANEL : string
Constant representing the type of plugin panel
Kind: global variable
AppInit
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)
Kind: global constant
EVENT_WORKSPACE_UPDATE_LAYOUT
Event triggered when the workspace layout updates.
Kind: global constant
EVENT_WORKSPACE_PANEL_SHOWN
Event triggered when a panel is shown.
Kind: global constant
EVENT_WORKSPACE_PANEL_HIDDEN
Event triggered when a panel is hidden.
Kind: global constant
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: global function
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. |
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: global function
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. |
getAllPanelIDs() ⇒ Array
Returns an array of all panel ID's
Kind: global function
Returns: Array
- List of ID's of all bottom panels
getPanelForID(panelID) ⇒ Object
Gets the Panel interface for the given ID. Can return undefined if no panel with the ID is found.
Kind: global function
Returns: Object
- Panel object for the ID or undefined
Param | Type |
---|---|
panelID | string |
recomputeLayout(refreshHint)
Called when an external widget has appeared and needs some of the space occupied by the mainview manager
Kind: global function
Param | Type | Description |
---|---|---|
refreshHint | boolean | true to refresh the editor, false if not |
isPanelVisible(panelID) ⇒ boolean
Responsible to check if the panel is visible or not. Returns true if visible else false.
Kind: global function
Param |
---|
panelID |
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: global function
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. |
removeEscapeKeyEventHandler(consumerName) ⇒ boolean
Removing the escape key event consumer.
Kind: global function
Returns: boolean
- true if removed
Param | Type | Description |
---|---|---|
consumerName | string | used to register the consumer. |