This guideline helps contributors understand how to integrate modular UI components (like Transaction, Token, Network, Identity, etc.) into the main application dashboard.
We resolved a critical naming conflict and enhanced the modular integration pattern:
- 🔁 Renamed
TransactionManager(UI layer) toUITransactionManagerto avoid conflict with core logic. - 🔧 Updated all imports and constructor references.
- 🔌 Integrated
UITransactionManagerintoDashboardController. - 🛠️ Connected UI components with blockchain (e.g.,
Miner,BlockProcessor). - 📊 Simplified
PeerNetworklogic for metrics view. - ✅ Confirmed dashboard metrics update after UI actions.
ui/
├── dashboard/
│ └── DashboardController.java
├── transaction/
│ ├── TransactionController.java
│ ├── UITransactionManager.java
│ ├── TransactionUIUtils.java
│ └── TransactionView.java
├── token/
│ ├── TokenController.java
│ ├── TokenManager.java
│ ├── TokenUIUtils.java
│ └── TokenView.java
└── network/
├── NetworkController.java
├── NetworkManager.java
├── NetworkUIUtils.java
└── NetworkView.java
For any new feature module (e.g., Token, Network):
- Create a folder under
ui/ - Add the following Java classes:
<Feature>Controller.java
<Feature>Manager.java
<Feature>UIUtils.java
<Feature>View.java
📌 Example: ui/network/NetworkManager.java
public class NetworkManager {
// Handles blockchain communication, mining, and network logic
}import org.example.app.core.ui.network.NetworkController;
import org.example.app.core.ui.network.NetworkManager;
import org.example.app.core.ui.network.NetworkView;private NetworkController networkController;
private NetworkManager networkManager;
private NetworkView networkView;Inside DashboardController.java, add:
private void showNetworkView() {
if (networkController == null) {
networkController = new NetworkController();
// Setup pools, wallets, etc.
}
if (networkManager == null) {
networkManager = new NetworkManager();
// Connect blockchain components
}
if (networkView == null) {
networkView = new NetworkView(networkController, networkManager);
networkView.setDashboardUpdateCallback(() -> updateDashboardMetrics());
}
VBox networkUI = networkView.createNetworkManagementView();
storeOriginalDashboardContent();
replaceContentView(networkUI);
}In DashboardController:
private void initializeNetworkUIComponents() {
networkController = new NetworkController();
networkManager = new NetworkManager();
networkView = new NetworkView(networkController, networkManager);
}Then call this in your initialize() method:
initializeNetworkUIComponents();To rename classes safely:
- Right-click
TransactionManagerin the UI layer. - Select Refactor → Rename.
- Rename to
UITransactionManager. - IDE will:
- Update all references
- Update imports, constructors, JavaDoc
- Fix conflicts automatically
🎯 Use Shift + F6 (IntelliJ) or Alt + Shift + R (Eclipse)
- Run the app
- Click the new feature tab/button
- Validate UI loads correctly
- Perform an action and observe dashboard updates
- Check console logs for blockchain interaction
| Task | Status |
|---|---|
| Created modular folder structure | ✅ |
| Renamed conflicting UI class | ✅ |
| Updated all references and imports | ✅ |
| Connected blockchain components | ✅ |
| Integrated with dashboard | ✅ |
| Peer count logic simplified | ✅ |
| View renders and updates dashboard | ✅ |
When building a new UI module:
- Follow the structure and naming conventions
- Use existing modules (e.g.,
transaction/,token/) as reference