|
17 | 17 | package com.techsenger.mvvm4fx.core; |
18 | 18 |
|
19 | 19 | /** |
20 | | - * This interface is used by the ParentViewModel to add or remove child components (such as tabs, panes, dialogs, etc.). |
21 | | - * It provides a bridge for managing these components. The component bridge is created in the View and has a reference |
22 | | - * to the View, but it does not provide a direct reference to the ViewModel. |
| 20 | + * Defines a mediator interface used by the {@code ParentViewModel} to perform view-related operations, |
| 21 | + * such as adding or removing child components (tabs, panes, dialogs, etc.). |
23 | 22 | * |
24 | | - * <p>For example, to show a dialog, the bridge implementation can include a method like the following:</p> |
| 23 | + * <p>The {@code ComponentMediator} acts as an intermediary between the {@code ComponentViewModel} and its corresponding |
| 24 | + * {@code ComponentView}. It is created within the View layer and maintains a reference to the View, allowing the |
| 25 | + * ViewModel to request UI actions without holding a direct reference to the View itself. |
| 26 | + * |
| 27 | + * <p>For example, to display a dialog, the mediator implementation might define a method such as: |
25 | 28 | * |
26 | 29 | * <pre> |
27 | 30 | * void openDialog(DialogViewModel dialogViewModel) { |
28 | | - * //alternatively, this logic can be handled within the View itself |
| 31 | + * // Alternatively, this logic can be encapsulated inside the View itself. |
29 | 32 | * DialogView dialogView = new DialogView(dialogViewModel); |
30 | 33 | * dialogView.initialize(); |
31 | 34 | * getView().openDialog(dialogView); |
|
0 commit comments