View Javadoc
1   /*
2    * MoneyWise: Finance Application
3    * Copyright 2012-2026. Tony Washer
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6    * use this file except in compliance with the License.  You may obtain a copy
7    * of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
14   * License for the specific language governing permissions and limitations under
15   * the License.
16   */
17  package io.github.tonywasher.joceanus.moneywise.ui.panel;
18  
19  import io.github.tonywasher.joceanus.oceanus.base.OceanusException;
20  import io.github.tonywasher.joceanus.oceanus.event.OceanusEvent;
21  import io.github.tonywasher.joceanus.oceanus.event.OceanusEventManager;
22  import io.github.tonywasher.joceanus.oceanus.event.OceanusEventRegistrar;
23  import io.github.tonywasher.joceanus.oceanus.event.OceanusEventRegistrar.OceanusEventProvider;
24  import io.github.tonywasher.joceanus.oceanus.profile.OceanusProfile;
25  import io.github.tonywasher.joceanus.metis.ui.MetisErrorPanel;
26  import io.github.tonywasher.joceanus.metis.viewer.MetisViewerEntry;
27  import io.github.tonywasher.joceanus.metis.viewer.MetisViewerManager;
28  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseBasicDataType;
29  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseCashCategory;
30  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseDepositCategory;
31  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseLoanCategory;
32  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseRegion;
33  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseTransCategory;
34  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseTransTag;
35  import io.github.tonywasher.joceanus.moneywise.ui.MoneyWiseGoToId;
36  import io.github.tonywasher.joceanus.moneywise.ui.MoneyWiseUIResource;
37  import io.github.tonywasher.joceanus.moneywise.views.MoneyWiseView;
38  import io.github.tonywasher.joceanus.prometheus.ui.PrometheusActionButtons;
39  import io.github.tonywasher.joceanus.prometheus.ui.PrometheusGoToEvent;
40  import io.github.tonywasher.joceanus.prometheus.views.PrometheusDataEvent;
41  import io.github.tonywasher.joceanus.prometheus.views.PrometheusEditSet;
42  import io.github.tonywasher.joceanus.prometheus.views.PrometheusUIEvent;
43  import io.github.tonywasher.joceanus.prometheus.views.PrometheusViewerEntryId;
44  import io.github.tonywasher.joceanus.tethys.api.base.TethysUIComponent;
45  import io.github.tonywasher.joceanus.tethys.api.base.TethysUIEvent;
46  import io.github.tonywasher.joceanus.tethys.api.button.TethysUIScrollButtonManager;
47  import io.github.tonywasher.joceanus.tethys.api.control.TethysUILabel;
48  import io.github.tonywasher.joceanus.tethys.api.factory.TethysUIFactory;
49  import io.github.tonywasher.joceanus.tethys.api.menu.TethysUIScrollMenu;
50  import io.github.tonywasher.joceanus.tethys.api.pane.TethysUIBorderPaneManager;
51  import io.github.tonywasher.joceanus.tethys.api.pane.TethysUIBoxPaneManager;
52  import io.github.tonywasher.joceanus.tethys.api.pane.TethysUICardPaneManager;
53  import io.github.tonywasher.joceanus.tethys.api.pane.TethysUIPaneFactory;
54  
55  /**
56   * Category panel.
57   */
58  public class MoneyWiseCategoryPanel
59          implements OceanusEventProvider<PrometheusDataEvent>, TethysUIComponent {
60      /**
61       * Text for DataEntry Title.
62       */
63      private static final String NLS_DATAENTRY = MoneyWiseUIResource.CATEGORY_DATAENTRY.getValue();
64  
65      /**
66       * Text for Selection Title.
67       */
68      private static final String NLS_SELECT = MoneyWiseUIResource.CATEGORY_TITLE_SELECT.getValue();
69  
70      /**
71       * Text for Selection Prompt.
72       */
73      private static final String NLS_DATA = MoneyWiseUIResource.CATEGORY_PROMPT_SELECT.getValue();
74  
75      /**
76       * The Event Manager.
77       */
78      private final OceanusEventManager<PrometheusDataEvent> theEventManager;
79  
80      /**
81       * The Data View.
82       */
83      private final MoneyWiseView theView;
84  
85      /**
86       * The Panel.
87       */
88      private final TethysUIBorderPaneManager thePanel;
89  
90      /**
91       * The select button.
92       */
93      private final TethysUIScrollButtonManager<PanelName> theSelectButton;
94  
95      /**
96       * The card panel.
97       */
98      private final TethysUICardPaneManager<TethysUIComponent> theCardPanel;
99  
100     /**
101      * The select panel.
102      */
103     private final TethysUIBorderPaneManager theSelectPanel;
104 
105     /**
106      * The filter card panel.
107      */
108     private final TethysUICardPaneManager<TethysUIComponent> theFilterCardPanel;
109 
110     /**
111      * Deposit Categories Table.
112      */
113     private final MoneyWiseDepositCategoryTable theDepositTable;
114 
115     /**
116      * Cash Categories Table.
117      */
118     private final MoneyWiseCashCategoryTable theCashTable;
119 
120     /**
121      * Loan Categories Table.
122      */
123     private final MoneyWiseLoanCategoryTable theLoanTable;
124 
125     /**
126      * Transaction Categories Table.
127      */
128     private final MoneyWiseTransCategoryTable theEventTable;
129 
130     /**
131      * Event Tags Table.
132      */
133     private final MoneyWiseTransTagTable theTagTable;
134 
135     /**
136      * Regions Table.
137      */
138     private final MoneyWiseRegionTable theRegionTable;
139 
140     /**
141      * The UpdateSet.
142      */
143     private final PrometheusEditSet theEditSet;
144 
145     /**
146      * The viewer entry.
147      */
148     private final MetisViewerEntry theViewerEntry;
149 
150     /**
151      * The action buttons panel.
152      */
153     private final PrometheusActionButtons theActionButtons;
154 
155     /**
156      * The error panel.
157      */
158     private final MetisErrorPanel theError;
159 
160     /**
161      * Are we refreshing?
162      */
163     private boolean isRefreshing;
164 
165     /**
166      * The active panel.
167      */
168     private PanelName theActive;
169 
170     /**
171      * Constructor.
172      *
173      * @param pView the data view
174      */
175     MoneyWiseCategoryPanel(final MoneyWiseView pView) {
176         /* Store details */
177         theView = pView;
178 
179         /* Access GUI Factory */
180         final TethysUIFactory<?> myFactory = pView.getGuiFactory();
181         final MetisViewerManager myViewer = pView.getViewerManager();
182 
183         /* Create the event manager */
184         theEventManager = new OceanusEventManager<>();
185 
186         /* Build the Update set */
187         theEditSet = new PrometheusEditSet(pView);
188 
189         /* Create the Panel */
190         final TethysUIPaneFactory myPanes = myFactory.paneFactory();
191         thePanel = myPanes.newBorderPane();
192 
193         /* Create the top level viewer entry for this view */
194         final MetisViewerEntry mySection = pView.getViewerEntry(PrometheusViewerEntryId.MAINTENANCE);
195         theViewerEntry = myViewer.newEntry(mySection, NLS_DATAENTRY);
196         theViewerEntry.setTreeObject(theEditSet);
197 
198         /* Create the error panel */
199         theError = pView.getToolkit().getToolkit().newErrorPanel(theViewerEntry);
200 
201         /* Create the action buttons panel */
202         theActionButtons = new PrometheusActionButtons(myFactory, theEditSet);
203 
204         /* Create the table panels */
205         theDepositTable = new MoneyWiseDepositCategoryTable(pView, theEditSet, theError);
206         theCashTable = new MoneyWiseCashCategoryTable(pView, theEditSet, theError);
207         theLoanTable = new MoneyWiseLoanCategoryTable(pView, theEditSet, theError);
208         theEventTable = new MoneyWiseTransCategoryTable(pView, theEditSet, theError);
209         theTagTable = new MoneyWiseTransTagTable(pView, theEditSet, theError);
210         theRegionTable = new MoneyWiseRegionTable(pView, theEditSet, theError);
211 
212         /* Create selection button and label */
213         final TethysUILabel myLabel = myFactory.controlFactory().newLabel(NLS_DATA);
214         theSelectButton = myFactory.buttonFactory().newScrollButton(PanelName.class);
215         buildSelectMenu();
216 
217         /* Create the card panel */
218         theCardPanel = myPanes.newCardPane();
219 
220         /* Add to the card panels */
221         theCardPanel.addCard(PanelName.DEPOSITS.toString(), theDepositTable);
222         theCardPanel.addCard(PanelName.CASH.toString(), theCashTable);
223         theCardPanel.addCard(PanelName.LOANS.toString(), theLoanTable);
224         theCardPanel.addCard(PanelName.EVENTS.toString(), theEventTable);
225         theCardPanel.addCard(PanelName.EVENTTAGS.toString(), theTagTable);
226         theCardPanel.addCard(PanelName.REGIONS.toString(), theRegionTable);
227         theActive = PanelName.DEPOSITS;
228         theSelectButton.setValue(theActive);
229 
230         /* Create the card panel */
231         theFilterCardPanel = myPanes.newCardPane();
232 
233         /* Add to the card panels */
234         theFilterCardPanel.addCard(PanelName.DEPOSITS.toString(), theDepositTable.getFilterPanel());
235         theFilterCardPanel.addCard(PanelName.CASH.toString(), theCashTable.getFilterPanel());
236         theFilterCardPanel.addCard(PanelName.LOANS.toString(), theLoanTable.getFilterPanel());
237         theFilterCardPanel.addCard(PanelName.EVENTS.toString(), theEventTable.getFilterPanel());
238         theFilterCardPanel.addCard(PanelName.EVENTTAGS.toString(), theTagTable.getFilterPanel());
239         theFilterCardPanel.addCard(PanelName.REGIONS.toString(), theRegionTable.getFilterPanel());
240 
241         /* Create the select prompt */
242         final TethysUIBoxPaneManager mySelect = myPanes.newHBoxPane();
243         mySelect.addNode(myLabel);
244         mySelect.addNode(theSelectButton);
245 
246         /* Create the selection panel */
247         theSelectPanel = myPanes.newBorderPane();
248         theSelectPanel.setBorderTitle(NLS_SELECT);
249         theSelectPanel.setWest(mySelect);
250         theSelectPanel.setCentre(theFilterCardPanel);
251 
252         /* Create the header panel */
253         final TethysUIBorderPaneManager myHeader = myPanes.newBorderPane();
254         myHeader.setCentre(theSelectPanel);
255         myHeader.setNorth(theError);
256         myHeader.setEast(theActionButtons);
257 
258         /* Now define the panel */
259         thePanel.setNorth(myHeader);
260         thePanel.setCentre(theCardPanel);
261 
262         /* Hide the action buttons initially */
263         theActionButtons.setVisible(false);
264 
265         /* Create the listeners */
266         theSelectButton.getEventRegistrar().addEventListener(TethysUIEvent.NEWVALUE, e -> handleSelection());
267         theError.getEventRegistrar().addEventListener(e -> handleErrorPane());
268         theActionButtons.getEventRegistrar().addEventListener(this::handleActionButtons);
269         setChildListeners(theDepositTable.getEventRegistrar());
270         setChildListeners(theCashTable.getEventRegistrar());
271         setChildListeners(theLoanTable.getEventRegistrar());
272         setChildListeners(theEventTable.getEventRegistrar());
273         setChildListeners(theTagTable.getEventRegistrar());
274         setChildListeners(theRegionTable.getEventRegistrar());
275     }
276 
277     @Override
278     public TethysUIComponent getUnderlying() {
279         return thePanel;
280     }
281 
282     @Override
283     public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
284         return theEventManager.getEventRegistrar();
285     }
286 
287     /**
288      * setChildListeners.
289      *
290      * @param pRegistrar the registrar
291      */
292     private void setChildListeners(final OceanusEventRegistrar<PrometheusDataEvent> pRegistrar) {
293         pRegistrar.addEventListener(PrometheusDataEvent.ADJUSTVISIBILITY, e -> {
294             if (!isRefreshing) {
295                 setVisibility();
296             }
297         });
298         pRegistrar.addEventListener(PrometheusDataEvent.GOTOWINDOW, this::handleGoToEvent);
299     }
300 
301     @Override
302     public void setEnabled(final boolean pEnabled) {
303         theSelectButton.setEnabled(pEnabled);
304         theCardPanel.setEnabled(pEnabled);
305         theFilterCardPanel.setEnabled(pEnabled);
306     }
307 
308     @Override
309     public void setVisible(final boolean pVisible) {
310         thePanel.setVisible(pVisible);
311     }
312 
313     /**
314      * Build select menu.
315      */
316     private void buildSelectMenu() {
317         /* Create builder */
318         final TethysUIScrollMenu<PanelName> myMenu = theSelectButton.getMenu();
319 
320         /* Loop through the panels */
321         for (PanelName myPanel : PanelName.values()) {
322             /* Create a new MenuItem for the panel */
323             myMenu.addItem(myPanel);
324         }
325     }
326 
327     /**
328      * Refresh data.
329      *
330      * @throws OceanusException on error
331      */
332     public void refreshData() throws OceanusException {
333         /* Obtain the active profile */
334         OceanusProfile myTask = theView.getActiveTask();
335         myTask = myTask.startTask("Categories");
336 
337         /* Note that we are refreshing */
338         isRefreshing = true;
339         theEditSet.setDataSet(theView.getData());
340 
341         /* Refresh the tables */
342         theDepositTable.refreshData();
343         theCashTable.refreshData();
344         theLoanTable.refreshData();
345         theEventTable.refreshData();
346         theTagTable.refreshData();
347         theRegionTable.refreshData();
348 
349         /* Clear refreshing flag */
350         isRefreshing = false;
351         setVisibility();
352 
353         /* Touch the updateSet */
354         theViewerEntry.setTreeObject(theEditSet);
355 
356         /* Complete the task */
357         myTask.end();
358     }
359 
360     /**
361      * Determine Focus.
362      */
363     public void determineFocus() {
364         /* Switch on active component */
365         switch (theActive) {
366             case DEPOSITS:
367                 theDepositTable.determineFocus(theViewerEntry);
368                 break;
369             case CASH:
370                 theCashTable.determineFocus(theViewerEntry);
371                 break;
372             case LOANS:
373                 theLoanTable.determineFocus(theViewerEntry);
374                 break;
375             case EVENTS:
376                 theEventTable.determineFocus(theViewerEntry);
377                 break;
378             case EVENTTAGS:
379                 theTagTable.determineFocus(theViewerEntry);
380                 break;
381             case REGIONS:
382                 theRegionTable.determineFocus(theViewerEntry);
383                 break;
384             default:
385                 break;
386         }
387     }
388 
389     /**
390      * Does this panel have updates?
391      *
392      * @return true/false
393      */
394     public boolean hasUpdates() {
395         /* Determine whether we have updates */
396         boolean hasUpdates = theDepositTable.hasUpdates();
397         if (!hasUpdates) {
398             hasUpdates = theCashTable.hasUpdates();
399         }
400         if (!hasUpdates) {
401             hasUpdates = theLoanTable.hasUpdates();
402         }
403         if (!hasUpdates) {
404             hasUpdates = theEventTable.hasUpdates();
405         }
406         if (!hasUpdates) {
407             hasUpdates = theTagTable.hasUpdates();
408         }
409         if (!hasUpdates) {
410             hasUpdates = theRegionTable.hasUpdates();
411         }
412 
413         /* Return to caller */
414         return hasUpdates;
415     }
416 
417     /**
418      * Has this set of panels got the session focus?
419      *
420      * @return true/false
421      */
422     public boolean hasSession() {
423         /* Determine whether we have session focus */
424         boolean hasSession = theDepositTable.hasSession();
425         if (!hasSession) {
426             hasSession = theCashTable.hasSession();
427         }
428         if (!hasSession) {
429             hasSession = theLoanTable.hasSession();
430         }
431         if (!hasSession) {
432             hasSession = theEventTable.hasSession();
433         }
434         if (!hasSession) {
435             hasSession = theTagTable.hasSession();
436         }
437         if (!hasSession) {
438             hasSession = theRegionTable.hasSession();
439         }
440 
441         /* Return to caller */
442         return hasSession;
443     }
444 
445     /**
446      * Does this panel have errors?
447      *
448      * @return true/false
449      */
450     public boolean hasErrors() {
451         /* Determine whether we have errors */
452         boolean hasErrors = theDepositTable.hasErrors();
453         if (!hasErrors) {
454             hasErrors = theCashTable.hasErrors();
455         }
456         if (!hasErrors) {
457             hasErrors = theLoanTable.hasErrors();
458         }
459         if (!hasErrors) {
460             hasErrors = theEventTable.hasErrors();
461         }
462         if (!hasErrors) {
463             hasErrors = theTagTable.hasErrors();
464         }
465         if (!hasErrors) {
466             hasErrors = theRegionTable.hasErrors();
467         }
468 
469         /* Return to caller */
470         return hasErrors;
471     }
472 
473     /**
474      * Does this panel have item editing occurring?
475      *
476      * @return true/false
477      */
478     public boolean isItemEditing() {
479         /* Determine whether we have item editing */
480         boolean isEditing = theDepositTable.isItemEditing();
481         if (!isEditing) {
482             isEditing = theCashTable.isItemEditing();
483         }
484         if (!isEditing) {
485             isEditing = theLoanTable.isItemEditing();
486         }
487         if (!isEditing) {
488             isEditing = theEventTable.isItemEditing();
489         }
490         if (!isEditing) {
491             isEditing = theTagTable.isItemEditing();
492         }
493         if (!isEditing) {
494             isEditing = theRegionTable.isItemEditing();
495         }
496 
497         /* Return to caller */
498         return isEditing;
499     }
500 
501     /**
502      * Select category.
503      *
504      * @param pCategory the category to select
505      */
506     public void selectCategory(final Object pCategory) {
507         /* Determine which panel to show */
508         if (pCategory instanceof MoneyWiseDepositCategory myCategory) {
509             theDepositTable.selectCategory(myCategory);
510             showPanel(PanelName.DEPOSITS);
511         } else if (pCategory instanceof MoneyWiseCashCategory myCategory) {
512             theCashTable.selectCategory(myCategory);
513             showPanel(PanelName.CASH);
514         } else if (pCategory instanceof MoneyWiseLoanCategory myCategory) {
515             theLoanTable.selectCategory(myCategory);
516             showPanel(PanelName.LOANS);
517         } else if (pCategory instanceof MoneyWiseTransCategory myCategory) {
518             theEventTable.selectCategory(myCategory);
519             showPanel(PanelName.EVENTS);
520         }
521     }
522 
523     /**
524      * Select tag.
525      *
526      * @param pTag the category to select
527      */
528     public void selectTag(final Object pTag) {
529         /* Determine which panel to show */
530         if (pTag instanceof MoneyWiseTransTag myTag) {
531             theTagTable.selectTag(myTag);
532             showPanel(PanelName.EVENTTAGS);
533         }
534     }
535 
536     /**
537      * Select region.
538      *
539      * @param pRegion the region to select
540      */
541     public void selectRegion(final Object pRegion) {
542         /* Determine which panel to show */
543         if (pRegion instanceof MoneyWiseRegion myRegion) {
544             theRegionTable.selectRegion(myRegion);
545             showPanel(PanelName.REGIONS);
546         }
547     }
548 
549     /**
550      * Show panel.
551      *
552      * @param pName the panel name
553      */
554     private void showPanel(final PanelName pName) {
555         /* Obtain name of panel */
556         final String myName = pName.toString();
557 
558         /* Move correct card to front */
559         theCardPanel.selectCard(myName);
560         theFilterCardPanel.selectCard(myName);
561 
562         /* Note the active panel */
563         theActive = pName;
564         theSelectButton.setFixedText(myName);
565 
566         /* Determine the focus */
567         determineFocus();
568     }
569 
570     /**
571      * Set Visibility.
572      */
573     protected void setVisibility() {
574         /* Determine whether we have updates */
575         final boolean hasUpdates = hasUpdates();
576         final boolean isItemEditing = isItemEditing();
577 
578         /* Update the action buttons */
579         theActionButtons.setEnabled(true);
580         theActionButtons.setVisible(hasUpdates && !isItemEditing);
581 
582         /* Update the selection */
583         theSelectButton.setEnabled(!isItemEditing);
584         theFilterCardPanel.setEnabled(!isItemEditing);
585 
586         /* Alert listeners that there has been a change */
587         theEventManager.fireEvent(PrometheusDataEvent.ADJUSTVISIBILITY);
588     }
589 
590     /**
591      * Cancel Editing of underlying tables.
592      */
593     private void cancelEditing() {
594         /* Cancel editing on subPanels */
595         theDepositTable.cancelEditing();
596         theCashTable.cancelEditing();
597         theLoanTable.cancelEditing();
598         theEventTable.cancelEditing();
599         theTagTable.cancelEditing();
600         theRegionTable.cancelEditing();
601     }
602 
603     /**
604      * handleErrorPane.
605      */
606     private void handleErrorPane() {
607         /* Determine whether we have an error */
608         final boolean isError = theError.hasError();
609 
610         /* Hide selection panel on error */
611         theSelectPanel.setVisible(!isError);
612 
613         /* Lock card panel */
614         theCardPanel.setEnabled(!isError);
615 
616         /* Lock Action Buttons */
617         theActionButtons.setEnabled(!isError);
618     }
619 
620     /**
621      * handleSelection.
622      */
623     private void handleSelection() {
624         /* Cancel any editing */
625         cancelEditing();
626 
627         /* Show selected panel */
628         showPanel(theSelectButton.getValue());
629     }
630 
631     /**
632      * handle Action Buttons.
633      *
634      * @param pEvent the event
635      */
636     private void handleActionButtons(final OceanusEvent<PrometheusUIEvent> pEvent) {
637         /* Cancel editing */
638         cancelEditing();
639 
640         /* Perform the command */
641         theEditSet.processCommand(pEvent.getEventId(), theError);
642     }
643 
644     /**
645      * handle GoTo Event.
646      *
647      * @param pEvent the event
648      */
649     private void handleGoToEvent(final OceanusEvent<PrometheusDataEvent> pEvent) {
650         /* Access details */
651         @SuppressWarnings("unchecked") final PrometheusGoToEvent<MoneyWiseGoToId> myEvent = pEvent.getDetails(PrometheusGoToEvent.class);
652 
653         /* Access event and obtain details */
654         switch (myEvent.getId()) {
655             /* Pass through the event */
656             case STATEMENT:
657             case ACCOUNT:
658             case STATIC:
659                 theEventManager.cascadeEvent(pEvent);
660                 break;
661 
662             /* Access subPanels */
663             case CATEGORY:
664                 selectCategory(myEvent.getDetails());
665                 break;
666             case TAG:
667                 selectTag(pEvent.getDetails());
668                 break;
669             case REGION:
670                 selectRegion(pEvent.getDetails());
671                 break;
672             default:
673                 break;
674         }
675     }
676 
677     /**
678      * Panel names.
679      */
680     private enum PanelName {
681         /**
682          * Deposits.
683          */
684         DEPOSITS(MoneyWiseBasicDataType.DEPOSITCATEGORY),
685 
686         /**
687          * Cash.
688          */
689         CASH(MoneyWiseBasicDataType.CASHCATEGORY),
690 
691         /**
692          * Loans.
693          */
694         LOANS(MoneyWiseBasicDataType.LOANCATEGORY),
695 
696         /**
697          * Events.
698          */
699         EVENTS(MoneyWiseBasicDataType.TRANSCATEGORY),
700 
701         /**
702          * Tags.
703          */
704         EVENTTAGS(MoneyWiseBasicDataType.TRANSTAG),
705 
706         /**
707          * Regions.
708          */
709         REGIONS(MoneyWiseBasicDataType.REGION);
710 
711         /**
712          * The String name.
713          */
714         private final String theName;
715 
716         /**
717          * Constructor.
718          *
719          * @param pDataType the dataType
720          */
721         PanelName(final MoneyWiseBasicDataType pDataType) {
722             theName = pDataType.getListName();
723         }
724 
725         @Override
726         public String toString() {
727             /* return the name */
728             return theName;
729         }
730     }
731 }