Skip to content

Techsenger TabShell - A framework for building tab-based applications using the MVVM pattern for JavaFX

License

Notifications You must be signed in to change notification settings

techsenger/tabshell

Repository files navigation

Techsenger TabShell

Overview

Techsenger TabShell is a framework for building tab-based applications using the MVVM pattern for JavaFX. It consists of four subprojects:

  1. TabShell Material contains UI elements such as menus, columns, buttons, etc.
  2. TabShell Component contains classes for the MVVM component.
  3. TabShell Core contains the Shell itself.
  4. TabShell Kit contains useful components like text viewers, dialogs, etc.

Component

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.

Tab

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.

Dialogs

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.

Core

TabShell is responsible for only three things:

  1. Tab management.
  2. Menu management.
  3. Dialog management.

TabShell core doesn't have any business logic. It is only a shell for tabs that contain logic.

Menu

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.

About

Techsenger TabShell - A framework for building tab-based applications using the MVVM pattern for JavaFX

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published