Plugin Architecture
Every feature module in Storeharmony Desktop follows the Plugin + Chassis pattern — a reusable, entity-agnostic Swing panel (HAGenericApplicationViewComponent) that handles all common UI concerns, while domain-specific logic is injected via a plugin object.
The Flow
- Menu Trigger – An action class (e.g.
ManageCustomerRecordsAction) extendsHeavyApplicationPanelLoaderAction - Chassis Creation – Instantiates
HAGenericApplicationViewComponent<T>(the empty chassis) - Plugin Injection – Creates a
HarmonyApplicationPlugin<T>implementation and callschassis.configurePlugin(plugin) - Rendering – The chassis renders a full workspace: search bar, data table, action grid, paging controls, context menus, and side panel — all wired to the plugin
Result: A fully-featured data management view with zero UI boilerplate in the plugin. The plugin only provides data, actions, and configuration.
Window Types
The chassis can be rendered in four modes via HarmonyWindowType:
| Type | Behavior |
|---|---|
EMBED | Added as a new tab in the main window |
INNER | Faded into the current view area |
DIALOG | Shown in a modal dialog |
FRAME | Opens a new standalone JFrame |
Key Interfaces
- HarmonyApplicationPlugin – The core plugin contract. Provides table model, data query, action grid items, side panel, and context menu items.
- HAGenericApplicationViewComponent – The reusable chassis. Handles search, paging, selection, gestures, and UI chrome.
- HeavyApplicationPanelLoaderAction – Abstract action that bridges menu clicks to panel instantiation.
- DataViewingComponent – Contract for read-only display panels.
- DataCapturingComponent – Contract for forms that capture input and return a result.
Building a New Plugin
To add a new feature module:
- Create the JPA entity in
entities/and add topersistence.xml - Create the data access operations in
operations/{module}/ - Create a
HarmonyApplicationPluginimplementation that provides table model, query, and actions - Create a menu action extending
HeavyApplicationPanelLoaderActionthat wires the plugin to the chassis - Register the action in the menu configuration XML