Construct a new application shell.
The dock panel in the bottom shell area. In contrast to the main panel, the bottom panel can be collapsed and expanded.
The current state of the bottom panel.
Handler for the left side panel. The primary application views go here, such as the file explorer and the git view.
The dock panel in the main shell area. This is where editors usually go to.
General options for the application shell.
Handler for the right side panel. The secondary application views go here, such as the outline view.
The fixed-size panel shown on top. This one usually holds the main menu.
The active widget in the application shell. The active widget is the one that has focus (either the widget itself or any of its contents).
Note: Focus is taken by a widget through the onActivateRequest
method. It is up to the
widget implementation which DOM element will get the focus. The default implementation
does not take any focus; in that case the widget is never returned by this property.
The tab bars contained in all shell areas.
The tab bars contained in the bottom shell area. If there is no widget in the bottom area, the returned array is empty.
The shell area name of the currently active tab, or undefined.
Return the tab bar that has the currently active widget, or undefined.
The current widget in the application shell. The current widget is the last widget that
was active and not yet closed. See the remarks to activeWidget
on what active means.
The tab bars contained in the main shell area. If there is no widget in the main area, the returned array is empty.
A promise that is resolved when all currently pending updates are done.
Returns a snapshot of all tracked widgets to allow async modifications.
Activate a widget in the application shell. This makes the widget visible and usually also assigns focus to it.
Note: Focus is taken by a widget through the onActivateRequest
method. It is up to the
widget implementation which DOM element will get the focus. The default implementation
does not take any focus.
the activated widget if it was found
Add a widget to the application shell. The given widget must have a unique id
property,
which will be used as the DOM id.
Widgets are removed from the shell by calling their close
or dispose
methods.
Widgets added to the top area are not tracked regarding the current and active states.
Test whether the current widget is dirty.
Test whether there is a dirty widget.
Focus is taken by a widget through the onActivateRequest
method. It is up to the
widget implementation which DOM element will get the focus. The default implementation
of Widget does not take any focus. This method can help finding such problems by logging
a warning in case a widget was explicitly activated, but did not trigger a change of the
activeWidget
property.
the widgets to be closed
an array of all the widgets that were actually closed.
Close all tabs or a selection of tabs in a specific part of the application shell.
Either the name of a shell area or a `TabBar` that is contained in such an area.
If undefined, all tabs are closed; otherwise only those tabs that match the filter are closed.
the widget that was closed, if any, undefined
otherwise.
If your use case requires closing multiple widgets, use {@link ApplicationShell#closeMany} instead. That method handles closing saveable widgets more reliably.
Collapse the bottom panel. All contained widgets are hidden, but not closed.
They can be restored by calling expandBottomPanel
.
Collapse the named side panel area. This makes sure that the panel is hidden, increasing the space that is available for other shell areas.
Create the dock panel in the bottom shell area.
Create a box layout to assemble the application shell layout.
Assemble the application shell layout. Override this method in order to change the arrangement of the main area and the side panels.
Create the dock panel in the main shell area.
Create a split layout to assemble the application shell layout.
Create the top panel, which is used to hold the main menu.
This method is called after a side panel has been expanded while dragging a widget. It fires
a mousemove
event so that the drag overlay markers are updated correctly in all dock panels.
Activate top-level area widget.
Reveal top-level area widget.
Expand the bottom panel. See expandPanel
regarding the exact behavior.
Expand the named side panel area. This makes sure that the panel is visible, even if there
are no widgets in it. If the panel is already visible, nothing happens. If the panel is currently
collapsed (see collapsePanel
) and it contains widgets, the widgets are revealed that were
visible before it was collapsed.
Finds the tab-bar widget.
the selected tab-bar, else returns the currentTabBar.
the widget whose title has been targeted by a DOM event on a tabbar, or undefined if none can be found.
Finds the title widget from the tab-bar.
used for providing an array of titles.
the selected title widget, else returns the currentTitle or undefined.
Find the widget that contains the given HTML element. The returned widget may be one that is managed by the application shell, or one that is embedded in another widget and not directly managed by the shell, or a tab bar.
Determine the name of the shell area where the given widget resides. The result is undefined if the widget does not reside directly in the shell.
Compute the current height of the bottom panel. This implementation assumes that the container
of the bottom panel is a SplitPanel
.
Returns the last active widget in the given shell area.
Determine the default size to apply when the bottom panel is expanded for the first time.
Create an object that describes the current shell layout. This object may contain references to widgets; these need to be transformed before the layout can be serialized.
Return the tab bar in the given shell area, or the tab bar that has the given widget, or undefined.
Collects all widget titles for the given tab bar or area and optionally filters them.
The tab bar or area to retrieve the widget titles for
The filter to apply to the result
The filtered array of widget titles or an empty array
The widgets contained in the given shell area.
Check whether the named side panel area is expanded (returns true
) or collapsed (returns false
).
Return the tab bar next to the given tab bar; return the given tab bar if there is no adjacent one.
Handle a change to the active widget.
Handle a change to the current widget.
Return the tab bar previous to the given tab bar; return the given tab bar if there is no adjacent one.
Refresh the toggle button for the bottom panel. This implementation creates a status bar entry
and refers to the command core.toggle.bottom.panel
.
Track all widgets that are referenced by the given layout data.
Adjusts the size of the given area in the application shell.
the desired size of the panel in pixels.
the area to resize.
Reveal a widget in the application shell. This makes the widget visible, but does not activate it.
the revealed widget if it was found
Save the current widget if it is dirty.
Save all dirty widgets.
Modify the height of the bottom panel. This implementation assumes that the container of the
bottom panel is a SplitPanel
.
Apply a shell layout that has been previously created with getLayoutData
.
Set the z-index of the given element and its ancestors to the value z
.
an array of Widgets, all of which are tracked by the focus tracker The first member of the array is the widget whose id is passed in, and the other widgets are its tracked parents in ascending order
Track the given widget so it is considered in the current
and active
state of the shell.
The application shell manages the top-level widgets of the application. Use this class to add, remove, or activate a widget.