Techsenger TabShell is a framework for building tab-based applications using the MVVM pattern for JavaFX. It consists of four subprojects:
- TabShell Material contains UI elements such as menus, columns, buttons, etc.
- TabShell Component contains classes for the MVVM component.
- TabShell Core contains the Shell itself.
- TabShell Kit contains useful components like text viewers, dialogs, etc.
The component is the main building block for creating an application using this framework. Each component consists of
two or three MVVM classes: View
, ViewModel
, and Model
. Thus, the component serves as the unit of implementation
for the MVVM design pattern (read more about MVVM here.
There are the following types of components:
- Node component, which is used for the simplest and smallest elements.
- Pane component, which represents a rectangular area.
- Tab component.
- Dialog component.
There are two types of tabs: Tab
and ShellTab
. A Tab
component can be added to other components. A ShellTab
component can only be opened through the Shell
. Therefore, ShellTab
components are always second-level components
after the Shell
.
All dialogs in TabShell have a scope that affects what will be blocked when the dialog is open. There are two types of scope: shell and tab. If a dialog has a shell scope, the user will not be able to do anything in TabShell while this dialog is displayed until it is closed. If a dialog has a tab scope, only the tab that triggered the dialog will be blocked when it is displayed. All other tabs, the main menu, etc., will be available to the user.
Dialogs are invoked from the ViewModel using ComponentService.
TabShell is responsible for only three things:
- Tab management.
- Menu management.
- Dialog management.
TabShell core doesn't have any business logic. It is only a shell for tabs that contain logic.
TabShell works differently with the top menu (menu in MenuBar) and nested menus.
When a tab is activated, the shell requests the tab for supported optional menus (in the top menu) and hides menus that are not supported.
When the menu is shown or when accelerator keys are used, the shell does the following (see the MenuAware interface): 1. The shell requests the tab to check if it supports this optional menu/item 2. The shell requests the tab to verify if this menu/item is currently valid (i.e., not disabled). 3. The shell requests the tab to check if this menu/item should be updated
It is important to note that steps 1 and 2 are called in two situations: when the user clicks the menu and when the user uses accelerator keys.