The application layout defines the general layout of your application.
As there is no one-size-fits-all solution, the application layout is pluggable so you can provide your own implementation tailored to your needs. This allows you to get the most out of Drombler FX and JavaFX.
1. Pluggable Application Layout
The MainSceneRootProvider service interface provides the root parent node of the main scene. This root parent node can define the basic application layout. To make such an application layout more reusable it’s recommended to get the main application content from an ApplicationContentProvider. See Standard Desktop Classic Layout for a sample.
If you’re replacing the Standard Desktop Classic Layout with a custom layout, which also supports the Action Framework, consider to add the Exit action:
<dependency> <groupId>org.drombler.fx</groupId> <artifactId>drombler-fx-core-standard-action</artifactId> <scope>runtime</scope> </dependency>
This action requires a registered menu with id "File" to be shown in the File menu. This is usually provided at application level e.g. using the following runtime dependency:
The ApplicationContentProvider service interface provides the application content node. An ApplicationContentProvider can be used by several MainSceneRootProvider service implementations. See Docking Framework for a sample.
|If you’re replacing the Docking Framework with a custom ApplicationContentProvider, also consider to provide a service implementation for the following service interface: OnExitRequestHandlerProvider e.g. to make sure the users of your application don’t loose accidentally any unsaved data.|
The distinction between MainSceneRootProvider and ApplicationContentProvider makes both of them more reusable, e.g.:
if you like the Standard Desktop Classic Layout but the Docking Framework doesn’t fit your needs: still use the Standard Desktop Classic Layout but provide a custom implementation of the ApplicationContentProvider service interface. It will be picked up by the Standard Desktop Classic Layout automatically. (Omit the Docking Framework dependencies!)
if you like the Docking Framework but you would prefer a different application layout: still use the ApplicationContentProvider service implementation provided by the Docking Framework but provide a custom implementation of the MainSceneRootProvider service interface which also supports the ApplicationContentProvider service interface.
if neither the Standard Desktop Classic Layout nor the Docking Framework does fit your needs: at least provide a custom implementation of the MainSceneRootProvider service interface. To make the application layout more reusable provide the main application content with a custom ApplicationContentProvider service implementation from a different OSGi bundle but this is optional and not required.
2. Standard Desktop Classic Layout
The Standard Desktop Classic Layout provides a layout which is often used in classic desktop applications.
 A FXMenuBarMenuContainer, which provides integration with the Action Framework.
See the Actions, Menus and Toolbars trail for more information on how to register menus.
 A ToolBarContainerPane which can contain multiple tool bars.
See the Actions, Menus and Toolbars trail for more information on how to register tool bars.
 An empty container listening for content provided by an ApplicationContentProvider.
See the Docking Framework for a sample ApplicationContentProvider.
 A FXStatusBarElementContainer, which provides integration with the Status Bar Framework.
See the Status Bar trail for more information.
To activate the Standard Desktop Classic Layout you need the following optional runtime dependency:
<dependency> <groupId>org.drombler.fx</groupId> <artifactId>drombler-fx-core-standard-desktop-classic</artifactId> <scope>runtime</scope> </dependency>