CPD Results

The following document contains the results of PMD's CPD 7.12.0.

Duplications

File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransInfoSet.java 216
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateTransInfoSet.java 64
: isClassRequired(myClass);
    }

    @Override
    public MetisFieldRequired isClassRequired(final PrometheusDataInfoClass pClass) {
        /* Access details about the Transaction */
        final MoneyWiseTransaction myTransaction = getOwner();
        final MoneyWiseTransCategory myCategory = myTransaction.getCategory();

        /* If we have no Category, no class is allowed */
        if (myCategory == null) {
            return MetisFieldRequired.NOTALLOWED;
        }
        final MoneyWiseTransCategoryClass myClass = myCategory.getCategoryTypeClass();
        if (myClass == null) {
            return MetisFieldRequired.NOTALLOWED;
        }

        /* Switch on class */
        switch ((MoneyWiseTransInfoClass) pClass) {
            /* Reference and comments are always available */
            case REFERENCE:
            case COMMENTS:
            case TRANSTAG:
                return MetisFieldRequired.CANEXIST;

            /* NatInsurance and benefit can only occur on salary/pensionContribution */
            case EMPLOYERNATINS:
            case EMPLOYEENATINS:
                return myClass.isNatInsurance()
                        ? MetisFieldRequired.CANEXIST
                        : MetisFieldRequired.NOTALLOWED;

            /* Benefit can only occur on salary */
            case DEEMEDBENEFIT:
                return myClass == MoneyWiseTransCategoryClass.TAXEDINCOME
                        ? MetisFieldRequired.CANEXIST
                        : MetisFieldRequired.NOTALLOWED;

            /* Handle Withheld separately */
            case WITHHELD:
                return isWithheldAmountRequired(myClass);

            /* Handle Tax Credit */
            case TAXCREDIT:
                return isTaxCreditClassRequired(myClass);

            /* Handle AccountUnits */
            case ACCOUNTDELTAUNITS:
                return isAccountUnitsDeltaRequired(myClass);

            /* Handle PartnerUnits */
            case PARTNERDELTAUNITS:
                return isPartnerUnitsDeltaRequired(myClass);

            /* Handle Dilution separately */
            case DILUTION:
                return isDilutionClassRequired(myClass);

            /* Qualify Years is needed only for Taxable Gain */
            case QUALIFYYEARS:
                return isQualifyingYearsClassRequired(myClass);

            /* Handle ThirdParty separately */
            case RETURNEDCASHACCOUNT:
                return isReturnedCashAccountRequired(myClass);
            case RETURNEDCASH:
                return isReturnedCashRequired(myTransaction);

            case PARTNERAMOUNT:
                return isPartnerAmountClassRequired(myClass);

            case XCHANGERATE:
                return isXchangeRateClassRequired(myClass);

            case PRICE:
                return isPriceClassRequired(myClass);

            case COMMISSION:
                return isCommissionClassRequired(myClass);

            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }

    /**
     * Determine if an infoSet class is metaData.
     * @param pClass the infoSet class
     * @return the status
     */
    public boolean isMetaData(final MoneyWiseTransInfoClass pClass) {
        /* Switch on class */
        switch (pClass) {
            /* Can always change reference/comments/tags */
            case REFERENCE:
            case COMMENTS:
            case TRANSTAG:
                return true;

            /* All others are locked */
            default:
                return false;
        }
    }

    /**
     * Determine if a TaxCredit infoSet class is required.
     * @param pClass the category class
     * @return the status
     */
    private MetisFieldRequired isTaxCreditClassRequired(final MoneyWiseTransCategoryClass pClass) {
        final MoneyWiseTransaction myTrans = getOwner();
        final MoneyWiseTaxCredit myYear = myTrans.getTaxYear();
        final MoneyWiseTransAsset myAccount = myTrans.getAccount();

        /* Switch on class */
        switch (pClass) {
            case TAXEDINCOME:
                return MetisFieldRequired.MUSTEXIST;
            case LOANINTERESTCHARGED:
                return MetisFieldRequired.CANEXIST;
            case LOYALTYBONUS:
            case INTEREST:
                return myAccount.isTaxFree()
                        || myAccount.isGross()
                        || !myYear.isTaxCreditRequired()
                        ? MetisFieldRequired.NOTALLOWED
                        : MetisFieldRequired.MUSTEXIST;
            case DIVIDEND:
                return !myAccount.isTaxFree()
                        && (myYear.isTaxCreditRequired() || myAccount.isForeign())
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;
            case TRANSFER:
                return myAccount instanceof MoneyWiseSecurityHolding
                        && ((MoneyWiseSecurityHolding) myAccount).getSecurity().isSecurityClass(MoneyWiseSecurityClass.LIFEBOND)
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }

    /**
     * Determine if a Withheld amount is required.
     * @param pClass the category class
     * @return the status
     */
    private static MetisFieldRequired isWithheldAmountRequired(final MoneyWiseTransCategoryClass pClass) {
        /* Withheld is only available for salary and interest */
        switch (pClass) {
            case TAXEDINCOME:
            case INTEREST:
                return MetisFieldRequired.CANEXIST;
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }

    /**
     * Determine if an AccountDeltaUnits infoSet class is required.
     * @param pClass the category class
     * @return the status
     */
    private MetisFieldRequired isAccountUnitsDeltaRequired(final MoneyWiseTransCategoryClass pClass) {
        final MoneyWiseTransaction myTrans = getOwner();
        final MoneyWiseTransAsset myAccount = myTrans.getAccount();
        final MoneyWiseTransAsset myPartner = myTrans.getPartner();
        final MoneyWiseAssetDirection myDir = myTrans.getDirection();

        /* Account must be security holding */
        if (!(myAccount instanceof MoneyWiseSecurityHolding)) {
            return MetisFieldRequired.NOTALLOWED;
        }

        /* Account cannot be autoUnits */
        final MoneyWiseSecurityHolding myHolding = (MoneyWiseSecurityHolding) myAccount;
        if (myHolding.getSecurity().getCategoryClass().isAutoUnits()) {
            return MetisFieldRequired.NOTALLOWED;
        }

        /* Handle different transaction types */
        switch (pClass) {
            case TRANSFER:
            case STOCKDEMERGER:
                return MetisFieldRequired.CANEXIST;
            case UNITSADJUST:
            case STOCKSPLIT:
            case INHERITED:
                return MetisFieldRequired.MUSTEXIST;
            case DIVIDEND:
                return myAccount.equals(myPartner)
                        ? MetisFieldRequired.CANEXIST
                        : MetisFieldRequired.NOTALLOWED;
            case STOCKRIGHTSISSUE:
                return myDir.isFrom()
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }

    /**
     * Determine if an PartnerDeltaUnits infoSet class is required.
     * @param pClass the category class
     * @return the status
     */
    private MetisFieldRequired isPartnerUnitsDeltaRequired(final MoneyWiseTransCategoryClass pClass) {
        final MoneyWiseTransaction myTrans = getOwner();
        final MoneyWiseTransAsset myPartner = myTrans.getPartner();
        final MoneyWiseAssetDirection myDir = myTrans.getDirection();

        /* Partner must be security holding */
        if (!(myPartner instanceof MoneyWiseSecurityHolding)) {
            return MetisFieldRequired.NOTALLOWED;
        }

        /* Partner cannot be autoUnits */
        final MoneyWiseSecurityHolding myHolding = (MoneyWiseSecurityHolding) myPartner;
        if (myHolding.getSecurity().getCategoryClass().isAutoUnits()) {
            return MetisFieldRequired.NOTALLOWED;
        }

        /* Handle different transaction types */
        switch (pClass) {
            case TRANSFER:
                return MetisFieldRequired.CANEXIST;
            case STOCKDEMERGER:
            case SECURITYREPLACE:
            case STOCKTAKEOVER:
                return MetisFieldRequired.MUSTEXIST;
            case STOCKRIGHTSISSUE:
                return myDir.isTo()
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }

    /**
     * Determine if a Dilution infoSet class is required.
     * @param pClass the category class
     * @return the status
     */
    private static MetisFieldRequired isDilutionClassRequired(final MoneyWiseTransCategoryClass pClass) {
        /* Dilution is only required for stock split/deMerger */
        switch (pClass) {
            case STOCKSPLIT:
            case UNITSADJUST:
                return MetisFieldRequired.CANEXIST;
            case STOCKDEMERGER:
                return MetisFieldRequired.MUSTEXIST;
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }

    /**
     * Determine if a ReturnedCash Account class is required.
     * @param pClass the category class
     * @return the status
     */
    private static MetisFieldRequired isReturnedCashAccountRequired(final MoneyWiseTransCategoryClass pClass) {
        /* Returned Cash is possible only for StockTakeOver */
        return pClass == MoneyWiseTransCategoryClass.STOCKTAKEOVER
                ? MetisFieldRequired.CANEXIST
                : MetisFieldRequired.NOTALLOWED;
    }

    /**
     * Determine if a ReturnedCash value is required.
     * @param pTransaction the transaction
     * @return the status
     */
    private static MetisFieldRequired isReturnedCashRequired(final MoneyWiseTransaction pTransaction) {
        /* Returned Cash Amount is possible only if ReturnedCashAccount exists */
        return pTransaction.getReturnedCashAccount() != null
                ? MetisFieldRequired.MUSTEXIST
                : MetisFieldRequired.NOTALLOWED;
    }

    /**
     * Determine if a PartnerAmount infoSet class is required.
     * @param pCategory the category
     * @return the status
     */
    private MetisFieldRequired isPartnerAmountClassRequired(final MoneyWiseTransCategoryClass pCategory) {
        final MoneyWiseTransaction myTrans = getOwner();
        final MoneyWiseTransAsset myAccount = myTrans.getAccount();
        final MoneyWiseTransAsset myPartner = myTrans.getPartner();

        /* If the transaction requires null amount, then partner amount must also be null */
        if (pCategory.needsNullAmount()) {
            return MetisFieldRequired.NOTALLOWED;
        }

        /* If Partner currency is null or the same as Account then Partner amount is not allowed */
        final MoneyWiseCurrency myCurrency = myAccount.getAssetCurrency();
        final MoneyWiseCurrency myPartnerCurrency = myPartner == null ? null : myPartner.getAssetCurrency();
        if (myCurrency == null || myPartnerCurrency == null) {
            return MetisFieldRequired.NOTALLOWED;
        }
        return MetisDataDifference.isEqual(myCurrency, myPartnerCurrency)
                ? MetisFieldRequired.NOTALLOWED
                : MetisFieldRequired.MUSTEXIST;
    }

    /**
     * Determine if an QualifyingYears infoSet class is required.
     * @param pCategory the category
     * @return the status
     */
    private MetisFieldRequired isQualifyingYearsClassRequired(final MoneyWiseTransCategoryClass pCategory) {
        final MoneyWiseTransaction myTrans = getOwner();
        final MoneyWiseTransAsset myAccount = myTrans.getAccount();

        return pCategory == MoneyWiseTransCategoryClass.TRANSFER
                && myAccount instanceof MoneyWiseSecurityHolding
                && ((MoneyWiseSecurityHolding) myAccount).getSecurity().isSecurityClass(MoneyWiseSecurityClass.LIFEBOND)
                ? MetisFieldRequired.MUSTEXIST
                : MetisFieldRequired.NOTALLOWED;
    }

    /**
     * Determine if an XchangeRate infoSet class is required.
     * @param pCategory the category
     * @return the status
     */
    private MetisFieldRequired isXchangeRateClassRequired(final MoneyWiseTransCategoryClass pCategory) {
        final MoneyWiseTransaction myTrans = getOwner();
        final MoneyWiseDataSet myData = myTrans.getDataSet();
        final MoneyWiseTransAsset myAccount = myTrans.getAccount();

        return pCategory.isDividend()
                && !myAccount.getAssetCurrency().equals(myData.getReportingCurrency())
                ? MetisFieldRequired.MUSTEXIST
                : MetisFieldRequired.NOTALLOWED;
    }

    /**
     * Determine if a price infoSet class is required.
     * @param pCategory the category
     * @return the status
     */
    private static MetisFieldRequired isPriceClassRequired(final MoneyWiseTransCategoryClass pCategory) {
        /* Only allowed for stockSplit and UnitsAdjust */
         switch (pCategory) {
             case STOCKSPLIT:
             case UNITSADJUST:
                 return MetisFieldRequired.CANEXIST;
             default:
                 return MetisFieldRequired.NOTALLOWED;
         }
    }

    /**
     * Determine if a Commission infoSet class is required.
     * @param pCategory the category
     * @return the status
     */
    private static MetisFieldRequired isCommissionClassRequired(final MoneyWiseTransCategoryClass pCategory) {
        /* Don't allow yet */
        return MetisFieldRequired.NOTALLOWED;
        /* Account or Partner must be security holding
         if (!(pAccount instanceof SecurityHolding)
         && !(pPartner instanceof SecurityHolding)) {
         return MetisFieldRequired.NOTALLOWED;
         }
         switch (pCategory) {
         case TRANSFER:
         return MetisFieldRequired.CANEXIST;
         case DIVIDEND:
         return MetisDataDifference.isEqual(pAccount, pPartner)
         ? MetisFieldRequired.CANEXIST
         : MetisFieldRequired.NOTALLOWED;
         default:
         return MetisFieldRequired.NOTALLOWED;
         } */
    }
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 694
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 722
buildAssetMenu(pMenu, getDataList(MoneyWiseBasicDataType.PAYEE, MoneyWisePayeeList.class), false, myTrans);
    }

    /**
     * Build the asset menu for an item.
     * @param <T> the Asset type
     * @param pMenu the menu
     * @param pIsAccount is this item the account rather than partner
     * @param pList the asset list
     * @param pTrans the transaction to build for
     */
    private static <T extends MoneyWiseAssetBase> void buildAssetMenu(final TethysUIScrollMenu<MoneyWiseTransAsset> pMenu,
                                                                      final MoneyWiseAssetBaseList<T> pList,
                                                                      final boolean pIsAccount,
                                                                      final MoneyWiseTransaction pTrans) {
        /* Record active item */
        final MoneyWiseTransAsset myAccount = pTrans.getAccount();
        final MoneyWiseTransCategory myCategory = pTrans.getCategory();
        final MoneyWiseDataValidatorTrans myValidator = pTrans.getList().getValidator();
        final MoneyWiseTransAsset myCurr = pIsAccount
                ? myAccount
                : pTrans.getPartner();
        TethysUIScrollItem<MoneyWiseTransAsset> myActive = null;
        TethysUIScrollSubMenu<MoneyWiseTransAsset> myMenu = null;

        /* Loop through the available values */
        final Iterator<T> myIterator = pList.iterator();
        while (myIterator.hasNext()) {
            final T myAsset = myIterator.next();

            /* Only process non-deleted/non-closed items */
            boolean bIgnore = myAsset.isDeleted() || myAsset.isClosed();

            /* Check whether the asset is allowable for the owner */
            bIgnore |= !(pIsAccount
                    ? myValidator.isValidAccount(myAsset)
                    : myValidator.isValidPartner(myAccount, myCategory, myAsset));
            if (bIgnore) {
                continue;
            }

            /* If this the first item */
            if (myMenu == null) {
                /* Create a new subMenu and add it to the popUp */
                myMenu = pMenu.addSubMenu(pList.getItemType().getItemName());
            }

            /* Create a new MenuItem and add it to the popUp */
            final TethysUIScrollItem<MoneyWiseTransAsset> myItem = myMenu.getSubMenu().addItem(myAsset);

            /* If this is the active category */
            if (myAsset.equals(myCurr)) {
                /* Record it */
                myActive = myItem;
            }
        }

        /* Ensure active item is visible */
        if (myActive != null) {
            myActive.scrollToItem();
        }
    }

    /**
     * Build the holding asset menu for an item.
     * @param pMenu the menu
     * @param pIsAccount is this item the account rather than partner
     * @param pTrans the transaction to build for
     */
    private static void buildHoldingMenu(final TethysUIScrollMenu<MoneyWiseTransAsset> pMenu,
                                         final boolean pIsAccount,
                                         final MoneyWiseTransaction pTrans) {
        /* Record active item */
        final MoneyWiseTransAsset myAccount = pTrans.getAccount();
        final MoneyWiseTransCategory myCategory = pTrans.getCategory();
        final MoneyWiseDataValidatorTrans myValidator = pTrans.getList().getValidator();
        final MoneyWiseTransAsset myCurr = pIsAccount
                ? myAccount
                : pTrans.getPartner();
        TethysUIScrollItem<MoneyWiseTransAsset> myActive = null;
        TethysUIScrollSubMenu<MoneyWiseTransAsset> myMenu = null;

        /* Access Portfolios and Holdings Map */
        final MoneyWiseDataSet myData = pTrans.getDataSet();
        final MoneyWisePortfolioList myPortfolios = myData.getPortfolios();
        final MoneyWiseSecurityHoldingMap myMap = myPortfolios.getSecurityHoldingsMap();

        /* Loop through the Portfolios */
        final Iterator<MoneyWisePortfolio> myPortIterator = myPortfolios.iterator();
        while (myPortIterator.hasNext()) {
            final MoneyWisePortfolio myPortfolio = myPortIterator.next();
            TethysUIScrollSubMenu<MoneyWiseTransAsset> myCoreMenu = null;

            /* Ignore deleted or closed */
            if (myPortfolio.isDeleted()
                    || Boolean.TRUE.equals(myPortfolio.isClosed())) {
                continue;
            }

            /* Look for existing and new holdings */
            final Iterator<MoneyWiseSecurityHolding> myExistIterator = myMap.existingIterator(myPortfolio);
            final Iterator<MoneyWiseSecurityHolding> myNewIterator = myMap.newIterator(myPortfolio);
            if ((myExistIterator != null) || (myNewIterator != null)) {
                /* If there are existing elements */
                if (myExistIterator != null) {
                    /* Loop through them */
                    while (myExistIterator.hasNext()) {
                        final MoneyWiseSecurityHolding myHolding = myExistIterator.next();
                        final MoneyWiseSecurity mySecurity = myHolding.getSecurity();

                        /* Check whether the asset is allowable for the owner */
                        final boolean bIgnore = !(pIsAccount
                                ? myValidator.isValidAccount(myHolding)
                                : myValidator.isValidPartner(myAccount, myCategory, myHolding));
                        if (bIgnore) {
                            continue;
                        }

                        /* Ensure that hierarchy is created */
                        if (myMenu == null) {
                            /* Create a new JMenu and add it to the popUp */
                            myMenu = pMenu.addSubMenu(MoneyWiseAssetType.SECURITYHOLDING.toString());
                        }
                        if (myCoreMenu == null) {
                            /* Create a new Menu and add it to the popUp */
                            myCoreMenu = myMenu.getSubMenu().addSubMenu(myPortfolio.getName());
                        }

                        /* Add the item to the menu */
                        final TethysUIScrollItem<MoneyWiseTransAsset> myItem = myCoreMenu.getSubMenu().addItem(myHolding, mySecurity.getName());

                        /* If this is the active holding */
                        if (mySecurity.equals(myCurr)) {
                            /* Record it */
                            myActive = myItem;
                        }
                    }
                }

                /* If there are new elements */
                if (myNewIterator != null) {
                    /* Loop through them */
                    TethysUIScrollSubMenu<MoneyWiseTransAsset> mySubMenu = null;
                    while (myNewIterator.hasNext()) {
                        final MoneyWiseSecurityHolding myHolding = myNewIterator.next();
                        final MoneyWiseSecurity mySecurity = myHolding.getSecurity();

                        /* Check whether the asset is allowable for the owner */
                        final boolean bIgnore = !(pIsAccount
                                ? myValidator.isValidAccount(myHolding)
                                : myValidator.isValidPartner(myAccount, myCategory, myHolding));
                        if (bIgnore) {
                            continue;
                        }

                        /* Ensure that hierarchy is created */
                        if (myMenu == null) {
                            /* Create a new subMenu and add it to the popUp */
                            myMenu = pMenu.addSubMenu(MoneyWiseAssetType.SECURITYHOLDING.toString());
                        }
                        if (myCoreMenu == null) {
                            /* Create a new subMenu and add it to the popUp */
                            myCoreMenu = myMenu.getSubMenu().addSubMenu(myPortfolio.getName());
                        }
                        if (mySubMenu == null) {
                            /* Create a new subMenu */
                            mySubMenu = myCoreMenu.getSubMenu().addSubMenu(MoneyWiseSecurityHolding.SECURITYHOLDING_NEW);
                        }

                        /* Add the item to the menu */
                        mySubMenu.getSubMenu().addItem(myHolding, mySecurity.getName());
                    }
                }
            }
        }

        /* Ensure active item is visible */
        if (myActive != null) {
            myActive.scrollToItem();
        }
    }

    /**
     * Build the category menu for an item.
     * @param pMenu the menu
     * @param pEvent the event to build for
     */
    public void buildCategoryMenu(final TethysUIScrollMenu<MoneyWiseTransCategory> pMenu,
                                  final MoneyWiseXAnalysisEvent pEvent) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 501
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 531
final MoneyWiseTransaction myTrans = getItem().getTransaction();
        final MoneyWiseValidateTransaction myBuilder = (MoneyWiseValidateTransaction) myTrans.getList().getValidator();

        /* Process updates */
        if (MoneyWiseBasicResource.MONEYWISEDATA_FIELD_DATE.equals(myField)) {
            /* Update the Date */
            myTrans.setDate(pUpdate.getValue(OceanusDate.class));
        } else if (MoneyWiseBasicResource.TRANSACTION_AMOUNT.equals(myField)) {
            /* Update the Amount */
            myTrans.setAmount(pUpdate.getValue(OceanusMoney.class));
            myBuilder.autoCorrect(myTrans);
        } else if (MoneyWiseBasicResource.TRANSACTION_ACCOUNT.equals(myField)) {
            /* Update the Account */
            myTrans.setAccount(resolveAsset(pUpdate.getValue(MoneyWiseTransAsset.class)));
            myBuilder.autoCorrect(myTrans);
        } else if (MoneyWiseBasicResource.TRANSACTION_DIRECTION.equals(myField)) {
            /* Update the Direction */
            myTrans.switchDirection();
            myBuilder.autoCorrect(myTrans);
        } else if (MoneyWiseBasicResource.TRANSACTION_PARTNER.equals(myField)) {
            /* Update the Partner */
            myTrans.setPartner(resolveAsset(pUpdate.getValue(MoneyWiseTransAsset.class)));
            myBuilder.autoCorrect(myTrans);
        } else if (MoneyWiseBasicDataType.TRANSCATEGORY.equals(myField)) {
            /* Update the Category */
            myTrans.setCategory(pUpdate.getValue(MoneyWiseTransCategory.class));
            myBuilder.autoCorrect(myTrans);
        } else if (MoneyWiseBasicResource.TRANSACTION_RECONCILED.equals(myField)) {
            /* Update the Reconciled indication */
            myTrans.setReconciled(pUpdate.getValue(Boolean.class));
        } else if (MoneyWiseTransInfoClass.COMMENTS.equals(myField)) {
            /* Update the Comments */
            myTrans.setComments(pUpdate.getValue(String.class));
        } else if (MoneyWiseTransInfoClass.REFERENCE.equals(myField)) {
            /* Update the Reference */
            myTrans.setReference(pUpdate.getValue(String.class));
        } else if (MoneyWiseTransInfoClass.TRANSTAG.equals(myField)) {
            /* Update the Tag indication */
            myTrans.setTransactionTags(pUpdate.getValue(List.class));
        } else if (MoneyWiseTransInfoClass.PARTNERAMOUNT.equals(myField)) {
            /* Update the PartnerAmount */
            myTrans.setPartnerAmount(pUpdate.getValue(OceanusMoney.class));
        } else if (MoneyWiseTransInfoClass.XCHANGERATE.equals(myField)) {
            /* Update the ExchangeRate */
            myTrans.setExchangeRate(pUpdate.getValue(OceanusRatio.class));
        } else if (MoneyWiseTransInfoClass.ACCOUNTDELTAUNITS.equals(myField)) {
            /* Update the AccountDeltaUnits */
            myTrans.setAccountDeltaUnits(pUpdate.getValue(OceanusUnits.class));
        } else if (MoneyWiseTransInfoClass.PARTNERDELTAUNITS.equals(myField)) {
            /* Update the PartnerDeltaUnits */
            myTrans.setPartnerDeltaUnits(pUpdate.getValue(OceanusUnits.class));
        } else if (MoneyWiseTransInfoClass.PRICE.equals(myField)) {
            /* Update the Price */
            myTrans.setPrice(pUpdate.getValue(OceanusPrice.class));
        } else if (MoneyWiseTransInfoClass.COMMISSION.equals(myField)) {
            /* Update the Commission */
            myTrans.setCommission(pUpdate.getValue(OceanusMoney.class));
        } else if (MoneyWiseTransInfoClass.DILUTION.equals(myField)) {
            /* Update the Dilution */
            myTrans.setDilution(pUpdate.getValue(OceanusRatio.class));
        } else if (MoneyWiseTransInfoClass.QUALIFYYEARS.equals(myField)) {
            /* Update the QualifyYears */
            myTrans.setYears(pUpdate.getValue(Integer.class));
        } else if (MoneyWiseTransInfoClass.RETURNEDCASHACCOUNT.equals(myField)) {
            /* Update the ReturnedCashAccount */
            myTrans.setReturnedCashAccount(pUpdate.getValue(MoneyWiseTransAsset.class));
            myBuilder.autoCorrect(myTrans);
        } else if (MoneyWiseTransInfoClass.RETURNEDCASH.equals(myField)) {
            /* Update the ReturnedCash */
            myTrans.setReturnedCash(pUpdate.getValue(OceanusMoney.class));
        } else if (MoneyWiseTransInfoClass.TAXCREDIT.equals(myField)) {
            /* Update the TaxCredit */
            myTrans.setTaxCredit(pUpdate.getValue(OceanusMoney.class));
        } else if (MoneyWiseTransInfoClass.EMPLOYEENATINS.equals(myField)) {
            /* Update the EmployeeNatIns */
            myTrans.setEmployeeNatIns(pUpdate.getValue(OceanusMoney.class));
        } else if (MoneyWiseTransInfoClass.EMPLOYERNATINS.equals(myField)) {
            /* Update the EmployerNayIns */
            myTrans.setEmployerNatIns(pUpdate.getValue(OceanusMoney.class));
        } else if (MoneyWiseTransInfoClass.DEEMEDBENEFIT.equals(myField)) {
            /* Update the Benefit */
            myTrans.setDeemedBenefit(pUpdate.getValue(OceanusMoney.class));
        } else if (MoneyWiseTransInfoClass.WITHHELD.equals(myField)) {
            /* Update the Withheld */
            myTrans.setWithheld(pUpdate.getValue(OceanusMoney.class));
        }
    }

    @Override
    protected void declareGoToItems(final boolean pUpdates) {
        /* Access the item */
        final MoneyWiseXAnalysisEvent myItem = getItem();
File Line
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseReader.java 43
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseWriter.java 40
super(pFactory, pReport, pPasswordMgr);
    }

    /**
     * Register sheets.
     */
    @Override
    protected void registerSheets() {
        /* Loop through the static types */
        for (MoneyWiseStaticDataType myType : MoneyWiseStaticDataType.values()) {
            /* Create the sheet */
            addSheet(newSheet(myType));
        }

        /* Loop through the basic types */
        for (MoneyWiseBasicDataType myType : MoneyWiseBasicDataType.values()) {
            /* Create the sheet */
            addSheet(newSheet(myType));
        }
    }

    /**
     * Create new sheet of required type.
     * @param pDataType the data type
     * @return the new sheet
     */
    private PrometheusSheetDataItem<?> newSheet(final MoneyWiseStaticDataType pDataType) {
        /* Switch on data Type */
        switch (pDataType) {
            case DEPOSITTYPE:
                return new MoneyWiseSheetDepositCategoryType(this);
            case CASHTYPE:
                return new MoneyWiseSheetCashCategoryType(this);
            case LOANTYPE:
                return new MoneyWiseSheetLoanCategoryType(this);
            case PORTFOLIOTYPE:
                return new MoneyWiseSheetPortfolioType(this);
            case PAYEETYPE:
                return new MoneyWiseSheetPayeeType(this);
            case SECURITYTYPE:
                return new MoneyWiseSheetSecurityType(this);
            case TRANSTYPE:
                return new MoneyWiseSheetTransCategoryType(this);
            case ACCOUNTINFOTYPE:
                return new MoneyWiseSheetAccountInfoType(this);
            case TRANSINFOTYPE:
                return new MoneyWiseSheetTransInfoType(this);
            case CURRENCY:
                return new MoneyWiseSheetCurrency(this);
            case TAXBASIS:
                return new MoneyWiseSheetTaxBasis(this);
            default:
                throw new IllegalArgumentException(pDataType.toString());
        }
    }

    /**
     * Create new sheet of required type.
     * @param pDataType the data type
     * @return the new sheet
     */
    private PrometheusSheetDataItem<?> newSheet(final MoneyWiseBasicDataType pDataType) {
        /* Switch on data Type */
        switch (pDataType) {
            case TRANSTAG:
                return new MoneyWiseSheetTransTag(this);
            case REGION:
                return new MoneyWiseSheetRegion(this);
            case DEPOSITCATEGORY:
                return new MoneyWiseSheetDepositCategory(this);
            case CASHCATEGORY:
                return new MoneyWiseSheetCashCategory(this);
            case LOANCATEGORY:
                return new MoneyWiseSheetLoanCategory(this);
            case TRANSCATEGORY:
                return new MoneyWiseSheetTransCategory(this);
            case EXCHANGERATE:
                return new MoneyWiseSheetExchangeRate(this);
            case PAYEE:
                return new MoneyWiseSheetPayee(this);
            case PAYEEINFO:
                return new MoneyWiseSheetPayeeInfo(this);
            case SECURITY:
                return new MoneyWiseSheetSecurity(this);
            case SECURITYPRICE:
                return new MoneyWiseSheetSecurityPrice(this);
            case SECURITYINFO:
                return new MoneyWiseSheetSecurityInfo(this);
            case DEPOSIT:
                return new MoneyWiseSheetDeposit(this);
            case DEPOSITRATE:
                return new MoneyWiseSheetDepositRate(this);
            case DEPOSITINFO:
                return new MoneyWiseSheetDepositInfo(this);
            case CASH:
                return new MoneyWiseSheetCash(this);
            case CASHINFO:
                return new MoneyWiseSheetCashInfo(this);
            case LOAN:
                return new MoneyWiseSheetLoan(this);
            case LOANINFO:
                return new MoneyWiseSheetLoanInfo(this);
            case PORTFOLIO:
                return new MoneyWiseSheetPortfolio(this);
            case PORTFOLIOINFO:
                return new MoneyWiseSheetPortfolioInfo(this);
            case TRANSACTION:
                return new MoneyWiseSheetTransaction(this);
            case TRANSACTIONINFO:
                return new MoneyWiseSheetTransInfo(this);
            default:
                throw new IllegalArgumentException(pDataType.toString());
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 875
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 880
final TethysUITableManager<MetisDataFieldId, MoneyWiseXAnalysisEvent> myTable = getTable();
        hideAllColumns();

        /* Switch on column set */
        switch (pSet) {
            case BALANCE:
                myTable.getColumn(MoneyWiseTransInfoClass.COMMENTS).setVisible(true);
                myTable.getColumn(MoneyWiseTransDataId.DEBIT).setVisible(true);
                myTable.getColumn(MoneyWiseTransDataId.CREDIT).setVisible(true);
                myTable.getColumn(MoneyWiseTransDataId.BALANCE).setVisible(true);
                break;
            case STANDARD:
                myTable.getColumn(MoneyWiseTransInfoClass.COMMENTS).setVisible(true);
                myTable.getColumn(MoneyWiseBasicResource.TRANSACTION_AMOUNT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.TRANSTAG).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.REFERENCE).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.PARTNERAMOUNT).setVisible(true);
                break;
            case SALARY:
                myTable.getColumn(MoneyWiseBasicResource.TRANSACTION_AMOUNT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.TAXCREDIT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.EMPLOYEENATINS).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.EMPLOYERNATINS).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.DEEMEDBENEFIT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.WITHHELD).setVisible(true);
                break;
            case INTEREST:
                myTable.getColumn(MoneyWiseBasicResource.TRANSACTION_AMOUNT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.TAXCREDIT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.WITHHELD).setVisible(true);
                break;
            case DIVIDEND:
                myTable.getColumn(MoneyWiseBasicResource.TRANSACTION_AMOUNT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.TAXCREDIT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.ACCOUNTDELTAUNITS).setVisible(true);
                break;
            case SECURITY:
                myTable.getColumn(MoneyWiseBasicResource.TRANSACTION_AMOUNT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.ACCOUNTDELTAUNITS).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.PARTNERDELTAUNITS).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.DILUTION).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.RETURNEDCASHACCOUNT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.RETURNEDCASH).setVisible(true);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseRegion.java 119
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransTag.java 119
public MoneyWiseRegion(final MoneyWiseRegionList pList) {
        super(pList, 0);
        setNextDataKeySet();
    }

    @Override
    public MetisFieldSetDef getDataFieldSet() {
        return FIELD_DEFS;
    }

    @Override
    public String formatObject(final OceanusDataFormatter pFormatter) {
        return toString();
    }

    @Override
    public String toString() {
        return getName();
    }

    @Override
    public boolean includeXmlField(final MetisDataFieldId pField) {
        /* Determine whether fields should be included */
        if (PrometheusDataResource.DATAITEM_FIELD_NAME.equals(pField)) {
            return true;
        }
        if (PrometheusDataResource.DATAITEM_FIELD_DESC.equals(pField)) {
            return getDesc() != null;
        }

        /* Pass call on */
        return super.includeXmlField(pField);
    }

    @Override
    public String getName() {
        return getValues().getValue(PrometheusDataResource.DATAITEM_FIELD_NAME, String.class);
    }

    /**
     * Obtain Encrypted name.
     * @return the bytes
     */
    public byte[] getNameBytes() {
        return getValues().getEncryptedBytes(PrometheusDataResource.DATAITEM_FIELD_NAME);
    }

    /**
     * Obtain Encrypted Name Field.
     * @return the Field
     */
    private PrometheusEncryptedPair getNameField() {
        return getValues().getEncryptedPair(PrometheusDataResource.DATAITEM_FIELD_NAME);
    }

    /**
     * Obtain Description.
     * @return the description
     */
    public String getDesc() {
        return getValues().getValue(PrometheusDataResource.DATAITEM_FIELD_DESC, String.class);
    }

    /**
     * Obtain Encrypted description.
     * @return the bytes
     */
    public byte[] getDescBytes() {
        return getValues().getEncryptedBytes(PrometheusDataResource.DATAITEM_FIELD_DESC);
    }

    /**
     * Obtain Encrypted Description Field.
     * @return the Field
     */
    private PrometheusEncryptedPair getDescField() {
        return getValues().getEncryptedPair(PrometheusDataResource.DATAITEM_FIELD_DESC);
    }

    /**
     * Set name value.
     * @param pValue the value
     * @throws OceanusException on error
     */
    private void setValueName(final String pValue) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_NAME, pValue);
    }

    /**
     * Set name value.
     * @param pBytes the value
     * @throws OceanusException on error
     */
    private void setValueName(final byte[] pBytes) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_NAME, pBytes, String.class);
    }

    /**
     * Set name value.
     * @param pValue the value
     */
    private void setValueName(final PrometheusEncryptedPair pValue) {
        getValues().setUncheckedValue(PrometheusDataResource.DATAITEM_FIELD_NAME, pValue);
    }

    /**
     * Set description value.
     * @param pValue the value
     * @throws OceanusException on error
     */
    private void setValueDesc(final String pValue) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_DESC, pValue);
    }

    /**
     * Set description value.
     * @param pBytes the value
     * @throws OceanusException on error
     */
    private void setValueDesc(final byte[] pBytes) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_DESC, pBytes, String.class);
    }

    /**
     * Set description value.
     * @param pValue the value
     */
    private void setValueDesc(final PrometheusEncryptedPair pValue) {
        getValues().setUncheckedValue(PrometheusDataResource.DATAITEM_FIELD_DESC, pValue);
    }

    @Override
    public MoneyWiseDataSet getDataSet() {
        return (MoneyWiseDataSet) super.getDataSet();
    }

    @Override
    public MoneyWiseRegion getBase() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 389
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 401
theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.PARTNERAMOUNT, bEditField);

        /* Determine whether the taxCredit field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.TAXCREDIT);
        bShowField = bEditField || myTrans.getTaxCredit() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.TAXCREDIT, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.TAXCREDIT, bEditField);

        /* Determine whether the EeNatIns field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.EMPLOYEENATINS);
        bShowField = bEditField || myTrans.getEmployeeNatIns() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.EMPLOYEENATINS, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.EMPLOYEENATINS, bEditField);

        /* Determine whether the ErnatIns field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.EMPLOYERNATINS);
        bShowField = bEditField || myTrans.getEmployerNatIns() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.EMPLOYERNATINS, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.EMPLOYERNATINS, bEditField);

        /* Determine whether the benefit field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.DEEMEDBENEFIT);
        bShowField = bEditField || myTrans.getDeemedBenefit() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.DEEMEDBENEFIT, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.DEEMEDBENEFIT, bEditField);

        /* Determine whether the donation field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.WITHHELD);
        bShowField = bEditField || myTrans.getWithheld() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.WITHHELD, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.WITHHELD, bEditField);

        /* Determine whether the account units field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.ACCOUNTDELTAUNITS);
        bShowField = bEditField || myTrans.getAccountDeltaUnits() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.ACCOUNTDELTAUNITS, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.ACCOUNTDELTAUNITS, bEditField);

        /* Determine whether the partnerDeltaUnits field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.PARTNERDELTAUNITS);
        bShowField = bEditField || myTrans.getPartnerDeltaUnits() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.PARTNERDELTAUNITS, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.PARTNERDELTAUNITS, bEditField);

        /* Determine whether the dilution field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.DILUTION);
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXReportTab.java 177
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseReportTab.java 170
theHTMLPane.setCSSContent(MoneyWiseXReportStyleSheet.CSS_REPORT);

        /* Create listeners */
        theView.getEventRegistrar().addEventListener(e -> refreshData());
        theManager.getEventRegistrar().addEventListener(this::handleGoToRequest);
        theError.getEventRegistrar().addEventListener(e -> handleErrorPane());
        final OceanusEventRegistrar<PrometheusDataEvent> myRegistrar = theSelect.getEventRegistrar();
        myRegistrar.addEventListener(PrometheusDataEvent.SELECTIONCHANGED, e -> handleReportRequest());
        myRegistrar.addEventListener(PrometheusDataEvent.PRINT, e -> theHTMLPane.printIt());
        myRegistrar.addEventListener(PrometheusDataEvent.SAVETOFILE, e -> theHTMLPane.saveToFile());
        theHTMLPane.getEventRegistrar().addEventListener(TethysUIEvent.BUILDPAGE, e -> {
            theManager.processReference(e.getDetails(String.class), theHTMLPane);
            e.consume();
        });
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public void setEnabled(final boolean pEnabled) {
        /* Pass on to important elements */
        theSelect.setEnabled(pEnabled);
        theError.setEnabled(pEnabled);
        theHTMLPane.setEnabled(pEnabled);
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Refresh views/controls after a load/update of underlying data.
     */
    private void refreshData() {
        /* Obtain the active profile */
        OceanusProfile myTask = theView.getActiveTask();
        myTask = myTask.startTask("Reports");

        /* Protect against exceptions */
        try {
            /* Hide the instant debug since it is now invalid */
            theSpotEntry.setVisible(false);

            /* Refresh the data */
            theSelect.setRange(theView.getRange());
            theSelect.setSecurities(theView.hasActiveSecurities());
            buildReport();

            /* Create SavePoint */
            theSelect.createSavePoint();
        } catch (OceanusException e) {
            /* Show the error */
            theView.addError(e);

            /* Restore SavePoint */
            theSelect.restoreSavePoint();
        }

        /* Complete the task */
        myTask.end();
    }

    /**
     * Build the report.
     * @throws OceanusException on error
     */
    private void buildReport() throws OceanusException {
        /* Access the values from the selection */
        final MoneyWiseXReportType myReportType = theSelect.getReportType();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXAnalysisSelect.java 435
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseAnalysisSelect.java 433
public MoneyWiseXAnalysisFilter<?, ?> getFilter() {
        return theState.getFilter();
    }

    /**
     * Obtain the ColumnSet.
     * @return the columnSet.
     */
    public MoneyWiseAnalysisColumnSet getColumns() {
        return theState.getColumns();
    }

    /**
     * Are we showing columns?
     * @return true/false.
     */
    public boolean showColumns() {
        return theState.showColumns();
    }

    /**
     * Create control panel.
     * @param pFactory the GUI factory
     * @param pNewButton the new button
     * @return the panel
     */
    private TethysUIBoxPaneManager buildControlPanel(final TethysUIFactory<?> pFactory,
                                                     final TethysUIButton pNewButton) {
        /* Create the control panel */
        final TethysUIBoxPaneManager myPanel = pFactory.paneFactory().newHBoxPane();

        /* Create the labels */
        final TethysUILabel myRangeLabel = pFactory.controlFactory().newLabel(NLS_RANGE);

        /* Create save button */
        final TethysUIButton mySave = pFactory.buttonFactory().newButton();
        MetisIcon.configureSaveIconButton(mySave);

        /* Create the panel */
        myPanel.setBorderTitle(NLS_TITLE);
        myPanel.addNode(myRangeLabel);
        myPanel.addNode(theRangeButton);
        myPanel.addSpacer();
        myPanel.addNode(theFilterDetail);
        myPanel.addSpacer();
        myPanel.addNode(mySave);
        myPanel.addNode(pNewButton);

        /* Pass through the save event */
        final OceanusEventRegistrar<TethysUIEvent> myRegistrar = mySave.getEventRegistrar();
        myRegistrar.addEventListener(e -> theEventManager.fireEvent(PrometheusDataEvent.SAVETOFILE));

        /* Return the panel */
        return myPanel;
    }

    /**
     * Create filter detail panel.
     * @param pFactory the GUI factory
     * @return the panel
     */
    private TethysUIBoxPaneManager buildFilterDetail(final TethysUIFactory<?> pFactory) {
        /* Create the control panel */
        final TethysUIBoxPaneManager myPanel = pFactory.paneFactory().newHBoxPane();

        /* Create the labels */
        final TethysUILabel myFilterLabel = pFactory.controlFactory().newLabel(NLS_FILTER);

        /* Create the panel */
        myPanel.addNode(myFilterLabel);
        myPanel.addNode(theFilterButton);
        myPanel.addSpacer();
        myPanel.addNode(theBucketLabel);
        myPanel.addNode(theColumnLabel);
        myPanel.addNode(theBucketButton);
        myPanel.addNode(theColumnButton);

        /* Return the panel */
        return myPanel;
    }

    /**
     * Create filter select panel.
     * @param pFactory the GUI factory
     * @return the panel
     */
    private TethysUIBoxPaneManager buildFilterSelect(final TethysUIFactory<?> pFactory) {
        /* Create the filter panel */
        final TethysUIBoxPaneManager myPanel = pFactory.paneFactory().newHBoxPane();

        /* Create the labels */
        final TethysUILabel myTypeLabel = pFactory.controlFactory().newLabel(NLS_FILTERTYPE);

        /* Add to the card panels */
        theCardPanel.addCard(MoneyWiseXAnalysisType.DEPOSIT.name(), theDepositSelect);
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 449
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 479
theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.RETURNEDCASH, bEditField);

        /* Determine whether the reconciled field should be visible */
        final boolean bShowReconciled = isEditable || bIsReconciled;
        theReconciledState = bIsLocked;
        theDirectionState = bIsReconciled;
        theFieldSet.setFieldVisible(MoneyWiseBasicResource.TRANSACTION_RECONCILED, bShowReconciled);
        theFieldSet.setFieldEditable(MoneyWiseBasicResource.TRANSACTION_RECONCILED, isEditable && !bIsLocked);

        /* Determine basic editing */
        final boolean canEdit = isEditable && !bIsReconciled;
        final boolean needsNullAmount = myTrans.needsNullAmount();
        theFieldSet.setFieldEditable(MoneyWiseBasicResource.TRANSACTION_DIRECTION, canEdit && myTrans.canSwitchDirection());
        theFieldSet.setFieldEditable(MoneyWiseBasicResource.TRANSACTION_ACCOUNT, canEdit);
        theFieldSet.setFieldEditable(MoneyWiseBasicResource.TRANSACTION_PARTNER, canEdit);
        theFieldSet.setFieldEditable(MoneyWiseBasicDataType.TRANSCATEGORY, canEdit);
        theFieldSet.setFieldEditable(MoneyWiseBasicResource.MONEYWISEDATA_FIELD_DATE, canEdit);
        theFieldSet.setFieldEditable(MoneyWiseBasicResource.TRANSACTION_AMOUNT, canEdit && !needsNullAmount);
        theFieldSet.setFieldVisible(MoneyWiseBasicResource.TRANSACTION_AMOUNT, !needsNullAmount);

        /* Set the range for the dateButton */
        final MoneyWiseValidateTransaction myBuilder = (MoneyWiseValidateTransaction) myTrans.getList().getValidator();
        theRange = myBuilder.getRange();
    }

    /**
     * Is the field editable?
     * @param pTrans the transaction
     * @param pField the field class
     * @return true/false
     */
    public static boolean isEditableField(final MoneyWiseTransaction pTrans,
                                          final MoneyWiseTransInfoClass pField) {
        /* Access the infoSet */
        final MoneyWiseTransInfoSet myInfoSet = pTrans.getInfoSet();

        /* If the transaction is reconciled */
        if (Boolean.TRUE.equals(pTrans.isReconciled())) {
            /* Only allow editing of metaData */
            return myInfoSet.isMetaData(pField);
        }

        /* Check whether the field is available */
        final MetisFieldRequired isRequired = myInfoSet.isClassRequired(pField);
        return !isRequired.equals(MetisFieldRequired.NOTALLOWED);
    }

    @SuppressWarnings("unchecked")
    @Override
    protected void updateField(final PrometheusFieldSetEvent pUpdate) throws OceanusException {
        /* Access the field */
        final MetisDataFieldId myField = pUpdate.getFieldId();
        final MoneyWiseTransaction myTrans = getItem().getTransaction();
File Line
net\sourceforge\joceanus\moneywise\atlas\data\analysis\base\MoneyWiseXAnalysisValues.java 189
net\sourceforge\joceanus\moneywise\lethe\data\analysis\base\MoneyWiseAnalysisValues.java 195
public void resetBaseValues() {
    }

    /**
     * Set Value.
     * @param pAttr the attribute
     * @param pValue the value of the attribute
     */
    public void setValue(final E pAttr,
                         final Object pValue) {
        /* Set the value into the map */
        theMap.put(pAttr, pValue);
    }

    /**
     * Obtain an attribute value.
     * @param <X> the data type
     * @param pAttr the attribute
     * @param pClass the class of the attribute
     * @return the value of the attribute or null
     */
    private <X> X getValue(final E pAttr,
                           final Class<X> pClass) {
        /* Obtain the value */
        return pClass.cast(getValue(pAttr));
    }

    /**
     * Obtain an attribute value.
     * @param pAttr the attribute
     * @return the value of the attribute or null
     */
    public Object getValue(final E pAttr) {
        /* Obtain the attribute value */
        return theMap.get(pAttr);
    }

    /**
     * Obtain a decimal attribute value.
     * @param pAttr the attribute
     * @return the value of the attribute or null
     */
    public OceanusDecimal getDecimalValue(final E pAttr) {
        /* Obtain the attribute value */
        return getValue(pAttr, OceanusDecimal.class);
    }

    /**
     * Obtain a units attribute value.
     * @param pAttr the attribute
     * @return the value of the attribute or null
     */
    public OceanusUnits getUnitsValue(final E pAttr) {
        /* Obtain the attribute value */
        return getValue(pAttr, OceanusUnits.class);
    }

    /**
     * Obtain a price attribute value.
     * @param pAttr the attribute
     * @return the value of the attribute or null
     */
    public OceanusPrice getPriceValue(final E pAttr) {
        /* Obtain the attribute value */
        return getValue(pAttr, OceanusPrice.class);
    }

    /**
     * Obtain a money attribute value.
     * @param pAttr the attribute
     * @return the value of the attribute or null
     */
    public OceanusMoney getMoneyValue(final E pAttr) {
        /* Obtain the attribute value */
        return getValue(pAttr, OceanusMoney.class);
    }

    /**
     * Obtain a rate attribute value.
     * @param pAttr the attribute
     * @return the value of the attribute or null
     */
    public OceanusRate getRateValue(final E pAttr) {
        /* Obtain the attribute value */
        return getValue(pAttr, OceanusRate.class);
    }

    /**
     * Obtain a ratio attribute value.
     * @param pAttr the attribute
     * @return the value of the attribute or null
     */
    public OceanusRatio getRatioValue(final E pAttr) {
        /* Obtain the attribute value */
        return getValue(pAttr, OceanusRatio.class);
    }

    /**
     * Obtain a date attribute value.
     * @param pAttr the attribute
     * @return the value of the attribute or null
     */
    public OceanusDate getDateValue(final E pAttr) {
        /* Obtain the attribute value */
        return getValue(pAttr, OceanusDate.class);
    }

    /**
     * Obtain an integer attribute value.
     * @param pAttr the attribute
     * @return the value of the attribute or null
     */
    public Integer getIntegerValue(final E pAttr) {
        /* Obtain the attribute */
        return getValue(pAttr, Integer.class);
    }

    /**
     * Obtain an enum attribute value.
     * @param <V> the enum type
     * @param pAttr the attribute
     * @param pClass the Class of the enum
     * @return the value of the attribute or null
     */
    public <V extends Enum<V>> V getEnumValue(final E pAttr,
                                              final Class<V> pClass) {
        /* Obtain the attribute */
        return getValue(pAttr, pClass);
    }
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePayee.java 179
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePortfolio.java 192
public MoneyWisePayeeInfoSet getInfoSet() {
        return theInfoSet;
    }

    /**
     * Obtain fieldValue for infoSet.
     * @param pFieldId the fieldId
     * @return the value
     */
    private Object getFieldValue(final MetisDataFieldId pFieldId) {
        return theInfoSet != null ? theInfoSet.getFieldValue(pFieldId) : null;
    }

    /**
     * Obtain WebSite.
     * @return the webSite
     */
    public char[] getWebSite() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.WEBSITE, char[].class)
                : null;
    }

    /**
     * Obtain CustNo.
     * @return the customer #
     */
    public char[] getCustNo() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.CUSTOMERNO, char[].class)
                : null;
    }

    /**
     * Obtain UserId.
     * @return the userId
     */
    public char[] getUserId() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.USERID, char[].class)
                : null;
    }

    /**
     * Obtain Password.
     * @return the password
     */
    public char[] getPassword() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.PASSWORD, char[].class)
                : null;
    }

    /**
     * Obtain SortCode.
     * @return the sort code
     */
    public char[] getSortCode() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.SORTCODE, char[].class)
                : null;
    }

    /**
     * Obtain Reference.
     * @return the reference
     */
    public char[] getReference() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.REFERENCE, char[].class)
                : null;
    }

    /**
     * Obtain Account.
     * @return the account
     */
    public char[] getAccount() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.ACCOUNT, char[].class)
                : null;
    }

    /**
     * Obtain Notes.
     * @return the notes
     */
    public char[] getNotes() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.NOTES, char[].class)
                : null;
    }

    @Override
    public MoneyWisePayeeType getCategory() {
File Line
net\sourceforge\joceanus\moneywise\atlas\data\analysis\buckets\MoneyWiseXAnalysisBucketResource.java 33
net\sourceforge\joceanus\moneywise\lethe\data\analysis\data\MoneyWiseAnalysisDataResource.java 33
implements OceanusBundleId, MetisDataFieldId {
    /**
     * Analysis Name.
     */
    ANALYSIS_NAME("Analysis.Name"),

    /**
     * Analysis Analyser Name.
     */
    ANALYSIS_ANALYSER("Analysis.Analyser"),

    /**
     * Analysis Manager Name.
     */
    ANALYSIS_MANAGER("Analysis.Manager"),

    /**
     * Analysis Chargeable Events.
     */
    ANALYSIS_CHARGES("Analysis.Charges"),

    /**
     * Analysis Dilution Events.
     */
    ANALYSIS_DILUTIONS("Analysis.Dilutions"),

    /**
     * Analysis Totals.
     */
    ANALYSIS_TOTALS("Analysis.Totals"),

    /**
     * Bucket Account.
     */
    BUCKET_ACCOUNT("Bucket.Account"),

    /**
     * Bucket BaseValues.
     */
    BUCKET_BASEVALUES("Bucket.BaseValues"),

    /**
     * Bucket History.
     */
    BUCKET_HISTORY("Bucket.History"),

    /**
     * Bucket SnapShot.
     */
    BUCKET_SNAPSHOT("Bucket.SnapShot"),

    /**
     * Bucket Values.
     */
    BUCKET_VALUES("Bucket.Values"),

    /**
     * Bucket Previous Values.
     */
    BUCKET_PREVIOUS("Bucket.Previous"),

    /**
     * Filter All.
     */
    FILTER_ALL("Filter.All"),

    /**
     * TransTag Name.
     */
    TRANSTAG_NAME("TransTag.Name"),

    /**
     * TransTag List.
     */
    TRANSTAG_LIST("TransTag.List"),

    /**
     * Cash Name.
     */
    CASH_NAME("Cash.Name"),

    /**
     * Cash List.
     */
    CASH_LIST("Cash.List"),

    /**
     * CashCategory Name.
     */
    CASHCATEGORY_NAME("CashCategory.Name"),

    /**
     * CashCategory List.
     */
    CASHCATEGORY_LIST("CashCategory.List"),

    /**
     * Deposit Name.
     */
    DEPOSIT_NAME("Deposit.Name"),

    /**
     * Deposit List.
     */
    DEPOSIT_LIST("Deposit.List"),

    /**
     * DepositCategory Name.
     */
    DEPOSITCATEGORY_NAME("DepositCategory.Name"),

    /**
     * DepositCategory List.
     */
    DEPOSITCATEGORY_LIST("DepositCategory.List"),

    /**
     * Loan Name.
     */
    LOAN_NAME("Loan.Name"),

    /**
     * Loan List.
     */
    LOAN_LIST("Loan.List"),

    /**
     * Loan isCreditCard.
     */
    LOAN_CREDITCARD("Loan.isCreditCard"),

    /**
     * LoanCategory Name.
     */
    LOANCATEGORY_NAME("LoanCategory.Name"),

    /**
     * LoanCategory List.
     */
    LOANCATEGORY_LIST("LoanCategory.List"),

    /**
     * TransactionCategory Name.
     */
    TRANSCATEGORY_NAME("TransCategory.Name"),

    /**
     * TransactionCategory List.
     */
    TRANSCATEGORY_LIST("TransCategory.List"),

    /**
     * Payee Name.
     */
    PAYEE_NAME("Payee.Name"),

    /**
     * Payee List.
     */
    PAYEE_LIST("Payee.List"),

    /**
     * Portfolio Name.
     */
    PORTFOLIO_NAME("Portfolio.Name"),

    /**
     * Portfolio List.
     */
    PORTFOLIO_LIST("Portfolio.List"),

    /**
     * Portfolio Cash Name.
     */
    PORTFOLIOCASH_NAME("Portfolio.Cash.Name"),

    /**
     * Security Name.
     */
    SECURITY_NAME("Security.Name"),

    /**
     * Security List.
     */
    SECURITY_LIST("Security.List"),

    /**
     * TaxBasis Name.
     */
    TAXBASIS_NAME("TaxBasis.Name"),

    /**
     * TaxBasis List.
     */
    TAXBASIS_LIST("TaxBasis.List"),

    /**
     * TaxBasisAccount Name.
     */
    TAXBASIS_ACCOUNTNAME("TaxBasis.AccountName"),

    /**
     * TaxBasisAccount List.
     */
    TAXBASIS_ACCOUNTLIST("TaxBasis.AccountList"),

    /**
     * Dilution Name.
     */
    DILUTION_NAME("Dilution.Name"),

    /**
     * Dilution List.
     */
    DILUTION_LIST("Dilution.List"),

    /**
     * Charge Name.
     */
    CHARGE_NAME("Charge.Name"),

    /**
     * Charge List.
     */
    CHARGE_LIST("Charge.List"),

    /**
     * Charge Slice.
     */
    CHARGE_SLICE("Charge.Slice"),

    /**
     * Charge Tax.
     */
    CHARGE_TAX("Charge.Tax"),

    /**
     * TaxCalculation.
     */
    TAX_CALCULATION("Tax.Calculation"),

    /**
     * TaxYears.
     */
    TAX_YEARS("Tax.Years");

    /**
     * The AnalysisType Map.
     */
    private static final Map<MoneyWiseXAnalysisType, OceanusBundleId> ANALYSIS_MAP = buildAnalysisMap();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 947
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 954
final TethysUITableManager<MetisDataFieldId, MoneyWiseXAnalysisEvent> myTable = getTable();
        myTable.getColumn(MoneyWiseTransDataId.DEBIT).setVisible(false);
        myTable.getColumn(MoneyWiseTransDataId.CREDIT).setVisible(false);
        myTable.getColumn(MoneyWiseTransDataId.BALANCE).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.COMMENTS).setVisible(false);
        myTable.getColumn(MoneyWiseBasicResource.TRANSACTION_AMOUNT).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.TRANSTAG).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.REFERENCE).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.TAXCREDIT).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.EMPLOYERNATINS).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.EMPLOYEENATINS).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.DEEMEDBENEFIT).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.WITHHELD).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.ACCOUNTDELTAUNITS).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.PARTNERDELTAUNITS).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.PARTNERAMOUNT).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.DILUTION).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.RETURNEDCASHACCOUNT).setVisible(false);
        myTable.getColumn(MoneyWiseTransInfoClass.RETURNEDCASH).setVisible(false);
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportTaxCalculation.java 129
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportTaxCalculation.java 129
theBuilder.makeTotalCell(myTable, MoneyWiseXReportBuilder.TEXT_TOTAL);
        theBuilder.makeTotalCell(myTable, myTaxAnalysis.getTaxableIncome());
        theBuilder.makeTotalCell(myTable, myTaxAnalysis.getTaxDue());
        theBuilder.startTotalRow(myTable);
        theBuilder.makeTotalCell(myTable, MoneyWiseTaxClass.TAXPAID.toString());
        theBuilder.makeStretchedTotalCell(myTable, myTaxAnalysis.getTaxPaid());
        theBuilder.startTotalRow(myTable);
        theBuilder.makeTotalCell(myTable, TEXT_PROFIT);
        theBuilder.makeStretchedTotalCell(myTable, myTaxAnalysis.getTaxProfit());

        /* Return the document */
        return theBuilder.getDocument();
    }

    /**
     * Build a standard tax report element.
     * @param pParent the parent table
     * @param pSummary the tax summary
     */
    public void makeTaxReport(final MetisHTMLTable pParent,
                              final MoneyWiseTaxDueBucket pSummary) {
        /* Format the detail */
        final MetisHTMLTable myTable = theBuilder.createEmbeddedTable(pParent);
        theBuilder.startRow(myTable);
        theBuilder.makeTitleCell(myTable, TEXT_INCOME);
        theBuilder.makeTitleCell(myTable, TEXT_RATE);
        theBuilder.makeTitleCell(myTable, TEXT_TAXDUE);

        /* Loop through the Transaction Detail Buckets */
        final Iterator<MoneyWiseTaxBandBucket> myIterator = pSummary.taxBandIterator();
        while (myIterator.hasNext()) {
            final MoneyWiseTaxBandBucket myBucket = myIterator.next();

            /* Format the detail */
            theBuilder.startRow(myTable);
            theBuilder.makeValueCell(myTable, myBucket.getAmount());
            theBuilder.makeValueCell(myTable, myBucket.getRate());
            theBuilder.makeValueCell(myTable, myBucket.getTaxDue());
        }

        /* Embed the table correctly */
        theBuilder.embedTable(myTable, pSummary.getTaxBasis().toString());
    }

    @Override
    public MoneyWiseXAnalysisFilter<?, ?> processFilter(final Object pSource) {
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 509
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 571
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 633
final MoneyWiseXAnalysisDepositBucket myBucket = myIterator.next();

            /* Skip record if incorrect category */
            if (!MetisDataDifference.isEqual(myBucket.getCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseXAnalysisAccountValues myValues = myBucket.getValues();
            final MoneyWiseXAnalysisAccountValues myBaseValues = myBucket.getBaseValues();

            /* Create the detail row */
            theBuilder.startRow(myTable);
            theBuilder.makeFilterLinkCell(myTable, myName);

            /* Handle foreign accounts */
            if (isForeign) {
                if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.BALANCE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.BALANCE));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                    theBuilder.makeStretchedValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
            }
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUEDELTA));

            /* Record the filter */
            setFilterForId(myName, myBucket);
        }

        /* Return the table */
        return myTable;
    }

    /**
     * Create a delayed cash category table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedCash(final MetisHTMLTable pParent,
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 509
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 571
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 633
final MoneyWiseAnalysisDepositBucket myBucket = myIterator.next();

            /* Skip record if incorrect category */
            if (!MetisDataDifference.isEqual(myBucket.getCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseAnalysisAccountValues myValues = myBucket.getValues();
            final MoneyWiseAnalysisAccountValues myBaseValues = myBucket.getBaseValues();

            /* Create the detail row */
            theBuilder.startRow(myTable);
            theBuilder.makeFilterLinkCell(myTable, myName);

            /* Handle foreign accounts */
            if (isForeign) {
                if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.FOREIGNVALUE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.FOREIGNVALUE));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                    theBuilder.makeStretchedValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
            }
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUEDELTA));

            /* Record the filter */
            setFilterForId(myName, myBucket);
        }

        /* Return the table */
        return myTable;
    }

    /**
     * Create a delayed cash category table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedCash(final MetisHTMLTable pParent,
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePayee.java 487
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePortfolio.java 521
resolveDataLink(MoneyWiseBasicResource.CATEGORY_NAME, myEditSet.getDataList(MoneyWiseStaticDataType.PAYEETYPE, MoneyWisePayeeTypeList.class));
        }

        /* Resolve links in infoSet */
        theInfoSet.resolveEditSetLinks(myEditSet);
    }

    /**
     * Set a new WebSite.
     * @param pWebSite the new webSite
     * @throws OceanusException on error
     */
    public void setWebSite(final char[] pWebSite) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.WEBSITE, pWebSite);
    }

    /**
     * Set a new CustNo.
     * @param pCustNo the new custNo
     * @throws OceanusException on error
     */
    public void setCustNo(final char[] pCustNo) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.CUSTOMERNO, pCustNo);
    }

    /**
     * Set a new UserId.
     * @param pUserId the new userId
     * @throws OceanusException on error
     */
    public void setUserId(final char[] pUserId) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.USERID, pUserId);
    }

    /**
     * Set a new Password.
     * @param pPassword the new password
     * @throws OceanusException on error
     */
    public void setPassword(final char[] pPassword) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.PASSWORD, pPassword);
    }

    /**
     * Set a new SortCode.
     * @param pSortCode the new sort code
     * @throws OceanusException on error
     */
    public void setSortCode(final char[] pSortCode) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.SORTCODE, pSortCode);
    }

    /**
     * Set a new Account.
     * @param pAccount the new account
     * @throws OceanusException on error
     */
    public void setAccount(final char[] pAccount) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.ACCOUNT, pAccount);
    }

    /**
     * Set a new Reference.
     * @param pReference the new reference
     * @throws OceanusException on error
     */
    public void setReference(final char[] pReference) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.REFERENCE, pReference);
    }

    /**
     * Set a new Notes.
     * @param pNotes the new notes
     * @throws OceanusException on error
     */
    public void setNotes(final char[] pNotes) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.NOTES, pNotes);
    }

    /**
     * Set an infoSet value.
     * @param pInfoClass the class of info to set
     * @param pValue the value to set
     * @throws OceanusException on error
     */
    private void setInfoSetValue(final MoneyWiseAccountInfoClass pInfoClass,
                                 final Object pValue) throws OceanusException {
        /* Reject if there is no infoSet */
        if (!hasInfoSet) {
            throw new MoneyWiseLogicException(ERROR_BADINFOSET);
        }

        /* Set the value */
        theInfoSet.setValue(pInfoClass, pValue);
    }

    @Override
    public void touchUnderlyingItems() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXCashAnalysisSelect.java 124
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseCashAnalysisSelect.java 124
theCashButton = myButtons.newScrollButton(MoneyWiseXAnalysisCashBucket.class);

        /* Create the category button */
        theCatButton = myButtons.newScrollButton(MoneyWiseCashCategory.class);

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the labels */
        final TethysUIControlFactory myControls = pFactory.controlFactory();
        final TethysUILabel myCatLabel = myControls.newLabel(NLS_CATEGORY + TethysUIConstant.STR_COLON);
        final TethysUILabel myCshLabel = myControls.newLabel(NLS_CASH + TethysUIConstant.STR_COLON);

        /* Define the layout */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.addSpacer();
        thePanel.addNode(myCatLabel);
        thePanel.addNode(theCatButton);
        thePanel.addStrut();
        thePanel.addNode(myCshLabel);
        thePanel.addNode(theCashButton);

        /* Create initial state */
        theState = new MoneyWiseCashState();
        theState.applyState();

        /* Access the menus */
        theCategoryMenu = theCatButton.getMenu();
        theCashMenu = theCashButton.getMenu();

        /* Create the listeners */
        OceanusEventRegistrar<TethysUIEvent> myRegistrar = theCatButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewCategory());
        theCatButton.setMenuConfigurator(e -> buildCategoryMenu());
        myRegistrar = theCashButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewCash());
        theCashButton.setMenuConfigurator(e -> buildCashMenu());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public MoneyWiseXAnalysisCashFilter getFilter() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXDepositAnalysisSelect.java 124
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseDepositAnalysisSelect.java 124
theDepositButton = myButtons.newScrollButton(MoneyWiseXAnalysisDepositBucket.class);

        /* Create the category button */
        theCatButton = myButtons.newScrollButton(MoneyWiseDepositCategory.class);

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the labels */
        final TethysUIControlFactory myControls = pFactory.controlFactory();
        final TethysUILabel myCatLabel = myControls.newLabel(NLS_CATEGORY + TethysUIConstant.STR_COLON);
        final TethysUILabel myDepLabel = myControls.newLabel(NLS_DEPOSIT + TethysUIConstant.STR_COLON);

        /* Define the layout */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.addSpacer();
        thePanel.addNode(myCatLabel);
        thePanel.addNode(theCatButton);
        thePanel.addStrut();
        thePanel.addNode(myDepLabel);
        thePanel.addNode(theDepositButton);

        /* Create initial state */
        theState = new MoneyWiseDepositState();
        theState.applyState();

        /* Access the menus */
        theCategoryMenu = theCatButton.getMenu();
        theDepositMenu = theDepositButton.getMenu();

        /* Create the listeners */
        OceanusEventRegistrar<TethysUIEvent> myRegistrar = theCatButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewCategory());
        theCatButton.setMenuConfigurator(e -> buildCategoryMenu());
        myRegistrar = theDepositButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewDeposit());
        theDepositButton.setMenuConfigurator(e -> buildDepositMenu());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public MoneyWiseXAnalysisDepositFilter getFilter() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXLoanAnalysisSelect.java 124
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseLoanAnalysisSelect.java 124
theLoanButton = myButtons.newScrollButton(MoneyWiseXAnalysisLoanBucket.class);

        /* Create the category button */
        theCatButton = myButtons.newScrollButton(MoneyWiseLoanCategory.class);

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the labels */
        final TethysUIControlFactory myControls = pFactory.controlFactory();
        final TethysUILabel myCatLabel = myControls.newLabel(NLS_CATEGORY + TethysUIConstant.STR_COLON);
        final TethysUILabel myLoanLabel = myControls.newLabel(NLS_LOAN + TethysUIConstant.STR_COLON);

        /* Define the layout */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.addSpacer();
        thePanel.addNode(myCatLabel);
        thePanel.addNode(theCatButton);
        thePanel.addStrut();
        thePanel.addNode(myLoanLabel);
        thePanel.addNode(theLoanButton);

        /* Create initial state */
        theState = new MoneyWiseLoanState();
        theState.applyState();

        /* Access the menus */
        theCategoryMenu = theCatButton.getMenu();
        theLoanMenu = theLoanButton.getMenu();

        /* Create the listener */
        OceanusEventRegistrar<TethysUIEvent> myRegistrar = theCatButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewCategory());
        theCatButton.setMenuConfigurator(e -> buildCategoryMenu());
        myRegistrar = theLoanButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewLoan());
        theLoanButton.setMenuConfigurator(e -> buildLoanMenu());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public MoneyWiseXAnalysisLoanFilter getFilter() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXReportSelect.java 141
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseReportSelect.java 141
theState.setType(MoneyWiseXReportType.getDefault());

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the selection panel */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.setBorderTitle(NLS_TITLE);

        /* Define the layout */
        thePanel.addNode(myRepLabel);
        thePanel.addNode(theReportButton);
        thePanel.addSpacer();
        thePanel.addNode(theHoldingButton);
        thePanel.addSpacer();
        thePanel.addNode(theRangeSelect);
        thePanel.addSpacer();
        thePanel.addNode(thePrintButton);
        thePanel.addNode(theSaveButton);

        /* Add the listeners */
        theReportButton.getEventRegistrar().addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewReport());
        theReportButton.setMenuConfigurator(e -> buildReportMenu());
        theHoldingButton.getEventRegistrar().addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewSecurity());
        theHoldingButton.setMenuConfigurator(e -> buildHoldingMenu());
        thePrintButton.getEventRegistrar().addEventListener(e -> theEventManager.fireEvent(PrometheusDataEvent.PRINT));
        theSaveButton.getEventRegistrar().addEventListener(e -> theEventManager.fireEvent(PrometheusDataEvent.SAVETOFILE));
        theRangeSelect.getEventRegistrar().addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewRange());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    /**
     * Obtain the report type.
     * @return the report type
     */
    public MoneyWiseXReportType getReportType() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXAnalysisSelect.java 386
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseAnalysisSelect.java 384
theAnalysisMgr.getEventRegistrar().addEventListener(e -> refreshData());

        /* Handle buttons */
        theRangeButton.getEventRegistrar().addEventListener(e -> setRangeVisibility(!isRangeVisible));
        theFilterButton.getEventRegistrar().addEventListener(e -> setFilterVisibility(!isFilterVisible));
        theRangeSelect.getEventRegistrar().addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewRange());

        /* handle sub-selections */
        theDepositSelect.getEventRegistrar().addEventListener(e -> buildDepositFilter());
        theCashSelect.getEventRegistrar().addEventListener(e -> buildCashFilter());
        theLoanSelect.getEventRegistrar().addEventListener(e -> buildLoanFilter());
        theSecuritySelect.getEventRegistrar().addEventListener(e -> buildSecurityFilter());
        thePortfolioSelect.getEventRegistrar().addEventListener(e -> buildPortfolioFilter());
        thePayeeSelect.getEventRegistrar().addEventListener(e -> buildPayeeFilter());
        theCategorySelect.getEventRegistrar().addEventListener(e -> buildCategoryFilter());
        theTaxBasisSelect.getEventRegistrar().addEventListener(e -> buildTaxBasisFilter());
        theTagSelect.getEventRegistrar().addEventListener(e -> buildTagFilter());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    /**
     * Obtain the DateDayRange.
     * @return the range.
     */
    public OceanusDateRange getRange() {
        return theState.getRange();
    }

    /**
     * Obtain the analysis.
     * @return the range.
     */
    public MoneyWiseXAnalysis getAnalysis() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXAnalysisSelect.java 812
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseAnalysisSelect.java 812
if (!myAttr.isPreserved()
                    && myFilter.isRelevantCounter(myAttr)) {
                /* Create a new MenuItem and add it to the popUp */
                theBucketMenu.addItem(myAttr);
            }
        }

        /* Add the entry for null bucket */
        theBucketMenu.addNullItem(NLS_NONE);
    }

    /**
     * Build Columns menu.
     */
    private void buildColumnsMenu() {
        /* Reset the popUp menu */
        theColumnMenu.removeAllItems();

        /* Determine whether we have balances */
        final boolean hasBalances = theState.getType().hasBalances();

        /* Loop through the sets */
        for (MoneyWiseAnalysisColumnSet mySet : MoneyWiseAnalysisColumnSet.values()) {
            /* if we have balances or this is not the balance set */
            if (hasBalances
                    || !mySet.isBalance()) {
                /* Add the item */
                theColumnMenu.addItem(mySet);
            }
        }
    }

    /**
     * Build Deposit Filter.
     */
    private void buildDepositFilter() {
        applyFilter(theDepositSelect.getFilter());
    }

    /**
     * Build Cash Filter.
     */
    private void buildCashFilter() {
        applyFilter(theCashSelect.getFilter());
    }

    /**
     * Build Loan Filter.
     */
    private void buildLoanFilter() {
        applyFilter(theLoanSelect.getFilter());
    }

    /**
     * Build Security Filter.
     */
    private void buildSecurityFilter() {
        applyFilter(theSecuritySelect.getFilter());
    }

    /**
     * Build Portfolio Filter.
     */
    private void buildPortfolioFilter() {
        applyFilter(thePortfolioSelect.getFilter());
    }

    /**
     * Build Payee Filter.
     */
    private void buildPayeeFilter() {
        applyFilter(thePayeeSelect.getFilter());
    }

    /**
     * Build Category Filter.
     */
    private void buildCategoryFilter() {
        applyFilter(theCategorySelect.getFilter());
    }

    /**
     * Build TaxBasis Filter.
     */
    private void buildTaxBasisFilter() {
        applyFilter(theTaxBasisSelect.getFilter());
    }

    /**
     * Build Tag Filter.
     */
    private void buildTagFilter() {
        applyFilter(theTagSelect.getFilter());
    }

    /**
     * Apply Filter.
     * @param pFilter the filter
     */
    private void applyFilter(final MoneyWiseXAnalysisFilter<?, ?> pFilter) {
File Line
net\sourceforge\joceanus\moneywise\atlas\data\analysis\base\MoneyWiseXAnalysisValues.java 110
net\sourceforge\joceanus\moneywise\lethe\data\analysis\base\MoneyWiseAnalysisValues.java 116
public void adjustToBaseValues(final T pBaseValues) {
    }

    /**
     * Obtain delta value.
     * @param pPrevious the previous values.
     * @param pAttr the attribute
     * @return the delta
     */
    protected OceanusDecimal getDeltaValue(final T pPrevious,
                                           final E pAttr) {
        switch (pAttr.getDataType()) {
            case MONEY:
                return getDeltaMoneyValue(pPrevious, pAttr);
            case UNITS:
                return getDeltaUnitsValue(pPrevious, pAttr);
            default:
                return null;
        }
    }

    /**
     * Obtain delta money value.
     * @param pPrevious the previous values.
     * @param pAttr the attribute
     * @return the delta
     */
    protected OceanusMoney getDeltaMoneyValue(final T pPrevious,
                                              final E pAttr) {
        /* Access current and previous values */
        OceanusMoney myCurr = getMoneyValue(pAttr);
        if (pPrevious != null) {
            final OceanusMoney myPrev = pPrevious.getMoneyValue(pAttr);

            /* Calculate delta */
            myCurr = new OceanusMoney(myCurr);
            myCurr.subtractAmount(myPrev);
        }
        return myCurr;
    }

    /**
     * Obtain delta units value.
     * @param pPrevious the previous values.
     * @param pAttr the attribute
     * @return the delta
     */
    protected OceanusUnits getDeltaUnitsValue(final T pPrevious,
                                              final E pAttr) {
        /* Access current and previous values */
        OceanusUnits myCurr = getUnitsValue(pAttr);
        if (pPrevious != null) {
            final OceanusUnits myPrev = pPrevious.getUnitsValue(pAttr);

            /* Calculate delta */
            myCurr = new OceanusUnits(myCurr);
            myCurr.subtractUnits(myPrev);
        }
        return myCurr;
    }

    /**
     * Adjust money value relative to base.
     * @param pBase the base values.
     * @param pAttr the attribute to reBase.
     */
    protected void adjustMoneyToBase(final T pBase,
                                     final E pAttr) {
        /* Adjust spend values */
        OceanusMoney myValue = getMoneyValue(pAttr);
        myValue = new OceanusMoney(myValue);
        final OceanusMoney myBaseValue = pBase.getMoneyValue(pAttr);
        myValue.subtractAmount(myBaseValue);
        theMap.put(pAttr, myValue);
    }
File Line
net\sourceforge\joceanus\moneywise\atlas\data\analysis\buckets\MoneyWiseXAnalysisAccountBucket.java 664
net\sourceforge\joceanus\moneywise\lethe\data\analysis\data\MoneyWiseAnalysisAccountBucket.java 819
if (myBucket.isActive() || !myBucket.isIdle()) {
                    /* Add to the list */
                    theList.add(myBucket);
                }
            }
        }

        /**
         * Obtain item by id.
         * @param pId the id to lookup
         * @return the item (or null if not present)
         */
        public B findItemById(final Integer pId) {
            /* Return results */
            return theList.getItemById(pId);
        }

        /**
         * Construct a ranged bucket.
         * @param pBase the base bucket
         * @param pRange the Range
         * @return the new bucket
         */
        protected abstract B newBucket(B pBase,
                                       OceanusDateRange pRange);

        /**
         * Obtain the AccountBucket for a given account.
         * @param pAccount the account
         * @return the bucket
         */
        public B getBucket(final T pAccount) {
            /* Locate the bucket in the list */
            B myItem = findItemById(pAccount.getIndexedId());

            /* If the item does not yet exist */
            if (myItem == null) {
                /* Create the new bucket */
                myItem = newBucket(pAccount);

                /* Add to the list */
                theList.add(myItem);
            }

            /* Return the bucket */
            return myItem;
        }

        /**
         * Construct a standard bucket.
         * @param pAccount the Account
         * @return the new bucket
         */
        protected abstract B newBucket(T pAccount);

        /**
         * SortBuckets.
         */
        protected void sortBuckets() {
            theList.sortList();
        }

        /**
         * Mark active accounts.
         * @throws OceanusException on error
         */
        public void markActiveAccounts() throws OceanusException {
            /* Loop through the buckets */
            final Iterator<B> myIterator = iterator();
            while (myIterator.hasNext()) {
                final B myCurr = myIterator.next();
                final T myAccount = myCurr.getAccount();

                /* If we are active */
                if (myCurr.isActive()) {
                    /* Set the account as relevant */
                    myAccount.setRelevant();
                }

                /* If we are closed */
                if (Boolean.TRUE.equals(myAccount.isClosed())) {
                    /* Ensure that we have correct closed/maturity dates */
                    myAccount.adjustClosed();

                    /* If we are Relevant */
                    if (myAccount.isRelevant()
                            && theAnalysis.getData().checkClosedAccounts()) {
                        /* throw exception */
                        throw new MoneyWiseDataException(myCurr, "Illegally closed account");
                    }
                }
            }
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportAssetGains.java 139
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportPortfolioView.java 168
theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisSecurityAttr.REALISEDGAINS));

        /* Return the document */
        return theBuilder.getDocument();
    }

    @Override
    public MetisHTMLTable createDelayedTable(final DelayedTable pTable) {
        /* Access the source */
        final Object mySource = pTable.getSource();
        if (mySource instanceof MoneyWiseXAnalysisPortfolioBucket) {
            final MoneyWiseXAnalysisPortfolioBucket mySourceBucket = (MoneyWiseXAnalysisPortfolioBucket) mySource;
            return createDelayedPortfolio(pTable.getParent(), mySourceBucket);
        }

        /* Return the null table */
        return null;
    }

    /**
     * Create a delayed portfolio table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedPortfolio(final MetisHTMLTable pParent,
                                                  final MoneyWiseXAnalysisPortfolioBucket pSource) {
        /* Access the securities and portfolio */
        final MoneyWiseXAnalysisSecurityBucketList mySecurities = pSource.getSecurities();

        /* Create a new table */
        final MetisHTMLTable myTable = theBuilder.createEmbeddedTable(pParent);

        /* Loop through the Security Buckets */
        final Iterator<MoneyWiseXAnalysisSecurityBucket> myIterator = mySecurities.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseXAnalysisSecurityBucket myBucket = myIterator.next();

            /* Access bucket name */
            final String myName = myBucket.getSecurityName();
            String myFullName = myBucket.getDecoratedName();
            myFullName = myFullName.replace(':', '-');

            /* Access values */
            final MoneyWiseXAnalysisSecurityValues myValues = myBucket.getValues();

            /* Create the detail row */
            theBuilder.startRow(myTable);
            theBuilder.makeFilterLinkCell(myTable, myFullName, myName);
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisSecurityAttr.VALUATION));
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisSecurityAttr.RESIDUALCOST));
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisSecurityAttr.REALISEDGAINS));
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXSecurityAnalysisSelect.java 116
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseSecurityAnalysisSelect.java 116
thePortButton = myButtons.newScrollButton(MoneyWiseXAnalysisPortfolioBucket.class);

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the labels */
        final TethysUIControlFactory myControls = pFactory.controlFactory();
        final TethysUILabel myPortLabel = myControls.newLabel(NLS_PORTFOLIO + TethysUIConstant.STR_COLON);
        final TethysUILabel mySecLabel = myControls.newLabel(NLS_SECURITY + TethysUIConstant.STR_COLON);

        /* Define the layout */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.addSpacer();
        thePanel.addNode(myPortLabel);
        thePanel.addNode(thePortButton);
        thePanel.addStrut();
        thePanel.addNode(mySecLabel);
        thePanel.addNode(theSecButton);

        /* Create initial state */
        theState = new MoneyWiseSecurityState();
        theState.applyState();

        /* Access the menus */
        thePortfolioMenu = thePortButton.getMenu();
        theSecurityMenu = theSecButton.getMenu();

        /* Create the listener */
        OceanusEventRegistrar<TethysUIEvent> myRegistrar = thePortButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewPortfolio());
        thePortButton.setMenuConfigurator(e -> buildPortfolioMenu());
        myRegistrar = theSecButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewSecurity());
        theSecButton.setMenuConfigurator(e -> buildSecurityMenu());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public MoneyWiseXAnalysisSecurityFilter getFilter() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXTaxBasisAnalysisSelect.java 120
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseTaxBasisAnalysisSelect.java 120
theAccountButton = myButtons.newScrollButton(MoneyWiseXAnalysisTaxBasisAccountBucket.class);

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the labels */
        final TethysUIControlFactory myControls = pFactory.controlFactory();
        final TethysUILabel myBasisLabel = myControls.newLabel(NLS_BASIS + TethysUIConstant.STR_COLON);
        final TethysUILabel myAccountLabel = myControls.newLabel(NLS_ACCOUNT + TethysUIConstant.STR_COLON);

        /* Define the layout */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.addSpacer();
        thePanel.addNode(myBasisLabel);
        thePanel.addNode(theBasisButton);
        thePanel.addStrut();
        thePanel.addNode(myAccountLabel);
        thePanel.addNode(theAccountButton);

        /* Create initial state */
        theState = new MoneyWiseTaxBasisState();
        theState.applyState();

        /* Access the menus */
        theTaxMenu = theBasisButton.getMenu();
        theAccountMenu = theAccountButton.getMenu();

        /* Create the listener */
        OceanusEventRegistrar<TethysUIEvent> myRegistrar = theBasisButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewBasis());
        theBasisButton.setMenuConfigurator(e -> buildBasisMenu());
        myRegistrar = theAccountButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewAccount());
        theAccountButton.setMenuConfigurator(e -> buildAccountMenu());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public MoneyWiseXAnalysisTaxBasisFilter getFilter() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 1110
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 1116
theTable = new MoneyWiseXEventTable(pView, theEditSet, pAnalysisMgr, theError, myViewerFilter, theViewerAnalysis);

            /* Create the action buttons */
            final TethysUIFactory<?> myGuiFactory = pView.getGuiFactory();

            /* Create the header panel */
            final TethysUIPaneFactory myPanes = myGuiFactory.paneFactory();
            final TethysUIBorderPaneManager myHeader = myPanes.newBorderPane();
            myHeader.setCentre(theTable.getSelect());
            myHeader.setNorth(theError);
            myHeader.setEast(theTable.getActionButtons());

            /* Create the panel */
            thePanel = myPanes.newBorderPane();
            thePanel.setNorth(myHeader);
            thePanel.setCentre(theTable);

            /* Add listeners */
            theError.getEventRegistrar().addEventListener(e -> handleErrorPane());
            theTable.getActionButtons().getEventRegistrar().addEventListener(this::handleActionButtons);
            theTable.getEventRegistrar().addEventListener(PrometheusDataEvent.ADJUSTVISIBILITY, e -> notifyChanges());
            theTable.getEventRegistrar().addEventListener(PrometheusDataEvent.GOTOWINDOW, theEventManager::cascadeEvent);
        }

        @Override
        public TethysUIComponent getUnderlying() {
            return thePanel;
        }

        @Override
        public void setEnabled(final boolean pEnabled) {
            thePanel.setEnabled(pEnabled);
        }

        @Override
        public void setVisible(final boolean pVisible) {
            thePanel.setVisible(pVisible);
        }

        @Override
        public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
            return theEventManager.getEventRegistrar();
        }

        /**
         * Select Statement.
         * @param pSelect the selection
         */
        public void selectStatement(final MoneyWiseXStatementSelect pSelect) {
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseCash.java 295
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseDeposit.java 324
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseLoan.java 296
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePayee.java 317
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePortfolio.java 342
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseSecurity.java 306
return (MoneyWiseCashList) super.getList();
    }

    @Override
    public MetisDataState getState() {
        /* Pop history for self */
        MetisDataState myState = super.getState();

        /* If we should use the InfoSet */
        if ((myState == MetisDataState.CLEAN) && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public MetisDataEditState getEditState() {
        /* Pop history for self */
        MetisDataEditState myState = super.getEditState();

        /* If we should use the InfoSet */
        if (myState == MetisDataEditState.CLEAN
                && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getEditState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public boolean hasHistory() {
        /* Check for history for self */
        boolean hasHistory = super.hasHistory();

        /* If we should use the InfoSet */
        if (!hasHistory && useInfoSet) {
            /* Check history for infoSet */
            hasHistory = theInfoSet.hasHistory();
        }

        /* Return details */
        return hasHistory;
    }

    @Override
    public void pushHistory() {
        /* Push history for self */
        super.pushHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Push history for infoSet */
            theInfoSet.pushHistory();
        }
    }

    @Override
    public void popHistory() {
        /* Pop history for self */
        super.popHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Pop history for infoSet */
            theInfoSet.popHistory();
        }
    }

    @Override
    public boolean checkForHistory() {
        /* Check for history for self */
        boolean bChanges = super.checkForHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Check for history for infoSet */
            bChanges |= theInfoSet.checkForHistory();
        }

        /* return result */
        return bChanges;
    }

    @Override
    public MetisDataDifference fieldChanged(final MetisDataFieldId pField) {
        /* Handle InfoSet fields */
        final MoneyWiseAccountInfoClass myClass = MoneyWiseCashInfoSet.getClassForField(pField);
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportAssetGains.java 139
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportPortfolioView.java 168
theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.REALISEDGAINS));

        /* Return the document */
        return theBuilder.getDocument();
    }

    @Override
    public MetisHTMLTable createDelayedTable(final DelayedTable pTable) {
        /* Access the source */
        final Object mySource = pTable.getSource();
        if (mySource instanceof MoneyWiseAnalysisPortfolioBucket) {
            final MoneyWiseAnalysisPortfolioBucket mySourceBucket = (MoneyWiseAnalysisPortfolioBucket) mySource;
            return createDelayedPortfolio(pTable.getParent(), mySourceBucket);
        }

        /* Return the null table */
        return null;
    }

    /**
     * Create a delayed portfolio table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedPortfolio(final MetisHTMLTable pParent,
                                                  final MoneyWiseAnalysisPortfolioBucket pSource) {
        /* Access the securities and portfolio */
        final MoneyWiseAnalysisSecurityBucketList mySecurities = pSource.getSecurities();

        /* Create a new table */
        final MetisHTMLTable myTable = theBuilder.createEmbeddedTable(pParent);

        /* Loop through the Security Buckets */
        final Iterator<MoneyWiseAnalysisSecurityBucket> myIterator = mySecurities.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseAnalysisSecurityBucket myBucket = myIterator.next();

            /* Access bucket name */
            final String myName = myBucket.getSecurityName();
            String myFullName = myBucket.getDecoratedName();
            myFullName = myFullName.replace(':', '-');

            /* Access values */
            final MoneyWiseAnalysisSecurityValues myValues = myBucket.getValues();

            /* Create the detail row */
            theBuilder.startRow(myTable);
            theBuilder.makeFilterLinkCell(myTable, myFullName, myName);
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.VALUATION));
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.RESIDUALCOST));
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.REALISEDGAINS));
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXReportSelect.java 332
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseReportSelect.java 332
theState.setType(MoneyWiseXReportType.CAPITALGAINS);

        /* Notify that the state has changed */
        theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
    }

    /**
     * Create SavePoint.
     */
    public void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWiseReportState(theState);
    }

    /**
     * Restore SavePoint.
     */
    public void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWiseReportState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnable) {
        theRangeSelect.setEnabled(bEnable);
        theReportButton.setEnabled(bEnable);
        theHoldingButton.setEnabled(bEnable);
        thePrintButton.setEnabled(bEnable);
        theSaveButton.setEnabled(bEnable);
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Handle new report.
     */
    private void handleNewReport() {
        /* Set active flag */
        isActive = true;

        /* Look for a changed report type */
        if (theState.setType(theReportButton.getValue())) {
            /* Notify that the state has changed */
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }

        /* Clear active flag */
        isActive = false;
    }

    /**
     * Handle new holding.
     */
    private void handleNewSecurity() {
        /* Set active flag */
        isActive = true;

        /* Look for a changed report type */
        if (theState.setSecurity(theHoldingButton.getValue())) {
            /* Notify that the state has changed */
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }

        /* Clear active flag */
        isActive = false;
    }

    /**
     * Handle new range.
     */
    private void handleNewRange() {
        /* if we have a changed range and are not changing report */
        if (theState.setRange(theRangeSelect)
                && !isActive) {
            /* Notify that the state has changed */
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * SavePoint values.
     */
    private final class MoneyWiseReportState {
        /**
         * The analysis.
         */
        private MoneyWiseXAnalysis theAnalysis;
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 381
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 386
.setCellValueFactory(MoneyWiseXEventTable::getFilteredAction)
                .setName(MoneyWiseUIResource.STATICDATA_ACTIVE.getValue())
                .setEditable(true)
                .setCellEditable(r -> !r.isHeader() && !r.isReconciled())
                .setColumnWidth(WIDTH_ICON)
                .setOnCommit((r, v) -> updateField(this::deleteRow, r, v));

        /* Add listeners */
        pView.getEventRegistrar().addEventListener(e -> refreshData());
        theActionButtons.getEventRegistrar().addEventListener(this::handleActionButtons);
        theNewButton.getEventRegistrar().addEventListener(e -> addNewItem());
        theError.getEventRegistrar().addEventListener(e -> handleErrorPane());
        theSelect.getEventRegistrar().addEventListener(PrometheusDataEvent.SELECTIONCHANGED, e -> handleFilterSelection());
        theSelect.getEventRegistrar().addEventListener(PrometheusDataEvent.SAVETOFILE, e -> writeCSVToFile(pView.getGuiFactory()));
        theActiveTran.getEventRegistrar().addEventListener(PrometheusDataEvent.ADJUSTVISIBILITY, e -> handlePanelState());

        /* Hide the action buttons initially */
        theActionButtons.setVisible(false);
        theFilter = theSelect.getFilter();

        /* Initialise the columns */
        adjustColumns(theSelect.showColumns()
                ? theSelect.getColumns()
                : MoneyWiseAnalysisColumnSet.BALANCE);
    }
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseCash.java 296
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransaction.java 445
}

    @Override
    public MetisDataState getState() {
        /* Pop history for self */
        MetisDataState myState = super.getState();

        /* If we should use the InfoSet */
        if ((myState == MetisDataState.CLEAN) && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public MetisDataEditState getEditState() {
        /* Pop history for self */
        MetisDataEditState myState = super.getEditState();

        /* If we should use the InfoSet */
        if (myState == MetisDataEditState.CLEAN
                && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getEditState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public boolean hasHistory() {
        /* Check for history for self */
        boolean hasHistory = super.hasHistory();

        /* If we should use the InfoSet */
        if (!hasHistory && useInfoSet) {
            /* Check history for infoSet */
            hasHistory = theInfoSet.hasHistory();
        }

        /* Return details */
        return hasHistory;
    }

    @Override
    public void pushHistory() {
        /* Push history for self */
        super.pushHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Push history for infoSet */
            theInfoSet.pushHistory();
        }
    }

    @Override
    public void popHistory() {
        /* Pop history for self */
        super.popHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Pop history for infoSet */
            theInfoSet.popHistory();
        }
    }

    @Override
    public boolean checkForHistory() {
        /* Check for history for self */
        boolean bChanges = super.checkForHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Check for history for infoSet */
            bChanges |= theInfoSet.checkForHistory();
        }

        /* return result */
        return bChanges;
    }

    @Override
    public MetisDataDifference fieldChanged(final MetisDataFieldId pField) {
        /* Handle InfoSet fields */
        final MoneyWiseAccountInfoClass myClass = MoneyWiseCashInfoSet.getClassForField(pField);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseDeposit.java 325
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransaction.java 445
}

    @Override
    public MetisDataState getState() {
        /* Pop history for self */
        MetisDataState myState = super.getState();

        /* If we should use the InfoSet */
        if ((myState == MetisDataState.CLEAN) && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public MetisDataEditState getEditState() {
        /* Pop history for self */
        MetisDataEditState myState = super.getEditState();

        /* If we should use the InfoSet */
        if (myState == MetisDataEditState.CLEAN
                && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getEditState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public boolean hasHistory() {
        /* Check for history for self */
        boolean hasHistory = super.hasHistory();

        /* If we should use the InfoSet */
        if (!hasHistory && useInfoSet) {
            /* Check history for infoSet */
            hasHistory = theInfoSet.hasHistory();
        }

        /* Return details */
        return hasHistory;
    }

    @Override
    public void pushHistory() {
        /* Push history for self */
        super.pushHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Push history for infoSet */
            theInfoSet.pushHistory();
        }
    }

    @Override
    public void popHistory() {
        /* Pop history for self */
        super.popHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Pop history for infoSet */
            theInfoSet.popHistory();
        }
    }

    @Override
    public boolean checkForHistory() {
        /* Check for history for self */
        boolean bChanges = super.checkForHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Check for history for infoSet */
            bChanges |= theInfoSet.checkForHistory();
        }

        /* return result */
        return bChanges;
    }

    @Override
    public MetisDataDifference fieldChanged(final MetisDataFieldId pField) {
        /* Handle InfoSet fields */
        final MoneyWiseAccountInfoClass myClass = MoneyWiseDepositInfoSet.getClassForField(pField);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseLoan.java 297
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransaction.java 445
}

    @Override
    public MetisDataState getState() {
        /* Pop history for self */
        MetisDataState myState = super.getState();

        /* If we should use the InfoSet */
        if ((myState == MetisDataState.CLEAN) && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public MetisDataEditState getEditState() {
        /* Pop history for self */
        MetisDataEditState myState = super.getEditState();

        /* If we should use the InfoSet */
        if (myState == MetisDataEditState.CLEAN
                && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getEditState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public boolean hasHistory() {
        /* Check for history for self */
        boolean hasHistory = super.hasHistory();

        /* If we should use the InfoSet */
        if (!hasHistory && useInfoSet) {
            /* Check history for infoSet */
            hasHistory = theInfoSet.hasHistory();
        }

        /* Return details */
        return hasHistory;
    }

    @Override
    public void pushHistory() {
        /* Push history for self */
        super.pushHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Push history for infoSet */
            theInfoSet.pushHistory();
        }
    }

    @Override
    public void popHistory() {
        /* Pop history for self */
        super.popHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Pop history for infoSet */
            theInfoSet.popHistory();
        }
    }

    @Override
    public boolean checkForHistory() {
        /* Check for history for self */
        boolean bChanges = super.checkForHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Check for history for infoSet */
            bChanges |= theInfoSet.checkForHistory();
        }

        /* return result */
        return bChanges;
    }

    @Override
    public MetisDataDifference fieldChanged(final MetisDataFieldId pField) {
        /* Handle InfoSet fields */
        final MoneyWiseAccountInfoClass myClass = MoneyWiseLoanInfoSet.getClassForField(pField);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePayee.java 318
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransaction.java 445
}

    @Override
    public MetisDataState getState() {
        /* Pop history for self */
        MetisDataState myState = super.getState();

        /* If we should use the InfoSet */
        if ((myState == MetisDataState.CLEAN) && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public MetisDataEditState getEditState() {
        /* Pop history for self */
        MetisDataEditState myState = super.getEditState();

        /* If we should use the InfoSet */
        if (myState == MetisDataEditState.CLEAN
                && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getEditState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public boolean hasHistory() {
        /* Check for history for self */
        boolean hasHistory = super.hasHistory();

        /* If we should use the InfoSet */
        if (!hasHistory && useInfoSet) {
            /* Check history for infoSet */
            hasHistory = theInfoSet.hasHistory();
        }

        /* Return details */
        return hasHistory;
    }

    @Override
    public void pushHistory() {
        /* Push history for self */
        super.pushHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Push history for infoSet */
            theInfoSet.pushHistory();
        }
    }

    @Override
    public void popHistory() {
        /* Pop history for self */
        super.popHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Pop history for infoSet */
            theInfoSet.popHistory();
        }
    }

    @Override
    public boolean checkForHistory() {
        /* Check for history for self */
        boolean bChanges = super.checkForHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Check for history for infoSet */
            bChanges |= theInfoSet.checkForHistory();
        }

        /* return result */
        return bChanges;
    }

    @Override
    public MetisDataDifference fieldChanged(final MetisDataFieldId pField) {
        /* Handle InfoSet fields */
        final MoneyWiseAccountInfoClass myClass = MoneyWisePayeeInfoSet.getClassForField(pField);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePortfolio.java 343
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransaction.java 445
}

    @Override
    public MetisDataState getState() {
        /* Pop history for self */
        MetisDataState myState = super.getState();

        /* If we should use the InfoSet */
        if ((myState == MetisDataState.CLEAN) && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public MetisDataEditState getEditState() {
        /* Pop history for self */
        MetisDataEditState myState = super.getEditState();

        /* If we should use the InfoSet */
        if (myState == MetisDataEditState.CLEAN
                && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getEditState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public boolean hasHistory() {
        /* Check for history for self */
        boolean hasHistory = super.hasHistory();

        /* If we should use the InfoSet */
        if (!hasHistory && useInfoSet) {
            /* Check history for infoSet */
            hasHistory = theInfoSet.hasHistory();
        }

        /* Return details */
        return hasHistory;
    }

    @Override
    public void pushHistory() {
        /* Push history for self */
        super.pushHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Push history for infoSet */
            theInfoSet.pushHistory();
        }
    }

    @Override
    public void popHistory() {
        /* Pop history for self */
        super.popHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Pop history for infoSet */
            theInfoSet.popHistory();
        }
    }

    @Override
    public boolean checkForHistory() {
        /* Check for history for self */
        boolean bChanges = super.checkForHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Check for history for infoSet */
            bChanges |= theInfoSet.checkForHistory();
        }

        /* return result */
        return bChanges;
    }

    @Override
    public MetisDataDifference fieldChanged(final MetisDataFieldId pField) {
        /* Handle InfoSet fields */
        final MoneyWiseAccountInfoClass myClass = MoneyWisePortfolioInfoSet.getClassForField(pField);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseSecurity.java 307
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransaction.java 445
}

    @Override
    public MetisDataState getState() {
        /* Pop history for self */
        MetisDataState myState = super.getState();

        /* If we should use the InfoSet */
        if ((myState == MetisDataState.CLEAN) && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public MetisDataEditState getEditState() {
        /* Pop history for self */
        MetisDataEditState myState = super.getEditState();

        /* If we should use the InfoSet */
        if (myState == MetisDataEditState.CLEAN
                && useInfoSet) {
            /* Get state for infoSet */
            myState = theInfoSet.getEditState();
        }

        /* Return the state */
        return myState;
    }

    @Override
    public boolean hasHistory() {
        /* Check for history for self */
        boolean hasHistory = super.hasHistory();

        /* If we should use the InfoSet */
        if (!hasHistory && useInfoSet) {
            /* Check history for infoSet */
            hasHistory = theInfoSet.hasHistory();
        }

        /* Return details */
        return hasHistory;
    }

    @Override
    public void pushHistory() {
        /* Push history for self */
        super.pushHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Push history for infoSet */
            theInfoSet.pushHistory();
        }
    }

    @Override
    public void popHistory() {
        /* Pop history for self */
        super.popHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Pop history for infoSet */
            theInfoSet.popHistory();
        }
    }

    @Override
    public boolean checkForHistory() {
        /* Check for history for self */
        boolean bChanges = super.checkForHistory();

        /* If we should use the InfoSet */
        if (useInfoSet) {
            /* Check for history for infoSet */
            bChanges |= theInfoSet.checkForHistory();
        }

        /* return result */
        return bChanges;
    }

    @Override
    public MetisDataDifference fieldChanged(final MetisDataFieldId pField) {
        /* Handle InfoSet fields */
        final MoneyWiseAccountInfoClass myClass = MoneyWiseSecurityInfoSet.getClassForField(pField);
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 917
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 923
myTable.getColumn(MoneyWiseTransInfoClass.RETURNEDCASH).setVisible(true);
                break;
            case ALL:
            default:
                myTable.getColumn(MoneyWiseTransInfoClass.COMMENTS).setVisible(true);
                myTable.getColumn(MoneyWiseBasicResource.TRANSACTION_AMOUNT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.TRANSTAG).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.REFERENCE).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.TAXCREDIT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.EMPLOYERNATINS).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.EMPLOYEENATINS).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.DEEMEDBENEFIT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.WITHHELD).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.ACCOUNTDELTAUNITS).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.PARTNERDELTAUNITS).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.PARTNERAMOUNT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.DILUTION).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.RETURNEDCASHACCOUNT).setVisible(true);
                myTable.getColumn(MoneyWiseTransInfoClass.RETURNEDCASH).setVisible(true);
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 606
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 636
final MoneyWiseXAnalysisFilter<?, ?> myFilter = myIterator.next();

            /* declare it */
            declareGoToFilter(myFilter);
        }

        /* If we have not had updates */
        if (!pUpdates) {
            /* Allow GoTo different panels */
            buildAssetGoTo(myItem.getAccount());
            buildAssetGoTo(myItem.getPartner());
            declareGoToItem(myItem.getCategory());
            buildAssetGoTo(myItem.getReturnedCashAccount());
        }
    }

    /**
     * Handle goto declarations for TransactionAssets.
     * @param pAsset the asset
     */
    private void buildAssetGoTo(final MoneyWiseTransAsset pAsset) {
        if (pAsset instanceof MoneyWiseSecurityHolding) {
            /* Build menu Items for Portfolio and Security */
            final MoneyWiseSecurityHolding myHolding = (MoneyWiseSecurityHolding) pAsset;
            declareGoToItem(myHolding.getPortfolio());
            declareGoToItem(myHolding.getSecurity());
        } else if (pAsset instanceof MoneyWiseAssetBase) {
            declareGoToItem((MoneyWiseAssetBase) pAsset);
        }
    }

    /**
     * Resolve Asset.
     * @param pAsset the asset to resolve
     * @return the resolved asset
     */
    public static MoneyWiseTransAsset resolveAsset(final MoneyWiseTransAsset pAsset) {
        /* If this is a security holding */
        if (pAsset instanceof MoneyWiseSecurityHolding) {
            /* declare holding via map */
            final MoneyWiseSecurityHolding myHolding = (MoneyWiseSecurityHolding) pAsset;
            final MoneyWisePortfolio myPortfolio = myHolding.getPortfolio();
            final MoneyWiseSecurity mySecurity = myHolding.getSecurity();
            final MoneyWiseDataSet myData = myPortfolio.getDataSet();
            final MoneyWiseSecurityHoldingMap myMap = myData.getPortfolios().getSecurityHoldingsMap();
            return myMap.declareHolding(myPortfolio, mySecurity);
        }

        /* Just return the asset */
        return pAsset;
    }

    /**
     * Build the account menu for an item.
     * @param pMenu the menu
     * @param pEvent the event to build for
     */
    public void buildAccountMenu(final TethysUIScrollMenu<MoneyWiseTransAsset> pMenu,
                                 final MoneyWiseXAnalysisEvent pEvent) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 203
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 198
theFieldSet.addField(MoneyWiseBasicResource.TRANSACTION_RECONCILED, myReconciledButton, MoneyWiseXAnalysisEvent::isReconciled);

        /* Configure the menuBuilders */
        myDateButton.setDateConfigurator(this::handleDateConfig);
        myAccountButton.setMenuConfigurator(c -> buildAccountMenu(c, getItem()));
        myCategoryButton.setMenuConfigurator(c -> buildCategoryMenu(c, getItem()));
        myPartnerButton.setMenuConfigurator(c -> buildPartnerMenu(c, getItem()));
        final Map<Boolean, TethysUIIconMapSet<Boolean>> myRecMapSets = MoneyWiseIcon.configureReconciledIconButton(pFactory);
        myReconciledButton.setIconMapSet(() -> myRecMapSets.get(theReconciledState));
        final Map<Boolean, TethysUIIconMapSet<MoneyWiseAssetDirection>> myDirMapSets = MoneyWiseIcon.configureDirectionIconButton(pFactory);
        myDirectionButton.setIconMapSet(() -> myDirMapSets.get(theDirectionState));
        myAmount.setDeemedCurrency(() -> getItem().getAccount().getCurrency());
    }

    /**
     * Build info subPanel.
     * @param pFactory the GUI factory
     */
    private void buildInfoPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_INFO);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUIMoneyEditField myAmount = myFields.newMoneyField();
        final TethysUIStringEditField myComments = myFields.newStringField();
        final TethysUIStringEditField myReference = myFields.newStringField();

        /* Create the buttons */
        final TethysUIListButtonField<MoneyWiseTransTag> myTagButton = myFields.newListField();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 897
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 925
final MoneyWiseDataValidatorTrans myValidator = pEvent.getTransaction().getList().getValidator();

        /* Loop through the available category values */
        final Iterator<MoneyWiseTransCategory> myIterator = myCategories.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseTransCategory myCategory = myIterator.next();

            /* Only process non-deleted low-level items */
            final MoneyWiseTransCategoryClass myClass = myCategory.getCategoryTypeClass();
            boolean bIgnore = myCategory.isDeleted() || myClass.canParentCategory();

            /* Check whether the category is allowable for the owner */
            bIgnore |= !myValidator.isValidCategory(myAccount, myCategory);
            if (bIgnore) {
                continue;
            }

            /* Determine parent */
            final MoneyWiseTransCategory myParent = myCategory.getParentCategory();

            /* If we have a parent */
            if (myParent != null) {
                final String myParentName = myParent.getName();
                final TethysUIScrollSubMenu<MoneyWiseTransCategory> myMenu = myMap.computeIfAbsent(myParentName, pMenu::addSubMenu);

                /* Create a new MenuItem and add it to the subMenu */
                myItem = myMenu.getSubMenu().addItem(myCategory, myCategory.getSubCategory());

            } else {
                /* Create a new MenuItem and add it to the popUp */
                myItem = pMenu.addItem(myCategory);
            }

            /* If this is the active category */
            if (myCategory.equals(myCurr)) {
                /* Record it */
                myActive = myItem;
            }
        }

        /* Ensure active item is visible */
        if (myActive != null) {
            myActive.scrollToItem();
        }
    }

    /**
     * Build the ReturnedAccount menu for an item.
     * @param pMenu the menu
     * @param pEvent the event to build for
     */
    public void buildReturnedAccountMenu(final TethysUIScrollMenu<MoneyWiseTransAsset> pMenu,
                                         final MoneyWiseXAnalysisEvent pEvent) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXAnalysisSelect.java 646
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseAnalysisSelect.java 646
final MoneyWiseXAnalysisFilter<?, ?> myFilter = myPanel.getFilter();
            myFilter.setCurrentAttribute(theState.getBucket());
            theState.setFilter(myFilter);
        }

        /* Notify updated filter */
        theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
    }

    /**
     * Create SavePoint.
     */
    protected void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWiseAnalysisState(theState);
    }

    /**
     * Restore SavePoint.
     */
    protected void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWiseAnalysisState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* If there are filters available */
        if (isAvailable()) {
            /* Enabled disable range selection */
            theRangeButton.setEnabled(bEnabled);

            /* Enable filter detail */
            theFilterDetail.setVisible(true);
            theFilterButton.setEnabled(bEnabled);
            theColumnButton.setEnabled(bEnabled);
            theBucketButton.setEnabled(bEnabled);

            /* If we are disabling */
            if (!bEnabled) {
                /* Hide panels */
                setRangeVisibility(false);
                setFilterVisibility(false);
            }

            /* else no filters available */
        } else {
            /* Enabled disable range selection */
            theRangeButton.setEnabled(false);

            /* Hide panels */
            setRangeVisibility(false);
            setFilterVisibility(false);
            theFilterDetail.setVisible(false);
            theRangeSelect.setEnabled(bEnabled);
        }
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Is there any filter available?
     * @return true/false
     */
    private boolean isAvailable() {
        /* Loop through the panels */
        for (MoneyWiseXAnalysisFilterSelection myEntry : theMap.values()) {
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportTaxCalculation.java 96
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportTaxCalculation.java 96
public Document createReport(final MoneyWiseXAnalysis pAnalysis) {
        /* Access the bucket lists */
        final MoneyWiseTaxAnalysis myTaxAnalysis = pAnalysis.getTaxAnalysis();
        final MoneyWiseTaxYear myYear = myTaxAnalysis.getTaxYear();

        /* Start the report */
        final Element myBody = theBuilder.startReport();
        theBuilder.makeTitle(myBody, TEXT_TITLE, theFormatter.formatObject(myYear.getYearEnd()));

        /* Format the header */
        final MetisHTMLTable myTable = theBuilder.startTable(myBody);
        theBuilder.startHdrRow(myTable);
        theBuilder.makeTitleCell(myTable, MoneyWiseStaticResource.TAXBASIS_NAME.getValue());
        theBuilder.makeTitleCell(myTable, TEXT_INCOME);
        theBuilder.makeTitleCell(myTable, TEXT_TAXDUE);

        /* Loop through the Tax Due Buckets */
        final Iterator<MoneyWiseTaxDueBucket> myTaxIterator = myTaxAnalysis.taxDueIterator();
        while (myTaxIterator.hasNext()) {
            final MoneyWiseTaxDueBucket myBucket = myTaxIterator.next();

            /* Format the line */
            theBuilder.startRow(myTable);
            theBuilder.makeTableLinkCell(myTable, myBucket.getTaxBasis().toString());
            theBuilder.makeValueCell(myTable, myBucket.getTaxableIncome());
            theBuilder.makeValueCell(myTable, myBucket.getTaxDue());

            /* Format the detail */
            makeTaxReport(myTable, myBucket);
        }

        /* Access the Totals */
        theBuilder.startTotalRow(myTable);
        theBuilder.makeTotalCell(myTable, MoneyWiseXReportBuilder.TEXT_TOTAL);
File Line
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableDeposit.java 90
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableLoan.java 90
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableSecurity.java 90
protected void setFieldValue(final MoneyWiseDeposit pItem,
                                 final MetisDataFieldId iField) throws OceanusException {
        /* Switch on field id */
        final PrometheusTableDefinition myTableDef = getTableDef();
        if (MoneyWiseBasicResource.CATEGORY_NAME.equals(iField)) {
            myTableDef.setIntegerValue(iField, pItem.getCategoryId());
        } else if (MoneyWiseBasicResource.ASSET_PARENT.equals(iField)) {
            myTableDef.setIntegerValue(iField, pItem.getParentId());
        } else if (MoneyWiseStaticDataType.CURRENCY.equals(iField)) {
            myTableDef.setIntegerValue(iField, pItem.getAssetCurrencyId());
        } else if (PrometheusDataResource.DATAITEM_FIELD_NAME.equals(iField)) {
            myTableDef.setBinaryValue(iField, pItem.getNameBytes());
        } else if (PrometheusDataResource.DATAITEM_FIELD_DESC.equals(iField)) {
            myTableDef.setBinaryValue(iField, pItem.getDescBytes());
        } else if (MoneyWiseBasicResource.ASSET_CLOSED.equals(iField)) {
            myTableDef.setBooleanValue(iField, pItem.isClosed());
        } else {
            super.setFieldValue(pItem, iField);
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 458
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportNetWorth.java 458
theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisSecurityAttr.VALUEDELTA));

            /* Note the delayed subTable */
            setDelayedTable(myName, myTable, myBucket);
        }

        /* Embed the table correctly */
        theBuilder.embedTable(myTable, MoneyWiseBasicDataType.PORTFOLIO.getListName());
    }

    @Override
    public MetisHTMLTable createDelayedTable(final DelayedTable pTable) {
        /* Access the source */
        final Object mySource = pTable.getSource();
        if (mySource instanceof MoneyWiseXAnalysisDepositCategoryBucket) {
            final MoneyWiseXAnalysisDepositCategoryBucket mySourceBucket = (MoneyWiseXAnalysisDepositCategoryBucket) mySource;
            return createDelayedDeposit(pTable.getParent(), mySourceBucket);
        } else if (mySource instanceof MoneyWiseXAnalysisCashCategoryBucket) {
            final MoneyWiseXAnalysisCashCategoryBucket mySourceBucket = (MoneyWiseXAnalysisCashCategoryBucket) mySource;
            return createDelayedCash(pTable.getParent(), mySourceBucket);
        } else if (mySource instanceof MoneyWiseXAnalysisLoanCategoryBucket) {
            final MoneyWiseXAnalysisLoanCategoryBucket mySourceBucket = (MoneyWiseXAnalysisLoanCategoryBucket) mySource;
            return createDelayedLoan(pTable.getParent(), mySourceBucket);
        } else if (mySource instanceof MoneyWiseXAnalysisPortfolioBucket) {
            final MoneyWiseXAnalysisPortfolioBucket mySourceBucket = (MoneyWiseXAnalysisPortfolioBucket) mySource;
            return createDelayedPortfolio(pTable.getParent(), mySourceBucket);
        }

        /* Return the null table */
        return null;
    }

    /**
     * Create a delayed deposit category table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedDeposit(final MetisHTMLTable pParent,
                                                final MoneyWiseXAnalysisDepositCategoryBucket pSource) {
        /* Access the category */
        final MoneyWiseXAnalysisDepositBucketList myDeposits = theAnalysis.getDeposits();
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 458
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportNetWorth.java 458
theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.VALUEDELTA));

            /* Note the delayed subTable */
            setDelayedTable(myName, myTable, myBucket);
        }

        /* Embed the table correctly */
        theBuilder.embedTable(myTable, MoneyWiseBasicDataType.PORTFOLIO.getListName());
    }

    @Override
    public MetisHTMLTable createDelayedTable(final DelayedTable pTable) {
        /* Access the source */
        final Object mySource = pTable.getSource();
        if (mySource instanceof MoneyWiseAnalysisDepositCategoryBucket) {
            final MoneyWiseAnalysisDepositCategoryBucket mySourceBucket = (MoneyWiseAnalysisDepositCategoryBucket) mySource;
            return createDelayedDeposit(pTable.getParent(), mySourceBucket);
        } else if (mySource instanceof MoneyWiseAnalysisCashCategoryBucket) {
            final MoneyWiseAnalysisCashCategoryBucket mySourceBucket = (MoneyWiseAnalysisCashCategoryBucket) mySource;
            return createDelayedCash(pTable.getParent(), mySourceBucket);
        } else if (mySource instanceof MoneyWiseAnalysisLoanCategoryBucket) {
            final MoneyWiseAnalysisLoanCategoryBucket mySourceBucket = (MoneyWiseAnalysisLoanCategoryBucket) mySource;
            return createDelayedLoan(pTable.getParent(), mySourceBucket);
        } else if (mySource instanceof MoneyWiseAnalysisPortfolioBucket) {
            final MoneyWiseAnalysisPortfolioBucket mySourceBucket = (MoneyWiseAnalysisPortfolioBucket) mySource;
            return createDelayedPortfolio(pTable.getParent(), mySourceBucket);
        }

        /* Return the null table */
        return null;
    }

    /**
     * Create a delayed deposit category table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedDeposit(final MetisHTMLTable pParent,
                                                final MoneyWiseAnalysisDepositCategoryBucket pSource) {
        /* Access the category */
        final MoneyWiseAnalysisDepositBucketList myDeposits = theAnalysis.getDeposits();
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseAccountPanel.java 283
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseCategoryPanel.java 273
setChildListeners(theSecurityTable.getEventRegistrar());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    /**
     * setChildListeners.
     * @param pRegistrar the registrar
     */
    private void setChildListeners(final OceanusEventRegistrar<PrometheusDataEvent> pRegistrar) {
        pRegistrar.addEventListener(PrometheusDataEvent.ADJUSTVISIBILITY, e -> {
            if (!isRefreshing) {
                setVisibility();
            }
        });
        pRegistrar.addEventListener(PrometheusDataEvent.GOTOWINDOW, this::handleGoToEvent);
    }

    @Override
    public void setEnabled(final boolean pEnabled) {
        theSelectButton.setEnabled(pEnabled);
        theCardPanel.setEnabled(pEnabled);
        theFilterCardPanel.setEnabled(pEnabled);
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Build select menu.
     */
    private void buildSelectMenu() {
        /* Create builder */
        final TethysUIScrollMenu<PanelName> myMenu = theSelectButton.getMenu();

        /* Loop through the panels */
        for (PanelName myPanel : PanelName.values()) {
            /* Create a new JMenuItem for the panel */
            myMenu.addItem(myPanel);
        }
    }

    /**
     * Show locked accounts.
     * @param pShow true/false
     */
    public void showLocked(final boolean pShow) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXLoanAnalysisSelect.java 304
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseLoanAnalysisSelect.java 304
final MoneyWiseXAnalysisLoanCategoryBucket myBucket = myIterator.next();

            /* Only process low-level items */
            if (myBucket.getAccountCategory().isCategoryClass(MoneyWiseLoanCategoryClass.PARENT)) {
                continue;
            }

            /* Determine menu to add to */
            final MoneyWiseLoanCategory myParent = myBucket.getAccountCategory().getParentCategory();
            final String myParentName = myParent.getName();
            TethysUIScrollSubMenu<MoneyWiseLoanCategory> myMenu = myMap.get(myParent.getName());

            /* If this is a new menu */
            if (myMenu == null) {
                /* Create a new JMenu and add it to the popUp */
                myMenu = theCategoryMenu.addSubMenu(myParentName);
                myMap.put(myParentName, myMenu);
            }

            /* Create a new JMenuItem and add it to the popUp */
            final MoneyWiseLoanCategory myCategory = myBucket.getAccountCategory();
            final TethysUIScrollItem<MoneyWiseLoanCategory> myItem = myMenu.getSubMenu().addItem(myCategory, myCategory.getSubCategory());

            /* If this is the active category */
            if (myCategory.equals(myCurrent)) {
                /* Record it */
                myActive = myItem;
            }
        }

        /* Ensure active item is visible */
        if (myActive != null) {
            myActive.scrollToItem();
        }
    }

    /**
     * Build Loan menu.
     */
    private void buildLoanMenu() {
        /* Reset the popUp menu */
        theLoanMenu.removeAllItems();

        /* Access current category and Loan */
        final MoneyWiseLoanCategory myCategory = theState.getCategory();
        final MoneyWiseXAnalysisLoanBucket myLoan = theState.getLoan();
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseAccountPanel.java 248
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseCategoryPanel.java 238
theFilterCardPanel.addCard(PanelName.PAYEES.toString(), thePayeeTable.getFilterPanel());

        /* Create the select prompt */
        final TethysUIBoxPaneManager mySelect = myPanes.newHBoxPane();
        mySelect.addNode(myLabel);
        mySelect.addNode(theSelectButton);

        /* Create the selection panel */
        theSelectPanel = myPanes.newBorderPane();
        theSelectPanel.setBorderTitle(NLS_SELECT);
        theSelectPanel.setWest(mySelect);
        theSelectPanel.setCentre(theFilterCardPanel);

        /* Create the header panel */
        final TethysUIBorderPaneManager myHeader = myPanes.newBorderPane();
        myHeader.setCentre(theSelectPanel);
        myHeader.setNorth(theError);
        myHeader.setEast(theActionButtons);

        /* Now define the panel */
        thePanel.setNorth(myHeader);
        thePanel.setCentre(theCardPanel);

        /* Hide the action buttons initially */
        theActionButtons.setVisible(false);

        /* Create the listeners */
        theSelectButton.getEventRegistrar().addEventListener(TethysUIEvent.NEWVALUE, e -> handleSelection());
        theError.getEventRegistrar().addEventListener(e -> handleErrorPane());
        theActionButtons.getEventRegistrar().addEventListener(this::handleActionButtons);
        setChildListeners(theDepositTable.getEventRegistrar());
        setChildListeners(theCashTable.getEventRegistrar());
        setChildListeners(theLoanTable.getEventRegistrar());
        setChildListeners(thePayeeTable.getEventRegistrar());
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 155
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 150
final MoneyWiseBaseTable<MoneyWiseXAnalysisEvent> pOwner) {
        /* Initialise the panel */
        super(pFactory, pEditSet, pOwner);
        theAnalysisSelect = pAnalysisSelect;

        /* Access the fieldSet */
        theFieldSet = getFieldSet();

        /* Build the main panel */
        buildMainPanel(pFactory);

        /* Build the info panel */
        buildInfoPanel(pFactory);

        /* Build the tax panel */
        buildTaxPanel(pFactory);

        /* Build the securities panel */
        buildSecuritiesPanel(pFactory);

        /* Build the returned panel */
        buildReturnedPanel(pFactory);
    }

    /**
     * Build Main subPanel.
     * @param pFactory the GUI factory
     */
    private void buildMainPanel(final TethysUIFactory<?> pFactory) {
        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUIMoneyEditField myAmount = myFields.newMoneyField();

        /* Create the buttons */
        final TethysUIDateButtonField myDateButton = myFields.newDateField();
        final TethysUIScrollButtonField<MoneyWiseTransAsset> myAccountButton = myFields.newScrollField(MoneyWiseTransAsset.class);
        final TethysUIScrollButtonField<MoneyWiseTransAsset> myPartnerButton = myFields.newScrollField(MoneyWiseTransAsset.class);
        final TethysUIScrollButtonField<MoneyWiseTransCategory> myCategoryButton = myFields.newScrollField(MoneyWiseTransCategory.class);
        final TethysUIIconButtonField<Boolean> myReconciledButton = myFields.newIconField(Boolean.class);
        final TethysUIIconButtonField<MoneyWiseAssetDirection> myDirectionButton = myFields.newIconField(MoneyWiseAssetDirection.class);

        /* Assign the fields to the panel */
        theFieldSet.addField(MoneyWiseBasicResource.MONEYWISEDATA_FIELD_DATE, myDateButton, MoneyWiseXAnalysisEvent::getDate);
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 1158
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 1164
public void selectStatement(final MoneyWiseXStatementSelect pSelect) {
            theTable.selectStatement(pSelect);
        }

        /**
         * handleErrorPane.
         */
        private void handleErrorPane() {
            /* Determine whether we have an error */
            final boolean isError = theError.hasError();

            /* Hide selection panel on error */
            theTable.getSelect().setVisible(!isError);

            /* Lock scroll area */
            theTable.setEnabled(!isError);

            /* Lock Action Buttons */
            theTable.getActionButtons().setEnabled(!isError);
        }

        /**
         * handle Action Buttons.
         * @param pEvent the event
         */
        private void handleActionButtons(final OceanusEvent<PrometheusUIEvent> pEvent) {
            /* Cancel editing */
            theTable.cancelEditing();

            /* Perform the command */
            theEditSet.processCommand(pEvent.getEventId(), theError);

            /* Adjust for changes */
            theTable.notifyChanges();
        }

        /**
         * Determine Focus.
         */
        public void determineFocus() {
            /* Request the focus */
            theTable.determineFocus();

            /* Focus on the Data entry */
            theViewerAnalysis.setFocus();
        }

        /**
         * Call underlying controls to take notice of changes in view/selection.
         */
        private void notifyChanges() {
            /* Notify listeners */
            theEventManager.fireEvent(PrometheusDataEvent.ADJUSTVISIBILITY);
        }

        /**
         * Does the panel have updates?
         * @return true/false
         */
        public boolean hasUpdates() {
            return theTable.hasUpdates();
        }

        /**
         * Does the panel have a session?
         * @return true/false
         */
        public boolean hasSession() {
            return theTable.hasUpdates();
        }

        /**
         * Does the panel have errors?
         * @return true/false
         */
        public boolean hasErrors() {
            return theTable.hasErrors();
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseLoanInfoSet.java 78
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePayeeInfoSet.java 77
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePortfolioInfoSet.java 77
return (MoneyWiseLoan) super.getOwner();
    }

    /**
     * Obtain fieldValue for infoSet.
     * @param pFieldId the fieldId
     * @return the value
     */
    public Object getFieldValue(final MetisDataFieldId pFieldId) {
        /* Handle InfoSet fields */
        final MoneyWiseAccountInfoClass myClass = getClassForField(pFieldId);
        if (myClass != null) {
            return getInfoSetValue(myClass);
        }

        /* Pass onwards */
        return null;
    }

    /**
     * Get an infoSet value.
     * @param pInfoClass the class of info to get
     * @return the value to set
     */
    private Object getInfoSetValue(final MoneyWiseAccountInfoClass pInfoClass) {
        /* Return the value */
        final Object myValue = getField(pInfoClass);
        return myValue != null
                ? myValue
                : MetisDataFieldValue.SKIP;
    }

    /**
     * Obtain the class of the field if it is an infoSet field.
     * @param pField the field
     * @return the class
     */
    public static MoneyWiseAccountInfoClass getClassForField(final MetisDataFieldId pField) {
        /* Look up field in map */
        return FIELDSET_MAP.get(pField);
    }

    /**
     * Obtain the field for the infoSet class.
     * @param pClass the class
     * @return the field
     */
    public static MetisDataFieldId getFieldForClass(final MoneyWiseAccountInfoClass pClass) {
        /* Look up field in map */
        return REVERSE_FIELDMAP.get(pClass);
    }

    @Override
    public MetisDataFieldId getFieldForClass(final PrometheusDataInfoClass pClass) {
        return getFieldForClass((MoneyWiseAccountInfoClass) pClass);
    }

    @Override
    public Iterator<PrometheusDataInfoClass> classIterator() {
        final PrometheusDataInfoClass[] myValues = MoneyWiseAccountInfoClass.values();
        return Arrays.stream(myValues).iterator();
    }

    /**
     * Clone the dataInfoSet.
     * @param pSource the InfoSet to clone
     */
    protected void cloneDataInfoSet(final MoneyWiseLoanInfoSet pSource) {
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportNetWorth.java 586
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportNetWorth.java 651
final MoneyWiseXAnalysisCashBucket myBucket = myIterator.next();

            /* Skip record if inactive or incorrect category */
            if (!myBucket.isActive()
                    || !MetisDataDifference.isEqual(myBucket.getCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseXAnalysisAccountValues myValues = myBucket.getValues();

            /* Create the detail row */
            theBuilder.startRow(myTable);
            theBuilder.makeFilterLinkCell(myTable, myName);

            /* Handle foreign accounts */
            if (isForeign) {
                if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.BALANCE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
            }

            /* Record the filter */
            setFilterForId(myName, myBucket);
        }

        /* Return the table */
        return myTable;
    }

    /**
     * Create a delayed category table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedLoan(final MetisHTMLTable pParent,
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportNetWorth.java 586
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportNetWorth.java 651
final MoneyWiseAnalysisCashBucket myBucket = myIterator.next();

            /* Skip record if inactive or incorrect category */
            if (!myBucket.isActive()
                    || !MetisDataDifference.isEqual(myBucket.getCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseAnalysisAccountValues myValues = myBucket.getValues();

            /* Create the detail row */
            theBuilder.startRow(myTable);
            theBuilder.makeFilterLinkCell(myTable, myName);

            /* Handle foreign accounts */
            if (isForeign) {
                if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.FOREIGNVALUE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
            }

            /* Record the filter */
            setFilterForId(myName, myBucket);
        }

        /* Return the table */
        return myTable;
    }

    /**
     * Create a delayed category table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedLoan(final MetisHTMLTable pParent,
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportMarketGrowth.java 202
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportPortfolioView.java 168
checkPortfolioGrowth(myTotals);

        /* Return the document */
        return theBuilder.getDocument();
    }

    @Override
    public MetisHTMLTable createDelayedTable(final DelayedTable pTable) {
        /* Access the source */
        final Object mySource = pTable.getSource();
        if (mySource instanceof MoneyWiseAnalysisPortfolioBucket) {
            final MoneyWiseAnalysisPortfolioBucket mySourceBucket = (MoneyWiseAnalysisPortfolioBucket) mySource;
            return createDelayedPortfolio(pTable.getParent(), mySourceBucket);
        }

        /* Return the null table */
        return null;
    }

    /**
     * Create a delayed portfolio table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedPortfolio(final MetisHTMLTable pParent,
                                                  final MoneyWiseAnalysisPortfolioBucket pSource) {
        /* Access the securities */
        final MoneyWiseAnalysisSecurityBucketList mySecurities = pSource.getSecurities();

        /* Create a new table */
        final MetisHTMLTable myTable = theBuilder.createEmbeddedTable(pParent);

        /* Loop through the Security Buckets */
        final Iterator<MoneyWiseAnalysisSecurityBucket> myIterator = mySecurities.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseAnalysisSecurityBucket myBucket = myIterator.next();

            /* Access bucket name */
            final String myName = myBucket.getSecurityName();
            String myFullName = myBucket.getDecoratedName();
            myFullName = myFullName.replace(':', '-');

            /* Access values */
            final MoneyWiseAnalysisSecurityValues myValues = myBucket.getValues();
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportAssetGains.java 139
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportMarketGrowth.java 180
theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisSecurityAttr.REALISEDGAINS));

        /* Return the document */
        return theBuilder.getDocument();
    }

    @Override
    public MetisHTMLTable createDelayedTable(final DelayedTable pTable) {
        /* Access the source */
        final Object mySource = pTable.getSource();
        if (mySource instanceof MoneyWiseXAnalysisPortfolioBucket) {
            final MoneyWiseXAnalysisPortfolioBucket mySourceBucket = (MoneyWiseXAnalysisPortfolioBucket) mySource;
            return createDelayedPortfolio(pTable.getParent(), mySourceBucket);
        }

        /* Return the null table */
        return null;
    }

    /**
     * Create a delayed portfolio table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedPortfolio(final MetisHTMLTable pParent,
                                                  final MoneyWiseXAnalysisPortfolioBucket pSource) {
        /* Access the securities and portfolio */
        final MoneyWiseXAnalysisSecurityBucketList mySecurities = pSource.getSecurities();

        /* Create a new table */
        final MetisHTMLTable myTable = theBuilder.createEmbeddedTable(pParent);

        /* Loop through the Security Buckets */
        final Iterator<MoneyWiseXAnalysisSecurityBucket> myIterator = mySecurities.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseXAnalysisSecurityBucket myBucket = myIterator.next();

            /* Access bucket name */
            final String myName = myBucket.getSecurityName();
            String myFullName = myBucket.getDecoratedName();
            myFullName = myFullName.replace(':', '-');

            /* Access values */
            final MoneyWiseXAnalysisSecurityValues myValues = myBucket.getValues();
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportMarketGrowth.java 180
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportPortfolioView.java 168
theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisSecurityAttr.MARKETPROFIT));
        //checkPortfolioGrowth(myTotals);

        /* Return the document */
        return theBuilder.getDocument();
    }

    @Override
    public MetisHTMLTable createDelayedTable(final DelayedTable pTable) {
        /* Access the source */
        final Object mySource = pTable.getSource();
        if (mySource instanceof MoneyWiseXAnalysisPortfolioBucket) {
            final MoneyWiseXAnalysisPortfolioBucket mySourceBucket = (MoneyWiseXAnalysisPortfolioBucket) mySource;
            return createDelayedPortfolio(pTable.getParent(), mySourceBucket);
        }

        /* Return the null table */
        return null;
    }

    /**
     * Create a delayed portfolio table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedPortfolio(final MetisHTMLTable pParent,
                                                  final MoneyWiseXAnalysisPortfolioBucket pSource) {
        /* Access the securities */
        final MoneyWiseXAnalysisSecurityBucketList mySecurities = pSource.getSecurities();

        /* Create a new table */
        final MetisHTMLTable myTable = theBuilder.createEmbeddedTable(pParent);

        /* Loop through the Security Buckets */
        final Iterator<MoneyWiseXAnalysisSecurityBucket> myIterator = mySecurities.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseXAnalysisSecurityBucket myBucket = myIterator.next();

            /* Access bucket name */
            final String myName = myBucket.getSecurityName();
            String myFullName = myBucket.getDecoratedName();
            myFullName = myFullName.replace(':', '-');

            /* Access values */
            final MoneyWiseXAnalysisSecurityValues myValues = myBucket.getValues();
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportAssetGains.java 139
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportMarketGrowth.java 202
theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.REALISEDGAINS));

        /* Return the document */
        return theBuilder.getDocument();
    }

    @Override
    public MetisHTMLTable createDelayedTable(final DelayedTable pTable) {
        /* Access the source */
        final Object mySource = pTable.getSource();
        if (mySource instanceof MoneyWiseAnalysisPortfolioBucket) {
            final MoneyWiseAnalysisPortfolioBucket mySourceBucket = (MoneyWiseAnalysisPortfolioBucket) mySource;
            return createDelayedPortfolio(pTable.getParent(), mySourceBucket);
        }

        /* Return the null table */
        return null;
    }

    /**
     * Create a delayed portfolio table.
     * @param pParent the parent table
     * @param pSource the source bucket
     * @return the new document fragment
     */
    private MetisHTMLTable createDelayedPortfolio(final MetisHTMLTable pParent,
                                                  final MoneyWiseAnalysisPortfolioBucket pSource) {
        /* Access the securities and portfolio */
        final MoneyWiseAnalysisSecurityBucketList mySecurities = pSource.getSecurities();

        /* Create a new table */
        final MetisHTMLTable myTable = theBuilder.createEmbeddedTable(pParent);

        /* Loop through the Security Buckets */
        final Iterator<MoneyWiseAnalysisSecurityBucket> myIterator = mySecurities.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseAnalysisSecurityBucket myBucket = myIterator.next();

            /* Access bucket name */
            final String myName = myBucket.getSecurityName();
            String myFullName = myBucket.getDecoratedName();
            myFullName = myFullName.replace(':', '-');

            /* Access values */
            final MoneyWiseAnalysisSecurityValues myValues = myBucket.getValues();
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 529
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 707
if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.BALANCE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.BALANCE));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                    theBuilder.makeStretchedValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
            }
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUEDELTA));

            /* Record the filter */
            setFilterForId(myName, myBucket);
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 591
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 707
if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.BALANCE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.BALANCE));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                    theBuilder.makeStretchedValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
            }
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUEDELTA));

            /* Record the filter */
            setFilterForId(myName, myBucket);
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 653
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 707
if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.BALANCE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.BALANCE));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                    theBuilder.makeStretchedValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
                theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
            }
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUEDELTA));

            /* Record the filter */
            setFilterForId(myName, myBucket);
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 529
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 707
if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.FOREIGNVALUE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.FOREIGNVALUE));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                    theBuilder.makeStretchedValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
            }
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUEDELTA));

            /* Record the filter */
            setFilterForId(myName, myBucket);
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 591
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 707
if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.FOREIGNVALUE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.FOREIGNVALUE));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                    theBuilder.makeStretchedValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
            }
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUEDELTA));

            /* Record the filter */
            setFilterForId(myName, myBucket);
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 653
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 707
if (myBucket.isForeignCurrency()) {
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.FOREIGNVALUE));
                    theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.FOREIGNVALUE));
                    theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                } else {
                    theBuilder.makeStretchedValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                    theBuilder.makeStretchedValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                }
            } else {
                theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
                theBuilder.makeValueCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
            }
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUEDELTA));

            /* Record the filter */
            setFilterForId(myName, myBucket);
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXAnalysisSelect.java 59
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseAnalysisSelect.java 59
implements OceanusEventProvider<PrometheusDataEvent>, TethysUIComponent {
    /**
     * Text for DateRange Label.
     */
    private static final String NLS_RANGE = MoneyWiseUIResource.ANALYSIS_PROMPT_RANGE.getValue();

    /**
     * Text for Filter Label.
     */
    private static final String NLS_FILTER = MoneyWiseUIResource.ANALYSIS_PROMPT_FILTER.getValue();

    /**
     * Text for FilterType Label.
     */
    private static final String NLS_FILTERTYPE = MoneyWiseUIResource.ANALYSIS_PROMPT_FILTERTYPE.getValue();

    /**
     * Text for ColumnSet Label.
     */
    private static final String NLS_COLUMNS = MoneyWiseUIResource.ANALYSIS_PROMPT_COLUMNSET.getValue();

    /**
     * Text for BucketType Label.
     */
    private static final String NLS_BUCKET = MoneyWiseUIResource.ANALYSIS_PROMPT_BUCKET.getValue();

    /**
     * Text for Title.
     */
    private static final String NLS_TITLE = MoneyWiseUIResource.ANALYSIS_TITLE.getValue();

    /**
     * Text for NoBucket.
     */
    private static final String NLS_NONE = MoneyWiseUIResource.ANALYSIS_BUCKET_NONE.getValue();

    /**
     * Text for Title.
     */
    private static final String NLS_FILTERTITLE = MoneyWiseUIResource.ANALYSIS_FILTER_TITLE.getValue();

    /**
     * Text for Box Title.
     */
    private static final String NLS_RANGETITLE = OceanusDateResource.TITLE_BOX.getValue();

    /**
     * The Event Manager.
     */
    private final OceanusEventManager<PrometheusDataEvent> theEventManager;

    /**
     * View.
     */
    private final MoneyWiseView theView;

    /**
     * Panel.
     */
    private final TethysUIBoxPaneManager thePanel;

    /**
     * Range Button.
     */
    private final TethysUIButton theRangeButton;

    /**
     * Filter Button.
     */
    private final TethysUIButton theFilterButton;

    /**
     * Filter Type Button.
     */
    private final TethysUIScrollButtonManager<MoneyWiseXAnalysisType> theFilterTypeButton;
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseDeposit.java 510
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseLoan.java 473
setInfoSetValue(MoneyWiseAccountInfoClass.MATURITY, pMaturity);
    }

    /**
     * Set a new SortCode.
     * @param pSortCode the new sort code
     * @throws OceanusException on error
     */
    public void setSortCode(final char[] pSortCode) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.SORTCODE, pSortCode);
    }

    /**
     * Set a new Account.
     * @param pAccount the new account
     * @throws OceanusException on error
     */
    public void setAccount(final char[] pAccount) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.ACCOUNT, pAccount);
    }

    /**
     * Set a new Reference.
     * @param pReference the new reference
     * @throws OceanusException on error
     */
    public void setReference(final char[] pReference) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.REFERENCE, pReference);
    }

    /**
     * Set a new Notes.
     * @param pNotes the new notes
     * @throws OceanusException on error
     */
    public void setNotes(final char[] pNotes) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.NOTES, pNotes);
    }

    /**
     * Set a new opening balance.
     * @param pBalance the new opening balance
     * @throws OceanusException on error
     */
    public void setOpeningBalance(final OceanusMoney pBalance) throws OceanusException {
        setInfoSetValue(MoneyWiseAccountInfoClass.OPENINGBALANCE, pBalance);
    }

    /**
     * Set an infoSet value.
     * @param pInfoClass the class of info to set
     * @param pValue the value to set
     * @throws OceanusException on error
     */
    private void setInfoSetValue(final MoneyWiseAccountInfoClass pInfoClass,
                                 final Object pValue) throws OceanusException {
        /* Reject if there is no infoSet */
        if (!hasInfoSet) {
            throw new MoneyWiseLogicException(ERROR_BADINFOSET);
        }

        /* Set the value */
        theInfoSet.setValue(pInfoClass, pValue);
    }

    @Override
    public void adjustClosed() throws OceanusException {
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseSecurityInfoSet.java 224
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateSecurityInfoSet.java 37
: isClassRequired(myClass);
    }

    @Override
    public MetisFieldRequired isClassRequired(final PrometheusDataInfoClass pClass) {
        /* Access details about the Security */
        final MoneyWiseSecurity mySec = getOwner();
        final MoneyWiseSecurityClass myType = mySec.getCategoryClass();

        /* If we have no Type, no class is allowed */
        if (myType == null) {
            return MetisFieldRequired.NOTALLOWED;
        }
        /* Switch on class */
        switch ((MoneyWiseAccountInfoClass) pClass) {
            /* Allowed set */
            case NOTES:
                return MetisFieldRequired.CANEXIST;

            /* Symbol */
            case SYMBOL:
                return myType.needsSymbol()
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;

            /* Region */
            case REGION:
                return myType.needsRegion()
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;

            /* Options */
            case UNDERLYINGSTOCK:
            case OPTIONPRICE:
                return myType.isOption()
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;

            /* Not Allowed */
            case SORTCODE:
            case ACCOUNT:
            case REFERENCE:
            case WEBSITE:
            case CUSTOMERNO:
            case USERID:
            case PASSWORD:
            case MATURITY:
            case OPENINGBALANCE:
            case AUTOEXPENSE:
            case AUTOPAYEE:
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportCapitalGains.java 316
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportCapitalGains.java 310
private void formatValuation(final MoneyWiseXAnalysisSecurityAttr pAttr,
                                 final Object pValue,
                                 final OceanusUnits pUnits,
                                 final OceanusPrice pPrice,
                                 final OceanusRatio pXchangeRate) {
        /* Ensure that we have an attribute table */
        ensureAttrTable();

        /* Format the attribute */
        theBuilder.startRow(theAttrTable);
        theBuilder.makeValueCell(theAttrTable, pAttr);
        theBuilder.makeValueCell(theAttrTable, formatValuation(pUnits, pPrice, pXchangeRate));
        theBuilder.makeValueCell(theAttrTable, pValue);
    }

    /**
     * Format a valuation.
     * @param pUnits the units
     * @param pPrice the price
     * @param pXchangeRate the exchange rate
     * @return the formatted valuation
     */
    private String formatValuation(final OceanusUnits pUnits,
                                   final OceanusPrice pPrice,
                                   final OceanusRatio pXchangeRate) {
        theStringBuilder.setLength(0);
        theStringBuilder.append(theFormatter.formatObject(pUnits));
        theStringBuilder.append('@');
        theStringBuilder.append(theFormatter.formatObject(pPrice));
        if (pXchangeRate != null) {
            theStringBuilder.append('/');
            theStringBuilder.append(theFormatter.formatObject(pXchangeRate));
        }
        return theStringBuilder.toString();
    }

    /**
     * Format a multiplication.
     * @param pAttr the attribute
     * @param pValue the value
     * @param pFirst the first item
     * @param pSecond the second item
     */
    private void formatMultiplication(final MoneyWiseXAnalysisSecurityAttr pAttr,
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseMarketPricesTable.java 363
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseMarketRatesTable.java 347
theTable = new MoneyWiseMarketPricesTable(pView, theEditSet, theError);

            /* Create the action buttons */
            final TethysUIFactory<?> myGuiFactory = pView.getGuiFactory();
            theActionButtons = new PrometheusActionButtons(myGuiFactory, theEditSet);
            theActionButtons.setVisible(false);

            /* Create the header panel */
            final TethysUIPaneFactory myPanes = myGuiFactory.paneFactory();
            final TethysUIBorderPaneManager myHeader = myPanes.newBorderPane();
            myHeader.setCentre(theTable.getSelect());
            myHeader.setNorth(theError);
            myHeader.setEast(theActionButtons);

            /* Create the panel */
            thePanel = myPanes.newBorderPane();
            thePanel.setNorth(myHeader);
            thePanel.setCentre(theTable);

            /* Add listeners */
            theError.getEventRegistrar().addEventListener(e -> handleErrorPane());
            theActionButtons.getEventRegistrar().addEventListener(this::handleActionButtons);
            theTable.getEventRegistrar().addEventListener(e -> notifyChanges());
        }

        @Override
        public TethysUIComponent getUnderlying() {
            return thePanel;
        }

        @Override
        public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXCashAnalysisSelect.java 309
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseCashAnalysisSelect.java 309
final MoneyWiseXAnalysisCashCategoryBucket myBucket = myIterator.next();

            /* Only process low-level items */
            if (myBucket.getAccountCategory().isCategoryClass(MoneyWiseCashCategoryClass.PARENT)) {
                continue;
            }

            /* Determine menu to add to */
            final MoneyWiseCashCategory myParent = myBucket.getAccountCategory().getParentCategory();
            final String myParentName = myParent.getName();
            final TethysUIScrollSubMenu<MoneyWiseCashCategory> myMenu = myMap.computeIfAbsent(myParentName, theCategoryMenu::addSubMenu);

            /* Create a new JMenuItem and add it to the popUp */
            final MoneyWiseCashCategory myCategory = myBucket.getAccountCategory();
            final TethysUIScrollItem<MoneyWiseCashCategory> myItem = myMenu.getSubMenu().addItem(myCategory, myCategory.getSubCategory());

            /* If this is the active category */
            if (myCategory.equals(myCurrent)) {
                /* Record it */
                myActive = myItem;
            }
        }

        /* Ensure active item is visible */
        if (myActive != null) {
            myActive.scrollToItem();
        }
    }

    /**
     * Build Cash menu.
     */
    private void buildCashMenu() {
        /* Reset the popUp menu */
        theCashMenu.removeAllItems();

        /* Access current category and Account */
        final MoneyWiseCashCategory myCategory = theState.getCategory();
        final MoneyWiseXAnalysisCashBucket myCash = theState.getCash();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXDepositAnalysisSelect.java 304
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseDepositAnalysisSelect.java 304
final MoneyWiseXAnalysisDepositCategoryBucket myBucket = myIterator.next();

            /* Only process low-level items */
            if (myBucket.getAccountCategory().isCategoryClass(MoneyWiseDepositCategoryClass.PARENT)) {
                continue;
            }

            /* Determine menu to add to */
            final MoneyWiseDepositCategory myParent = myBucket.getAccountCategory().getParentCategory();
            final String myParentName = myParent.getName();
            final TethysUIScrollSubMenu<MoneyWiseDepositCategory> myMenu = myMap.computeIfAbsent(myParentName, theCategoryMenu::addSubMenu);

            /* Create a new JMenuItem and add it to the popUp */
            final MoneyWiseDepositCategory myCategory = myBucket.getAccountCategory();
            final TethysUIScrollItem<MoneyWiseDepositCategory> myItem = myMenu.getSubMenu().addItem(myCategory, myCategory.getSubCategory());

            /* If this is the active category */
            if (myCategory.equals(myCurrent)) {
                /* Record it */
                myActive = myItem;
            }
        }

        /* Ensure active item is visible */
        if (myActive != null) {
            myActive.scrollToItem();
        }
    }

    /**
     * Build Deposit menu.
     */
    private void buildDepositMenu() {
        /* Reset the popUp menu */
        theDepositMenu.removeAllItems();

        /* Access current category */
        final MoneyWiseDepositCategory myCategory = theState.getCategory();
        final MoneyWiseXAnalysisDepositBucket myDeposit = theState.getDeposit();
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseDeposit.java 208
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseLoan.java 195
? theInfoSet.getValue(MoneyWiseAccountInfoClass.MATURITY, OceanusDate.class)
                : null;
    }

    /**
     * Obtain SortCode.
     * @return the sort code
     */
    public char[] getSortCode() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.SORTCODE, char[].class)
                : null;
    }

    /**
     * Obtain Reference.
     * @return the reference
     */
    public char[] getReference() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.REFERENCE, char[].class)
                : null;
    }

    /**
     * Obtain Account.
     * @return the account
     */
    public char[] getAccount() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.ACCOUNT, char[].class)
                : null;
    }

    /**
     * Obtain Notes.
     * @return the notes
     */
    public char[] getNotes() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.NOTES, char[].class)
                : null;
    }

    @Override
    public OceanusMoney getOpeningBalance() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.OPENINGBALANCE, OceanusMoney.class)
                : null;
    }

    @Override
    public MoneyWiseDepositCategory getCategory() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXPayeeAnalysisSelect.java 94
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWisePayeeAnalysisSelect.java 94
theButton = pFactory.buttonFactory().newScrollButton(MoneyWiseXAnalysisPayeeBucket.class);

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the label */
        final TethysUILabel myLabel = pFactory.controlFactory().newLabel(NLS_PAYEE + TethysUIConstant.STR_COLON);

        /* Define the layout */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.addSpacer();
        thePanel.addNode(myLabel);
        thePanel.addNode(theButton);

        /* Create initial state */
        theState = new MoneyWisePayeeState();
        theState.applyState();

        /* Access the menus */
        thePayeeMenu = theButton.getMenu();

        /* Create the listeners */
        final OceanusEventRegistrar<TethysUIEvent> myRegistrar = theButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewPayee());
        theButton.setMenuConfigurator(e -> buildPayeeMenu());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public MoneyWiseXAnalysisPayeeFilter getFilter() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXPortfolioAnalysisSelect.java 94
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWisePortfolioAnalysisSelect.java 94
thePortButton = pFactory.buttonFactory().newScrollButton(MoneyWiseXAnalysisPortfolioBucket.class);

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the labels */
        final TethysUILabel myPortLabel = pFactory.controlFactory().newLabel(NLS_PORTFOLIO + TethysUIConstant.STR_COLON);

        /* Define the layout */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.addSpacer();
        thePanel.addNode(myPortLabel);
        thePanel.addNode(thePortButton);

        /* Create initial state */
        theState = new MoneyWisePortfolioState();
        theState.applyState();

        /* Access the menus */
        thePortfolioMenu = thePortButton.getMenu();

        /* Create the listeners */
        final OceanusEventRegistrar<TethysUIEvent> myRegistrar = thePortButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewPortfolio());
        thePortButton.setMenuConfigurator(e -> buildPortfolioMenu());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public MoneyWiseXAnalysisPortfolioCashFilter getFilter() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXTransCategoryAnalysisSelect.java 99
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseTransCategoryAnalysisSelect.java 99
theButton = pFactory.buttonFactory().newScrollButton(MoneyWiseXAnalysisTransCategoryBucket.class);

        /* Create the label */
        final TethysUILabel myLabel = pFactory.controlFactory().newLabel(NLS_CATEGORY + TethysUIConstant.STR_COLON);

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Define the layout */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.addSpacer();
        thePanel.addNode(myLabel);
        thePanel.addNode(theButton);

        /* Create initial state */
        theState = new MoneyWiseEventState();
        theState.applyState();

        /* Access the menus */
        theCategoryMenu = theButton.getMenu();

        /* Create the listeners */
        final OceanusEventRegistrar<TethysUIEvent> myRegistrar = theButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewCategory());
        theButton.setMenuConfigurator(e -> buildCategoryMenu());
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public MoneyWiseXAnalysisTransCategoryFilter getFilter() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXTransTagSelect.java 94
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseTransTagSelect.java 94
theTagButton = pFactory.buttonFactory().newScrollButton(MoneyWiseXAnalysisTransTagBucket.class);

        /* Create Event Manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the label */
        final TethysUILabel myTagLabel = pFactory.controlFactory().newLabel(NLS_TAG + TethysUIConstant.STR_COLON);

        /* Define the layout */
        thePanel = pFactory.paneFactory().newHBoxPane();
        thePanel.addSpacer();
        thePanel.addNode(myTagLabel);
        thePanel.addNode(theTagButton);

        /* Create initial state */
        theState = new MoneyWiseTagState();
        theState.applyState();

        /* Create the listener */
        final OceanusEventRegistrar<TethysUIEvent> myRegistrar = theTagButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewTag());
        theTagButton.setMenuConfigurator(e -> buildTagMenu());
        theTagMenu = theTagButton.getMenu();
    }

    @Override
    public TethysUIComponent getUnderlying() {
        return thePanel;
    }

    @Override
    public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
        return theEventManager.getEventRegistrar();
    }

    @Override
    public MoneyWiseXAnalysisTagFilter getFilter() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 269
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 267
theFieldSet.addField(MoneyWiseTransInfoClass.WITHHELD, myWithheld, MoneyWiseXAnalysisEvent::getWithheld);

        /* Set currency */
        myTaxCredit.setDeemedCurrency(() -> getItem().getAccount().getCurrency());
        myEeNatIns.setDeemedCurrency(() -> getItem().getAccount().getCurrency());
        myErNatIns.setDeemedCurrency(() -> getItem().getAccount().getCurrency());
        myBenefit.setDeemedCurrency(() -> getItem().getAccount().getCurrency());
        myWithheld.setDeemedCurrency(() -> getItem().getAccount().getCurrency());
    }

    /**
     * Build securities subPanel.
     * @param pFactory the GUI factory
     */
    private void buildSecuritiesPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_SECURITIES);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUIUnitsEditField myAccountUnits = myFields.newUnitsField();
        final TethysUIUnitsEditField myPartnerUnits = myFields.newUnitsField();
        final TethysUIRatioEditField myDilution = myFields.newRatioField();
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePayeeInfoSet.java 157
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePortfolioInfoSet.java 156
for (MoneyWisePayeeInfo myInfo : this) {
            myInfo.resolveEditSetLinks(pEditSet);
        }
    }

    /**
     * Determine if a field is required.
     * @param pField the infoSet field
     * @return the status
     */
    public MetisFieldRequired isFieldRequired(final MetisDataFieldId pField) {
        final MoneyWiseAccountInfoClass myClass = getClassForField(pField);
        return myClass == null
                ? MetisFieldRequired.NOTALLOWED
                : isClassRequired(myClass);
    }

    @Override
    public MetisFieldRequired isClassRequired(final PrometheusDataInfoClass pClass) {
        /* Switch on class */
        switch ((MoneyWiseAccountInfoClass) pClass) {
            /* Allowed set */
            case NOTES:
            case SORTCODE:
            case ACCOUNT:
            case REFERENCE:
            case WEBSITE:
            case CUSTOMERNO:
            case USERID:
            case PASSWORD:
                return MetisFieldRequired.CANEXIST;

            /* Not allowed */
            case MATURITY:
            case OPENINGBALANCE:
            case AUTOEXPENSE:
            case AUTOPAYEE:
            case SYMBOL:
            case REGION:
            case UNDERLYINGSTOCK:
            case OPTIONPRICE:
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }

    /**
     * Validate the infoSet.
     */
    protected void validate() {
        /* Loop through the classes */
        for (final MoneyWiseAccountInfoClass myClass : MoneyWiseAccountInfoClass.values()) {
            /* Access info for class */
            final MoneyWisePayeeInfo myInfo = getInfo(myClass);
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 309
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 356
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 403
final MoneyWiseDepositCategory myCurr = myBucket.getAccountCategory();
            if (!MetisDataDifference.isEqual(myCurr.getParentCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseXAnalysisAccountValues myValues = myBucket.getValues();
            final MoneyWiseXAnalysisAccountValues myBaseValues = myBucket.getBaseValues();

            /* Create the SubCategory row */
            theBuilder.startRow(myTable);
            theBuilder.makeDelayLinkCell(myTable, myName, myCurr.getSubCategory());
            theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
            theBuilder.makeTotalCell(myTable, myBaseValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));
            theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUEDELTA));

            /* Note the delayed subTable */
            setDelayedTable(myName, myTable, myBucket);
        }

        /* Embed the table correctly */
        theBuilder.embedTable(myTable, pCategory.getName());
    }

    /**
     * Build a category report.
     * @param pParent the table parent
     * @param pCategory the category bucket
     */
    private void makeCashCategoryReport(final MetisHTMLTable pParent,
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 309
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 356
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 403
final MoneyWiseDepositCategory myCurr = myBucket.getAccountCategory();
            if (!MetisDataDifference.isEqual(myCurr.getParentCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseAnalysisAccountValues myValues = myBucket.getValues();
            final MoneyWiseAnalysisAccountValues myBaseValues = myBucket.getBaseValues();

            /* Create the SubCategory row */
            theBuilder.startRow(myTable);
            theBuilder.makeDelayLinkCell(myTable, myName, myCurr.getSubCategory());
            theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
            theBuilder.makeTotalCell(myTable, myBaseValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));
            theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUEDELTA));

            /* Note the delayed subTable */
            setDelayedTable(myName, myTable, myBucket);
        }

        /* Embed the table correctly */
        theBuilder.embedTable(myTable, pCategory.getName());
    }

    /**
     * Build a category report.
     * @param pParent the table parent
     * @param pCategory the category bucket
     */
    private void makeCashCategoryReport(final MetisHTMLTable pParent,
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseLoanDialog.java 125
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWisePortfolioDialog.java 123
myCategoryButton.setMenuConfigurator(c -> buildCategoryMenu(c, getItem()));
        myParentButton.setMenuConfigurator(c -> buildParentMenu(c, getItem()));
        myCurrencyButton.setMenuConfigurator(c -> buildCurrencyMenu(c, getItem()));
        final Map<Boolean, TethysUIIconMapSet<Boolean>> myMapSets = MoneyWiseIcon.configureLockedIconButton(pFactory);
        myClosedButton.setIconMapSet(() -> myMapSets.get(theClosedState));

        /* Configure validation checks */
        myName.setValidator(this::isValidName);
        myDesc.setValidator(this::isValidDesc);
    }

    /**
     * Build account subPanel.
     * @param pFactory the GUI factory
     */
    private void buildAccountPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_ACCOUNT);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUICharArrayEditField mySortCode = myFields.newCharArrayField();
        final TethysUICharArrayEditField myAccount = myFields.newCharArrayField();
        final TethysUICharArrayEditField myReference = myFields.newCharArrayField();
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportCapitalGains.java 423
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportCapitalGains.java 417
private void formatSubtraction(final MoneyWiseXAnalysisSecurityAttr pAttr,
                                   final Object pValue,
                                   final OceanusDecimal pFirst,
                                   final OceanusDecimal pSecond) {
        /* Ensure that we have an attribute table */
        ensureAttrTable();

        /* Format the attribute */
        theBuilder.startRow(theAttrTable);
        theBuilder.makeValueCell(theAttrTable, pAttr);
        theBuilder.makeValueCell(theAttrTable, formatSubtraction(pFirst, pSecond));
        theBuilder.makeValueCell(theAttrTable, pValue);
    }

    /**
     * Format a subtraction.
     * @param pFirst the first item
     * @param pSecond the second item
     * @return the formatted subtraction
     */
    private String formatSubtraction(final OceanusDecimal pFirst,
                                     final OceanusDecimal pSecond) {
        return formatCombination(pFirst, pSecond, '-');
    }

    /**
     * Format a combination.
     * @param pFirst the first item
     * @param pSecond the second item
     * @param pSymbol the symbol
     * @return the formatted combination
     */
    private String formatCombination(final OceanusDecimal pFirst,
                                     final OceanusDecimal pSecond,
                                     final char pSymbol) {
        theStringBuilder.setLength(0);
        theStringBuilder.append(theFormatter.formatObject(pFirst));
        theStringBuilder.append(pSymbol);
        theStringBuilder.append(theFormatter.formatObject(pSecond));
        return theStringBuilder.toString();
    }

    /**
     * Format a Transfer.
     * @param pEvent the event
     * @param pValues the values for the transaction
     */
    private void formatTransfer(final MoneyWiseXAnalysisEvent pEvent,
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseAssetBase.java 442
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseCategoryBase.java 271
return isClosed();
    }

    /**
     * Set name value.
     * @param pValue the value
     * @throws OceanusException on error
     */
    private void setValueName(final String pValue) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_NAME, pValue);
    }

    /**
     * Set name value.
     * @param pBytes the value
     * @throws OceanusException on error
     */
    private void setValueName(final byte[] pBytes) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_NAME, pBytes, String.class);
    }

    /**
     * Set name value.
     * @param pValue the value
     */
    private void setValueName(final PrometheusEncryptedPair pValue) {
        getValues().setUncheckedValue(PrometheusDataResource.DATAITEM_FIELD_NAME, pValue);
    }

    /**
     * Set description value.
     * @param pValue the value
     * @throws OceanusException on error
     */
    private void setValueDesc(final String pValue) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_DESC, pValue);
    }

    /**
     * Set description value.
     * @param pBytes the value
     * @throws OceanusException on error
     */
    private void setValueDesc(final byte[] pBytes) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_DESC, pBytes, String.class);
    }

    /**
     * Set description value.
     * @param pValue the value
     */
    private void setValueDesc(final PrometheusEncryptedPair pValue) {
        getValues().setUncheckedValue(PrometheusDataResource.DATAITEM_FIELD_DESC, pValue);
    }

    /**
     * Set category value.
     * @param pValue the value
     */
    private void setValueCategory(final MoneyWiseAssetCategory pValue) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 369
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 375
final MoneyWiseTransaction myTrans = getItem().getTransaction();
        final boolean bIsReconciled = myTrans.isReconciled();
        final boolean bIsLocked = myTrans.isLocked();

        /* Determine whether the comments field should be visible */
        boolean bShowField = isEditable || myTrans.getComments() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.COMMENTS, bShowField);

        /* Determine whether the reference field should be visible */
        bShowField = isEditable || myTrans.getReference() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.REFERENCE, bShowField);

        /* Determine whether the tags field should be visible */
        bShowField = isEditable || myTrans.getTransactionTags() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.TRANSTAG, bShowField);

        /* Determine whether the partnerAmount field should be visible */
        boolean bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.PARTNERAMOUNT);
        bShowField = bEditField || myTrans.getPartnerAmount() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.PARTNERAMOUNT, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.PARTNERAMOUNT, bEditField);

        /* Determine whether the taxCredit field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.TAXCREDIT);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseAssetBase.java 442
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseRegion.java 195
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransTag.java 195
return isClosed();
    }

    /**
     * Set name value.
     * @param pValue the value
     * @throws OceanusException on error
     */
    private void setValueName(final String pValue) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_NAME, pValue);
    }

    /**
     * Set name value.
     * @param pBytes the value
     * @throws OceanusException on error
     */
    private void setValueName(final byte[] pBytes) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_NAME, pBytes, String.class);
    }

    /**
     * Set name value.
     * @param pValue the value
     */
    private void setValueName(final PrometheusEncryptedPair pValue) {
        getValues().setUncheckedValue(PrometheusDataResource.DATAITEM_FIELD_NAME, pValue);
    }

    /**
     * Set description value.
     * @param pValue the value
     * @throws OceanusException on error
     */
    private void setValueDesc(final String pValue) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_DESC, pValue);
    }

    /**
     * Set description value.
     * @param pBytes the value
     * @throws OceanusException on error
     */
    private void setValueDesc(final byte[] pBytes) throws OceanusException {
        setEncryptedValue(PrometheusDataResource.DATAITEM_FIELD_DESC, pBytes, String.class);
    }

    /**
     * Set description value.
     * @param pValue the value
     */
    private void setValueDesc(final PrometheusEncryptedPair pValue) {
        getValues().setUncheckedValue(PrometheusDataResource.DATAITEM_FIELD_DESC, pValue);
    }
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseCashInfoSet.java 232
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateCashInfoSet.java 58
: isClassRequired(myClass);
    }

    @Override
    public MetisFieldRequired isClassRequired(final PrometheusDataInfoClass pClass) {
        /* Access details about the Cash */
        final MoneyWiseCash myCash = getOwner();
        final MoneyWiseCashCategory myCategory = myCash.getCategory();

        /* If we have no Category, no class is allowed */
        if (myCategory == null) {
            return MetisFieldRequired.NOTALLOWED;
        }

        /* Switch on class */
        switch ((MoneyWiseAccountInfoClass) pClass) {
            /* Allowed set */
            case NOTES:
                return MetisFieldRequired.CANEXIST;

            case OPENINGBALANCE:
                return myCash.isAutoExpense()
                        ? MetisFieldRequired.NOTALLOWED
                        : MetisFieldRequired.CANEXIST;
            case AUTOPAYEE:
            case AUTOEXPENSE:
                return myCash.isAutoExpense()
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;

            /* Disallowed Set */
            case SORTCODE:
            case ACCOUNT:
            case REFERENCE:
            case WEBSITE:
            case CUSTOMERNO:
            case USERID:
            case PASSWORD:
            case MATURITY:
            case SYMBOL:
            case REGION:
            case UNDERLYINGSTOCK:
            case OPTIONPRICE:
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }
File Line
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFPortfolioBuilder.java 696
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFPortfolioBuilder.java 813
final OceanusMoney myOutAmount = new OceanusMoney(myTaxCredit);
            myOutAmount.negate();

            /* If we are using a holding account */
            if (useHoldingAccount) {
                /* Access Holding Account */
                final MoneyWiseQIFAccountEvents myHolding = theFile.registerHoldingAccount(myPortfolio);

                /* Create an event */
                final MoneyWiseQIFEvent myHoldEvent = new MoneyWiseQIFEvent(theFile, pTrans);
                myHoldEvent.recordAmount(new OceanusMoney());
                myHoldEvent.recordPayee(myTaxPayee);

                /* record the splits */
                myHoldEvent.recordSplitRecord(myQPortfolio.getAccount(), myTaxCredit, myPortfolio.getName());
                myHoldEvent.recordSplitRecord(myTaxCategory, myOutAmount, myTaxPayee.getName());

                /* Add to event list */
                myHolding.addEvent(myHoldEvent);

                /* else we can do this properly */
            } else {
                /* Create a tax credit event */
                myEvent = new MoneyWiseQIFPortfolioEvent(theFile, pTrans, MoneyWiseQActionType.CASH);
                myEvent.recordAmount(myOutAmount);
                myEvent.recordPayee(myTaxPayee);
                myEvent.recordCategory(myTaxCategory);

                /* Add to event list */
                myQPortfolio.addEvent(myEvent);
            }
        }
    }
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseCategoryBase.java 152
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseRegion.java 146
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransTag.java 146
return getParentCategory() != null;
        }

        /* Pass call on */
        return super.includeXmlField(pField);
    }

    @Override
    public String getName() {
        return getValues().getValue(PrometheusDataResource.DATAITEM_FIELD_NAME, String.class);
    }

    /**
     * Obtain Encrypted name.
     * @return the bytes
     */
    public byte[] getNameBytes() {
        return getValues().getEncryptedBytes(PrometheusDataResource.DATAITEM_FIELD_NAME);
    }

    /**
     * Obtain Encrypted Name Field.
     * @return the Field
     */
    private PrometheusEncryptedPair getNameField() {
        return getValues().getEncryptedPair(PrometheusDataResource.DATAITEM_FIELD_NAME);
    }

    /**
     * Obtain Description.
     * @return the description
     */
    public String getDesc() {
        return getValues().getValue(PrometheusDataResource.DATAITEM_FIELD_DESC, String.class);
    }

    /**
     * Obtain Encrypted description.
     * @return the bytes
     */
    public byte[] getDescBytes() {
        return getValues().getEncryptedBytes(PrometheusDataResource.DATAITEM_FIELD_DESC);
    }

    /**
     * Obtain Encrypted Description Field.
     * @return the Field
     */
    private PrometheusEncryptedPair getDescField() {
        return getValues().getEncryptedPair(PrometheusDataResource.DATAITEM_FIELD_DESC);
    }
File Line
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFLine.java 962
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFLine.java 1242
myLine = pLine.substring(i + 1);
            }

            /* If the line contains classes */
            if (myLine.contains(QIF_CLASS)) {
                /* drop preceding data */
                final int i = myLine.indexOf(QIF_CLASS);
                myLine = myLine.substring(i + 1);

                /* Build list of classes */
                final String[] myClasses = myLine.split(QIF_CLASSSEP);
                final List<MoneyWiseQIFClass> myList = new ArrayList<>();
                for (String myClass : myClasses) {
                    myList.add(pFile.getClass(myClass));
                }

                /* Return the classes */
                return myList;
            }

            /* Return no classes */
            return null;
        }

        @Override
        public boolean equals(final Object pThat) {
            /* Handle trivial cases */
            if (this == pThat) {
                return true;
            }
            if (pThat == null) {
                return false;
            }

            /* Check class */
            if (!getClass().equals(pThat.getClass())) {
                return false;
            }

            /* Cast correctly */
            final MoneyWiseQIFXferAccountLine<?> myLine = (MoneyWiseQIFXferAccountLine<?>) pThat;
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXCashAnalysisSelect.java 266
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseCashAnalysisSelect.java 266
protected MoneyWiseXAnalysisCashBucket getDefaultCash(final MoneyWiseCashCategory pCategory) {
        return theCash.getDefaultCash(pCategory);
    }

    /**
     * Handle new Category.
     */
    private void handleNewCategory() {
        /* Select the new category */
        if (theState.setCategory(theCatButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Handle new Cash.
     */
    private void handleNewCash() {
        /* Select the new cash */
        if (theState.setCash(theCashButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Build Category menu.
     */
    private void buildCategoryMenu() {
        /* Reset the popUp menu */
        theCategoryMenu.removeAllItems();

        /* Create a simple map for top-level categories */
        final Map<String, TethysUIScrollSubMenu<MoneyWiseCashCategory>> myMap = new HashMap<>();

        /* Record active item */
        final MoneyWiseCashCategory myCurrent = theState.getCategory();
        TethysUIScrollItem<MoneyWiseCashCategory> myActive = null;

        /* Loop through the available category values */
        final Iterator<MoneyWiseXAnalysisCashCategoryBucket> myIterator = theCategories.iterator();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXDepositAnalysisSelect.java 261
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseDepositAnalysisSelect.java 261
protected MoneyWiseXAnalysisDepositBucket getDefaultDeposit(final MoneyWiseDepositCategory pCategory) {
        return theDeposits.getDefaultDeposit(pCategory);
    }

    /**
     * Handle new Category.
     */
    private void handleNewCategory() {
        /* Select the new category */
        if (theState.setCategory(theCatButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Handle new Deposit.
     */
    private void handleNewDeposit() {
        /* Select the new deposit */
        if (theState.setDeposit(theDepositButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Build Category menu.
     */
    private void buildCategoryMenu() {
        /* Reset the popUp menu */
        theCategoryMenu.removeAllItems();

        /* Create a simple map for top-level categories */
        final Map<String, TethysUIScrollSubMenu<MoneyWiseDepositCategory>> myMap = new HashMap<>();

        /* Record active item */
        final MoneyWiseDepositCategory myCurrent = theState.getCategory();
        TethysUIScrollItem<MoneyWiseDepositCategory> myActive = null;

        /* Re-Loop through the available category values */
        final Iterator<MoneyWiseXAnalysisDepositCategoryBucket> myIterator = theCategories.iterator();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXLoanAnalysisSelect.java 261
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseLoanAnalysisSelect.java 261
protected MoneyWiseXAnalysisLoanBucket getDefaultLoan(final MoneyWiseLoanCategory pCategory) {
        return theLoans.getDefaultLoan(pCategory);
    }

    /**
     * Handle new Category.
     */
    private void handleNewCategory() {
        /* Select the new category */
        if (theState.setCategory(theCatButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Handle new Loan.
     */
    private void handleNewLoan() {
        /* Select the new loan */
        if (theState.setLoan(theLoanButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Build Category menu.
     */
    private void buildCategoryMenu() {
        /* Reset the popUp menu */
        theCategoryMenu.removeAllItems();

        /* Create a simple map for top-level categories */
        final Map<String, TethysUIScrollSubMenu<MoneyWiseLoanCategory>> myMap = new HashMap<>();

        /* Record active item */
        final MoneyWiseLoanCategory myCurrent = theState.getCategory();
        TethysUIScrollItem<MoneyWiseLoanCategory> myActive = null;

        /* Re-Loop through the available category values */
        final Iterator<MoneyWiseXAnalysisLoanCategoryBucket> myIterator = theCategories.iterator();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 431
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 455
theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.PARTNERDELTAUNITS, bEditField);

        /* Determine whether the dilution field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.DILUTION);
        bShowField = bEditField || myTrans.getDilution() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.DILUTION, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.DILUTION, bEditField);

        /* Determine whether the returnedAccount field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.RETURNEDCASHACCOUNT);
        bShowField = bEditField || myTrans.getReturnedCashAccount() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.RETURNEDCASHACCOUNT, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.RETURNEDCASHACCOUNT, bEditField);

        /* Determine whether the returnedCash field should be visible */
        bEditField = isEditable && isEditableField(myTrans, MoneyWiseTransInfoClass.RETURNEDCASH);
        bShowField = bEditField || myTrans.getReturnedCash() != null;
        theFieldSet.setFieldVisible(MoneyWiseTransInfoClass.RETURNEDCASH, bShowField);
        theFieldSet.setFieldEditable(MoneyWiseTransInfoClass.RETURNEDCASH, bEditField);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseDepositInfoSet.java 177
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateDepositInfoSet.java 46
: isClassRequired(myClass);
    }

    @Override
    public MetisFieldRequired isClassRequired(final PrometheusDataInfoClass pClass) {
        /* Access details about the Deposit */
        final MoneyWiseDeposit myDeposit = getOwner();
        final MoneyWiseDepositCategory myCategory = myDeposit.getCategory();

        /* If we have no Category, no class is allowed */
        if (myCategory == null) {
            return MetisFieldRequired.NOTALLOWED;
        }
        final MoneyWiseDepositCategoryClass myClass = myCategory.getCategoryTypeClass();

        /* Switch on class */
        switch ((MoneyWiseAccountInfoClass) pClass) {
            /* Allowed set */
            case NOTES:
            case SORTCODE:
            case ACCOUNT:
            case REFERENCE:
            case OPENINGBALANCE:
                return MetisFieldRequired.CANEXIST;

            /* Handle Maturity */
            case MATURITY:
                return myClass.hasMaturity()
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;

            /* Not allowed */
            case AUTOEXPENSE:
            case AUTOPAYEE:
            case WEBSITE:
            case CUSTOMERNO:
            case USERID:
            case PASSWORD:
            case SYMBOL:
            case REGION:
            case UNDERLYINGSTOCK:
            case OPTIONPRICE:
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransInfoSet.java 663
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateTransInfoSet.java 624
}
    }

    /**
     * Determine if AccountDeltaUnits can/mustBe/mustNotBe positive.
     * @param pDir the direction
     * @param pClass the category class
     * @return the status
     */
    public static MetisFieldRequired isAccountUnitsPositive(final MoneyWiseAssetDirection pDir,
                                                            final MoneyWiseTransCategoryClass pClass) {
        switch (pClass) {
            case TRANSFER:
                return pDir.isFrom()
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;
            case UNITSADJUST:
            case STOCKSPLIT:
                return MetisFieldRequired.CANEXIST;
            case INHERITED:
            case DIVIDEND:
            case STOCKRIGHTSISSUE:
                return MetisFieldRequired.MUSTEXIST;
            case STOCKDEMERGER:
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }

    /**
     * Determine if PartnerDeltaUnits can/mustBe/mustNotBe positive.
     * @param pDir the direction
     * @param pClass the category class
     * @return the status
     */
    public static MetisFieldRequired isPartnerUnitsPositive(final MoneyWiseAssetDirection pDir,
                                                            final MoneyWiseTransCategoryClass pClass) {
        switch (pClass) {
            case TRANSFER:
                return pDir.isTo()
                        ? MetisFieldRequired.MUSTEXIST
                        : MetisFieldRequired.NOTALLOWED;
            case STOCKDEMERGER:
            case SECURITYREPLACE:
            case STOCKTAKEOVER:
            case STOCKRIGHTSISSUE:
                return MetisFieldRequired.MUSTEXIST;
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseAccountPanel.java 595
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseCategoryPanel.java 589
theEventManager.fireEvent(PrometheusDataEvent.ADJUSTVISIBILITY);
    }

    /**
     * handleErrorPane.
     */
    private void handleErrorPane() {
        /* Determine whether we have an error */
        final boolean isError = theError.hasError();

        /* Hide selection panel on error */
        theSelectPanel.setVisible(!isError);

        /* Lock card panel */
        theCardPanel.setEnabled(!isError);

        /* Lock Action Buttons */
        theActionButtons.setEnabled(!isError);
    }

    /**
     * handleSelection.
     */
    private void handleSelection() {
        /* Cancel any editing */
        cancelEditing();

        /* Show selected panel */
        showPanel(theSelectButton.getValue());
    }

    /**
     * handle Action Buttons.
     * @param pEvent the event
     */
    private void handleActionButtons(final OceanusEvent<PrometheusUIEvent> pEvent) {
        /* Cancel editing */
        cancelEditing();

        /* Perform the command */
        theEditSet.processCommand(pEvent.getEventId(), theError);
    }

    /**
     * handle GoTo Event.
     * @param pEvent the event
     */
    private void handleGoToEvent(final OceanusEvent<PrometheusDataEvent> pEvent) {
        /* Access details */
        @SuppressWarnings("unchecked")
        final PrometheusGoToEvent<MoneyWiseGoToId> myEvent = pEvent.getDetails(PrometheusGoToEvent.class);

        /* Access event and obtain details */
        switch (myEvent.getId()) {
            /* Pass through the event */
            case STATEMENT:
            case CATEGORY:
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseRegionTable.java 110
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseTransTagTable.java 110
.setOnCommit((r, v) -> updateField(MoneyWiseRegion::setDescription, r, v));

        /* Create the Active column */
        final TethysUIIconMapSet<MetisAction> myActionMapSet = MetisIcon.configureStatusIconButton(pView.getGuiFactory());
        myTable.declareIconColumn(PrometheusDataResource.DATAITEM_TOUCH, MetisAction.class)
                .setIconMapSet(r -> myActionMapSet)
                .setCellValueFactory(r -> r.isActive() ? MetisAction.ACTIVE : MetisAction.DELETE)
                .setName(MoneyWiseUIResource.STATICDATA_ACTIVE.getValue())
                .setEditable(true)
                .setCellEditable(r -> !r.isActive())
                .setColumnWidth(WIDTH_ICON)
                .setOnCommit((r, v) -> updateField(this::deleteRow, r, v));

        /* Add listeners */
        myNewButton.getEventRegistrar().addEventListener(e -> addNewItem());
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 116
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 116
final MoneyWiseXAnalysisPortfolioBucketList myPortfolios = theAnalysis.getPortfolios();
        final OceanusDateRange myDateRange = theAnalysis.getDateRange();

        /* Create the totals */
        final OceanusMoney myTotal = new OceanusMoney();
        final OceanusMoney myBase = new OceanusMoney();
        final OceanusMoney myDelta = new OceanusMoney();

        /* Start the report */
        final Element myBody = theBuilder.startReport();
        theBuilder.makeTitle(myBody, TEXT_TITLE, theFormatter.formatObject(myDateRange));

        /* Initialise the table */
        final MetisHTMLTable myTable = theBuilder.startTable(myBody);
        theBuilder.startTotalRow(myTable);
        theBuilder.makeTitleCell(myTable);
        theBuilder.makeTitleCell(myTable, theFormatter.formatObject(myDateRange.getEnd()));
        theBuilder.makeTitleCell(myTable, theFormatter.formatObject(myDateRange.getStart()));
        theBuilder.makeTitleCell(myTable, MoneyWiseXReportBuilder.TEXT_PROFIT);
File Line
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFBuilder.java 957
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFBuilder.java 995
protected void processCashRecovery(final MoneyWisePayee pPayee,
                                       final MoneyWiseCash pCash,
                                       final MoneyWiseTransaction pTrans) {
        /* Access the Payee details */
        final MoneyWiseQIFPayee myPayee = theFile.registerPayee(pPayee);

        /* Access the Category details */
        final MoneyWiseQIFEventCategory myCategory = theFile.registerCategory(pTrans.getCategory());
        final MoneyWiseQIFEventCategory myAutoCategory = theFile.registerCategory(pCash.getAutoExpense());

        /* Access the Account details */
        final MoneyWiseQIFAccountEvents myAccount = theFile.registerAccount(pCash);

        /* Obtain classes */
        final List<MoneyWiseQIFClass> myList = getTransactionClasses(pTrans);

        /* Access the amount */
        final OceanusMoney myInAmount = pTrans.getAmount();
        final OceanusMoney myOutAmount = new OceanusMoney(myInAmount);
        myOutAmount.negate();

        /* Create a new event */
        final MoneyWiseQIFEvent myEvent = new MoneyWiseQIFEvent(theFile, pTrans);
        myEvent.recordAmount(new OceanusMoney());
        myEvent.recordPayee(myPayee);
        myEvent.recordSplitRecord(myCategory, myList, myInAmount, myPayee.getName());
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXAnalysisSelect.java 366
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseAnalysisSelect.java 366
final MoneyWiseXStatementSelect mySelect = new MoneyWiseXStatementSelect(theRangeSelect, new MoneyWiseXAnalysisAllFilter());
        selectStatement(mySelect);

        /* Access the menus */
        theTypeMenu = theFilterTypeButton.getMenu();
        theBucketMenu = theBucketButton.getMenu();
        theColumnMenu = theColumnButton.getMenu();

        /* Create the listeners */
        OceanusEventRegistrar<TethysUIEvent> myRegistrar = theFilterTypeButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleFilterType());
        theFilterTypeButton.setMenuConfigurator(e -> buildAnalysisTypeMenu());
        myRegistrar = theBucketButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewBucket());
        theBucketButton.setMenuConfigurator(e -> buildBucketMenu());
        myRegistrar = theColumnButton.getEventRegistrar();
        myRegistrar.addEventListener(TethysUIEvent.NEWVALUE, e -> handleNewColumns());
        theColumnButton.setMenuConfigurator(e -> buildColumnsMenu());
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseDepositDialog.java 148
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseLoanDialog.java 122
theFieldSet.addField(MoneyWiseBasicResource.ASSET_CLOSED, myClosedButton, MoneyWiseDeposit::isClosed);

        /* Configure the menuBuilders */
        myCategoryButton.setMenuConfigurator(c -> buildCategoryMenu(c, getItem()));
        myParentButton.setMenuConfigurator(c -> buildParentMenu(c, getItem()));
        myCurrencyButton.setMenuConfigurator(c -> buildCurrencyMenu(c, getItem()));
        final Map<Boolean, TethysUIIconMapSet<Boolean>> myMapSets = MoneyWiseIcon.configureLockedIconButton(pFactory);
        myClosedButton.setIconMapSet(() -> myMapSets.get(theClosedState));

        /* Configure validation checks */
        myName.setValidator(this::isValidName);
        myDesc.setValidator(this::isValidDesc);
     }

    /**
     * Build account subPanel.
     * @param pFactory the GUI factory
     */
    private void buildAccountPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_ACCOUNT);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUIDateButtonField myMaturity = myFields.newDateField();
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseDepositRateTable.java 108
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseSecurityPriceTable.java 103
.setOnCommit((r, v) -> updateField(MoneyWiseDepositRate::setEndDate, r, v));

        /* Create the Active column */
        final TethysUIIconMapSet<MetisAction> myActionMapSet = MetisIcon.configureStatusIconButton(pView.getGuiFactory());
        theActiveColumn = myTable.declareIconColumn(PrometheusDataResource.DATAITEM_TOUCH, MetisAction.class)
                .setIconMapSet(r -> myActionMapSet)
                .setCellValueFactory(r -> r.isActive() ? MetisAction.ACTIVE : MetisAction.DELETE)
                .setName(MoneyWiseUIResource.STATICDATA_ACTIVE.getValue())
                .setEditable(true)
                .setCellEditable(r -> !r.isActive())
                .setColumnWidth(WIDTH_ICON)
                .setOnCommit((r, v) -> updateField(this::deleteRow, r, v));
    }

    @Override
    public void refreshData() {
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseAssetBase.java 388
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseCategoryBase.java 157
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseRegion.java 151
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransTag.java 151
}

    @Override
    public String getName() {
        return getValues().getValue(PrometheusDataResource.DATAITEM_FIELD_NAME, String.class);
    }

    /**
     * Obtain Encrypted name.
     * @return the bytes
     */
    public byte[] getNameBytes() {
        return getValues().getEncryptedBytes(PrometheusDataResource.DATAITEM_FIELD_NAME);
    }

    /**
     * Obtain Encrypted Name Field.
     * @return the Field
     */
    private PrometheusEncryptedPair getNameField() {
        return getValues().getEncryptedPair(PrometheusDataResource.DATAITEM_FIELD_NAME);
    }

    /**
     * Obtain Description.
     * @return the description
     */
    public String getDesc() {
        return getValues().getValue(PrometheusDataResource.DATAITEM_FIELD_DESC, String.class);
    }

    /**
     * Obtain Encrypted description.
     * @return the bytes
     */
    public byte[] getDescBytes() {
        return getValues().getEncryptedBytes(PrometheusDataResource.DATAITEM_FIELD_DESC);
    }

    /**
     * Obtain Encrypted Description Field.
     * @return the Field
     */
    private PrometheusEncryptedPair getDescField() {
        return getValues().getEncryptedPair(PrometheusDataResource.DATAITEM_FIELD_DESC);
    }
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXPortfolioAnalysisSelect.java 222
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXSecurityAnalysisSelect.java 271
if (theState.setPortfolio(thePortButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Build Portfolio menu.
     */
    private void buildPortfolioMenu() {
        /* Reset the popUp menu */
        thePortfolioMenu.removeAllItems();

        /* Record active item */
        TethysUIScrollItem<MoneyWiseXAnalysisPortfolioBucket> myActive = null;
        final MoneyWiseXAnalysisPortfolioBucket myCurr = theState.getPortfolio();

        /* Loop through the available portfolio values */
        final Iterator<MoneyWiseXAnalysisPortfolioBucket> myIterator = thePortfolios.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseXAnalysisPortfolioBucket myBucket = myIterator.next();

            /* Create a new MenuItem and add it to the popUp */
            final TethysUIScrollItem<MoneyWiseXAnalysisPortfolioBucket> myItem = thePortfolioMenu.addItem(myBucket);

            /* If this is the active bucket */
            if (myBucket.equals(myCurr)) {
                /* Record it */
                myActive = myItem;
            }
        }

        /* Ensure active item is visible */
        if (myActive != null) {
            myActive.scrollToItem();
        }
    }

    /**
     * SavePoint values.
     */
    private final class MoneyWisePortfolioState {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXReportTab.java 132
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseReportTab.java 125
final TethysUIFactory<?> myFactory = pView.getGuiFactory();

        /* Create the event manager */
        theEventManager = new OceanusEventManager<>();

        /* Create the Panel */
        final TethysUIPaneFactory myPanes = myFactory.paneFactory();
        thePanel = myPanes.newBorderPane();

        /* Create the top level debug entry for this view */
        final MetisViewerManager myDataMgr = theView.getViewerManager();
        final MetisViewerEntry mySection = theView.getViewerEntry(PrometheusViewerEntryId.VIEW);
        final MetisViewerEntry myReport = myDataMgr.newEntry(mySection, NLS_DATAENTRY);
        theSpotEntry = myDataMgr.newEntry(myReport, PrometheusViewerEntryId.ANALYSIS.toString());
        theSpotEntry.setVisible(false);

        /* Create the HTML Pane */
        theHTMLPane = myFactory.controlFactory().newHTMLManager();

        /* Create Report Manager */
        theManager = new MetisReportManager<>(new MetisReportHTMLBuilder(pView.getDataFormatter()));

        /* Create the report builder */
        theBuilder = new MoneyWiseXReportBuilder(theManager);
File Line
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWisePortfolioAnalysisSelect.java 222
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseSecurityAnalysisSelect.java 271
if (theState.setPortfolio(thePortButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Build Portfolio menu.
     */
    private void buildPortfolioMenu() {
        /* Reset the popUp menu */
        thePortfolioMenu.removeAllItems();

        /* Record active item */
        TethysUIScrollItem<MoneyWiseAnalysisPortfolioBucket> myActive = null;
        final MoneyWiseAnalysisPortfolioBucket myCurr = theState.getPortfolio();

        /* Loop through the available portfolio values */
        final Iterator<MoneyWiseAnalysisPortfolioBucket> myIterator = thePortfolios.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseAnalysisPortfolioBucket myBucket = myIterator.next();

            /* Create a new MenuItem and add it to the popUp */
            final TethysUIScrollItem<MoneyWiseAnalysisPortfolioBucket> myItem = thePortfolioMenu.addItem(myBucket);

            /* If this is the active bucket */
            if (myBucket.equals(myCurr)) {
                /* Record it */
                myActive = myItem;
            }
        }

        /* Ensure active item is visible */
        if (myActive != null) {
            myActive.scrollToItem();
        }
    }

    /**
     * SavePoint values.
     */
    private final class MoneyWisePortfolioState {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXTaxBasisAnalysisSelect.java 237
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseTaxBasisAnalysisSelect.java 237
MoneyWiseXAnalysisTaxBasisBucket myTaxBasis = myFilter.getBucket();

            /* Obtain equivalent bucket */
            myTaxBasis = theTaxBases.getMatchingBasis(myTaxBasis);

            /* Set the taxBasis */
            theState.setTheTaxBasis(myTaxBasis);
            theState.setDateRange(myFilter.getDateRange());
            theState.applyState();
        }
    }

    /**
     * Handle new Basis.
     */
    private void handleNewBasis() {
        /* Select the new taxBasis */
        if (theState.setTaxBasis(theBasisButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Handle new Account.
     */
    private void handleNewAccount() {
        /* Select the new account */
        if (theState.setTaxBasis(theAccountButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Build Basis menu.
     */
    private void buildBasisMenu() {
        /* Reset the popUp menu */
        theTaxMenu.removeAllItems();

        /* Record active item */
        TethysUIScrollItem<MoneyWiseXAnalysisTaxBasisBucket> myActive = null;
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseDeposit.java 208
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePayee.java 228
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePortfolio.java 241
? theInfoSet.getValue(MoneyWiseAccountInfoClass.MATURITY, OceanusDate.class)
                : null;
    }

    /**
     * Obtain SortCode.
     * @return the sort code
     */
    public char[] getSortCode() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.SORTCODE, char[].class)
                : null;
    }

    /**
     * Obtain Reference.
     * @return the reference
     */
    public char[] getReference() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.REFERENCE, char[].class)
                : null;
    }

    /**
     * Obtain Account.
     * @return the account
     */
    public char[] getAccount() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.ACCOUNT, char[].class)
                : null;
    }

    /**
     * Obtain Notes.
     * @return the notes
     */
    public char[] getNotes() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.NOTES, char[].class)
                : null;
    }

    @Override
    public OceanusMoney getOpeningBalance() {
File Line
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableCash.java 93
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableDeposit.java 97
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableLoan.java 97
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableSecurity.java 97
myTableDef.setIntegerValue(iField, pItem.getCategoryId());
        } else if (MoneyWiseStaticDataType.CURRENCY.equals(iField)) {
            myTableDef.setIntegerValue(iField, pItem.getAssetCurrencyId());
        } else if (PrometheusDataResource.DATAITEM_FIELD_NAME.equals(iField)) {
            myTableDef.setBinaryValue(iField, pItem.getNameBytes());
        } else if (PrometheusDataResource.DATAITEM_FIELD_DESC.equals(iField)) {
            myTableDef.setBinaryValue(iField, pItem.getDescBytes());
        } else if (MoneyWiseBasicResource.ASSET_CLOSED.equals(iField)) {
            myTableDef.setBooleanValue(iField, pItem.isClosed());
        } else {
            super.setFieldValue(pItem, iField);
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseCashDialog.java 447
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseDepositDialog.java 463
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseLoanDialog.java 406
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWisePortfolioDialog.java 423
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseSecurityDialog.java 577
final MoneyWiseCurrency myCurr = pCash.getAssetCurrency();
        TethysUIScrollItem<MoneyWiseCurrency> myActive = null;

        /* Access Currencies */
        final MoneyWiseCurrencyList myCurrencies = getDataList(MoneyWiseStaticDataType.CURRENCY, MoneyWiseCurrencyList.class);

        /* Loop through the AccountCurrencies */
        final Iterator<MoneyWiseCurrency> myIterator = myCurrencies.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseCurrency myCurrency = myIterator.next();

            /* Ignore deleted or disabled */
            final boolean bIgnore = myCurrency.isDeleted() || !myCurrency.getEnabled();
            if (bIgnore) {
                continue;
            }

            /* Create a new action for the currency */
            final TethysUIScrollItem<MoneyWiseCurrency> myItem = pMenu.addItem(myCurrency);

            /* If this is the active currency */
            if (myCurrency.equals(myCurr)) {
                /* Record it */
                myActive = myItem;
            }
        }

        /* Ensure active item is visible */
        if (myActive != null) {
            myActive.scrollToItem();
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWisePayeeDialog.java 116
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWisePortfolioDialog.java 125
myTypeButton.setMenuConfigurator(c -> buildPayeeTypeMenu(c, getItem()));
        final Map<Boolean, TethysUIIconMapSet<Boolean>> myMapSets = MoneyWiseIcon.configureLockedIconButton(pFactory);
        myClosedButton.setIconMapSet(() -> myMapSets.get(theClosedState));

        /* Configure validation checks */
        myName.setValidator(this::isValidName);
        myDesc.setValidator(this::isValidDesc);
     }

    /**
     * Build account subPanel.
     * @param pFactory the GUI factory
     */
    private void buildAccountPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_ACCOUNT);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUICharArrayEditField mySortCode = myFields.newCharArrayField();
        final TethysUICharArrayEditField myAccount = myFields.newCharArrayField();
        final TethysUICharArrayEditField myReference = myFields.newCharArrayField();

        /* Assign the fields to the panel */
        theFieldSet.addField(MoneyWiseAccountInfoClass.SORTCODE, mySortCode, MoneyWisePayee::getSortCode);
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXCashAnalysisSelect.java 174
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseCashAnalysisSelect.java 174
public MoneyWiseXAnalysisCashFilter getFilter() {
        return theState.getFilter();
    }

    @Override
    public boolean isAvailable() {
        return theCash != null
                && !theCash.isEmpty();
    }

    /**
     * Create SavePoint.
     */
    protected void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWiseCashState(theState);
    }

    /**
     * Restore SavePoint.
     */
    protected void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWiseCashState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* Determine whether there are any Accounts to select */
        final boolean csAvailable = bEnabled && isAvailable();

        /* Pass call on to buttons */
        theCashButton.setEnabled(csAvailable);
        theCatButton.setEnabled(csAvailable);
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Set analysis.
     * @param pAnalysis the analysis.
     */
    public void setAnalysis(final MoneyWiseXAnalysis pAnalysis) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXSecurityAnalysisSelect.java 163
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseSecurityAnalysisSelect.java 163
public MoneyWiseXAnalysisSecurityFilter getFilter() {
        return theState.getFilter();
    }

    @Override
    public boolean isAvailable() {
        return thePortfolios != null
                && !thePortfolios.isEmpty();
    }

    /**
     * Create SavePoint.
     */
    public void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWiseSecurityState(theState);
    }

    /**
     * Restore SavePoint.
     */
    public void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWiseSecurityState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* Determine whether there are any Securities to select */
        final boolean secAvailable = bEnabled && isAvailable();

        /* Pass call on to buttons */
        theSecButton.setEnabled(secAvailable);
        thePortButton.setEnabled(secAvailable);
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Set analysis.
     * @param pAnalysis the analysis.
     */
    public void setAnalysis(final MoneyWiseXAnalysis pAnalysis) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXSecurityAnalysisSelect.java 246
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseSecurityAnalysisSelect.java 246
final MoneyWiseXAnalysisPortfolioBucket myPortfolio = thePortfolios.getMatchingPortfolio(mySecurity.getPortfolio());

            /* Set the security */
            theState.setTheSecurity(myPortfolio, mySecurity);
            theState.setDateRange(myFilter.getDateRange());
            theState.applyState();
        }
    }

    /**
     * Handle new Portfolio.
     */
    private void handleNewPortfolio() {
        /* Select the new portfolio */
        if (theState.setPortfolio(thePortButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Handle new Security.
     */
    private void handleNewSecurity() {
        /* Select the new security */
        if (theState.setSecurity(theSecButton.getValue())) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Build Portfolio menu.
     */
    private void buildPortfolioMenu() {
        /* Reset the popUp menu */
        thePortfolioMenu.removeAllItems();

        /* Record active item */
        TethysUIScrollItem<MoneyWiseXAnalysisPortfolioBucket> myActive = null;
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 238
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 235
theFieldSet.addField(MoneyWiseTransInfoClass.TRANSTAG, myTagButton, MoneyWiseXAnalysisEvent::getTransactionTags);

        /* Configure the tag button */
        myTagButton.setSelectables(this::buildTransactionTags);

        /* Set currency */
        myAmount.setDeemedCurrency(() -> getItem().getPartner().getCurrency());
    }

    /**
     * Build tax subPanel.
     * @param pFactory the GUI factory
     */
    private void buildTaxPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_TAXES);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUIMoneyEditField myTaxCredit = myFields.newMoneyField();
        final TethysUIMoneyEditField myEeNatIns = myFields.newMoneyField();
        final TethysUIMoneyEditField myErNatIns = myFields.newMoneyField();
        final TethysUIMoneyEditField myBenefit = myFields.newMoneyField();
        final TethysUIMoneyEditField myWithheld = myFields.newMoneyField();
        final TethysUIIntegerEditField myYears = myFields.newIntegerField();

        /* Assign the fields to the panel */
        theFieldSet.addField(MoneyWiseTransInfoClass.TAXCREDIT, myTaxCredit, MoneyWiseXAnalysisEvent::getTaxCredit);
File Line
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetLoan.java 148
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetPortfolio.java 167
final String myType = pView.getRowCellByIndex(pRow, ++iAdjust).getString();

        /* Skip class */
        ++iAdjust;

        /* Handle closed which may be missing */
        PrometheusSheetCell myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
        Boolean isClosed = Boolean.FALSE;
        if (myCell != null) {
            isClosed = myCell.getBoolean();
        }

        /* Access Parent account */
        final String myParent = pView.getRowCellByIndex(pRow, ++iAdjust).getString();

        /* Skip alias, portfolio, maturity, openingBalance, symbol and region columns */
        ++iAdjust;
        ++iAdjust;
        ++iAdjust;
        ++iAdjust;
        ++iAdjust;
        ++iAdjust;

        /* Handle currency which may be missing */
        myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
        MoneyWiseCurrency myCurrency = pData.getReportingCurrency();
        if (myCell != null) {
            final String myCurrName = myCell.getString();
            myCurrency = pData.getAccountCurrencies().findItemByName(myCurrName);
        }

        /* Build data values */
        final PrometheusDataValues myValues = new PrometheusDataValues(MoneyWiseLoan.OBJECT_NAME);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseLoan.java 195
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePayee.java 228
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePortfolio.java 241
return theInfoSet != null ? theInfoSet.getFieldValue(pFieldId) : null;
    }

    /**
     * Obtain SortCode.
     * @return the sort code
     */
    public char[] getSortCode() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.SORTCODE, char[].class)
                : null;
    }

    /**
     * Obtain Reference.
     * @return the reference
     */
    public char[] getReference() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.REFERENCE, char[].class)
                : null;
    }

    /**
     * Obtain Account.
     * @return the account
     */
    public char[] getAccount() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.ACCOUNT, char[].class)
                : null;
    }

    /**
     * Obtain Notes.
     * @return the notes
     */
    public char[] getNotes() {
        return hasInfoSet
                ? theInfoSet.getValue(MoneyWiseAccountInfoClass.NOTES, char[].class)
                : null;
    }

    @Override
    public OceanusMoney getOpeningBalance() {
File Line
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateTransDefaults.java 641
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateTransDefaults.java 682
private MoneyWiseSecurityHolding getDefaultHolding(final MoneyWiseTransCategory pCategory) {
        /* Access Portfolios and Holdings Map */
        final MoneyWisePortfolioList myPortfolios = theEditSet.getDataList(MoneyWiseBasicDataType.PORTFOLIO, MoneyWisePortfolioList.class);
        final MoneyWiseSecurityHoldingMap myMap = myPortfolios.getSecurityHoldingsMap();

        /* Loop through the Portfolios */
        final Iterator<MoneyWisePortfolio> myPortIterator = myPortfolios.iterator();
        while (myPortIterator.hasNext()) {
            final MoneyWisePortfolio myPortfolio = myPortIterator.next();

            /* Ignore deleted or closed */
            if (myPortfolio.isDeleted() || myPortfolio.isClosed()) {
                continue;
            }

            /* Look for existing holdings */
            final Iterator<MoneyWiseSecurityHolding> myExistIterator = myMap.existingIterator(myPortfolio);
            if (myExistIterator != null) {
                /* Loop through them */
                while (myExistIterator.hasNext()) {
                    final MoneyWiseSecurityHolding myHolding = myExistIterator.next();

                    /* Check whether the asset is allowable for the combination */
                    if (theValidator.isValidCategory(myHolding, pCategory)) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 357
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 362
.setOnCommit((r, v) -> updateField(MoneyWiseXAnalysisEvent::setPartnerAmount, r, v));

        /* Create the debit column */
        myTable.declareRawDecimalColumn(MoneyWiseTransDataId.DEBIT)
                .setCellValueFactory(this::getFilteredDebit)
                .setEditable(false)
                .setColumnWidth(WIDTH_MONEY);

        /* Create the credit column */
        myTable.declareRawDecimalColumn(MoneyWiseTransDataId.CREDIT)
                .setCellValueFactory(this::getFilteredCredit)
                .setEditable(false)
                .setColumnWidth(WIDTH_MONEY);

        /* Create the balance column */
        myTable.declareRawDecimalColumn(MoneyWiseTransDataId.BALANCE)
                .setCellValueFactory(this::getFilteredBalance)
                .setEditable(false)
                .setColumnWidth(WIDTH_MONEY);

        /* Create the Active column */
        final TethysUIIconMapSet<MetisAction> myActionMapSet = MetisIcon.configureStatusIconButton(myGuiFactory);
        myTable.declareIconColumn(PrometheusDataResource.DATAITEM_TOUCH, MetisAction.class)
                .setIconMapSet(r -> myActionMapSet)
                .setCellValueFactory(MoneyWiseXEventTable::getFilteredAction)
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportNetWorth.java 313
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportNetWorth.java 358
final MoneyWiseDepositCategory myCurr = myBucket.getAccountCategory();
            if (!myBucket.isActive()
                    || !MetisDataDifference.isEqual(myCurr.getParentCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseXAnalysisAccountValues myValues = myBucket.getValues();

            /* Create the SubCategory row */
            theBuilder.startRow(myTable);
            theBuilder.makeDelayLinkCell(myTable, myName, myCurr.getSubCategory());
            theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));

            /* Note the delayed subTable */
            setDelayedTable(myName, myTable, myBucket);
        }

        /* Embed the table correctly */
        theBuilder.embedTable(myTable, pCategory.getName());
    }

    /**
     * Build a category report.
     * @param pParent the table parent
     * @param pCategory the category bucket
     */
    private void makeCategoryReport(final MetisHTMLTable pParent,
                                    final MoneyWiseXAnalysisCashCategoryBucket pCategory) {
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportResource.java 30
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportResource.java 30
public enum MoneyWiseXReportResource implements OceanusBundleId {
    /**
     * NetWorth ReportType.
     */
    TYPE_NETWORTH("Type.NetWorth"),

    /**
     * BalanceSheet ReportType.
     */
    TYPE_BALANCESHEET("Type.BalanceSheet"),

    /**
     * CashFlow ReportType.
     */
    TYPE_CASHFLOW("Type.CashFlow"),

    /**
     * IncomeExpense ReportType.
     */
    TYPE_INCEXP("Type.IncExp"),

    /**
     * Portfolio ReportType.
     */
    TYPE_PORTFOLIO("Type.Portfolio"),

    /**
     * MarketGrowth ReportType.
     */
    TYPE_MARKET("Type.Market"),

    /**
     * TaxBasis ReportType.
     */
    TYPE_TAXBASIS("Type.TaxBasis"),

    /**
     * TaxCalc ReportType.
     */
    TYPE_TAXCALC("Type.TaxCalc"),

    /**
     * AssetGains ReportType.
     */
    TYPE_ASSETGAINS("Type.AssetGains"),

    /**
     * CapitalGains ReportType.
     */
    TYPE_CAPITALGAINS("Type.CapitalGains"),

    /**
     * NetWorth Title.
     */
    NETWORTH_TITLE("NetWorth.Title"),

    /**
     * NetWorth Asset.
     */
    NETWORTH_ASSET("NetWorth.Asset"),

    /**
     * BalanceSheet Title.
     */
    BALANCESHEET_TITLE("BalanceSheet.Title"),

    /**
     * CashFlow Title.
     */
    CASHFLOW_TITLE("CashFlow.Title"),

    /**
     * Income/Expense Title.
     */
    INCEXP_TITLE("IncExp.Title"),

    /**
     * Portfolio Title.
     */
    PORTFOLIO_TITLE("Portfolio.Title"),

    /**
     * MarketGrowth Title.
     */
    MARKETGROWTH_TITLE("MarketGrowth.Title"),

    /**
     * MarketGrowth BaseValue.
     */
    MARKETGROWTH_BASE("MarketGrowth.Base"),

    /**
     * AssetGains Title.
     */
    ASSETGAINS_TITLE("AssetGains.Title"),

    /**
     * CapitalGains Title.
     */
    CAPITALGAINS_TITLE("CapitalGains.Title"),

    /**
     * TaxBasis Title.
     */
    TAXBASIS_TITLE("TaxBasis.Title"),

    /**
     * TaxCalc Title.
     */
    TAXCALC_TITLE("TaxCalc.Title");

    /**
     * The Report Map.
     */
    private static final Map<MoneyWiseXReportType, OceanusBundleId> REPORT_MAP = buildReportMap();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXAnalysisSelect.java 1239
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseAnalysisSelect.java 1259
private void setFilter(final MoneyWiseXAnalysisFilter<?, ?> pFilter) {
            theFilter = pFilter;
        }

        /**
         * Apply the State.
         */
        private void applyState() {
            /* Adjust the lock-down */
            setEnabled(true);
            theRangeButton.setText(theRange.toString());
            theFilterButton.setText((theFilter == null)
                    ? null
                    : theFilter.getName());
            theFilterTypeButton.setValue(theType);
            theBucketButton.setValue(theBucket);
            theColumnButton.setValue(theColumns);
            showColumns(showColumns);
        }

        /**
         * Show Columns.
         * @param pShow true/false
         */
        private void showColumns(final boolean pShow) {
            /* Show columns */
            theColumnLabel.setVisible(pShow);
            theColumnButton.setVisible(pShow);

            /* Hide buckets */
            theBucketLabel.setVisible(!pShow);
            theBucketButton.setVisible(!pShow);

            /* Record details */
            showColumns = pShow;
        }
    }

    /**
     * The Statement Select class.
     */
    public static final class MoneyWiseXStatementSelect {
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportNetWorth.java 313
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportNetWorth.java 358
final MoneyWiseDepositCategory myCurr = myBucket.getAccountCategory();
            if (!myBucket.isActive()
                    || !MetisDataDifference.isEqual(myCurr.getParentCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseAnalysisAccountValues myValues = myBucket.getValues();

            /* Create the SubCategory row */
            theBuilder.startRow(myTable);
            theBuilder.makeDelayLinkCell(myTable, myName, myCurr.getSubCategory());
            theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));

            /* Note the delayed subTable */
            setDelayedTable(myName, myTable, myBucket);
        }

        /* Embed the table correctly */
        theBuilder.embedTable(myTable, pCategory.getName());
    }

    /**
     * Build a category report.
     * @param pParent the table parent
     * @param pCategory the category bucket
     */
    private void makeCategoryReport(final MetisHTMLTable pParent,
                                    final MoneyWiseAnalysisCashCategoryBucket pCategory) {
File Line
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFPortfolioBuilder.java 1224
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFPortfolioBuilder.java 1365
final MoneyWiseQIFAccountEvents myTarget = theFile.registerAccount(pTarget);

            /* Obtain classes */
            final List<MoneyWiseQIFClass> myList = theBuilder.getTransactionClasses(pTrans);

            /* Create an XOut event */
            MoneyWiseQIFPortfolioEvent myEvent = new MoneyWiseQIFPortfolioEvent(theFile, pTrans, MoneyWiseQActionType.XOUT);
            myEvent.recordAmount(myAmount);
            myEvent.recordPayee(theBuilder.buildXferToPayee(pTarget));
            myEvent.recordXfer(myTarget.getAccount(), myList, myAmount);

            /* Add to event list */
            mySource.addEvent(myEvent);

            /* Create an XIn event */
            myEvent = new MoneyWiseQIFPortfolioEvent(theFile, pTrans, MoneyWiseQActionType.XIN);
            myEvent.recordAmount(myAmount);
            myEvent.recordPayee(theBuilder.buildXferFromPayee(pSource));
            myEvent.recordXfer(mySource.getAccount(), myList, myAmount);

            /* Add to event list */
            myTarget.addEvent(myEvent);
        }
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportBalanceSheet.java 762
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportNetWorth.java 782
setFilterForId(myFullName, myBucket);
        }

        /* Return the table */
        return myTable;
    }

    @Override
    public MoneyWiseXAnalysisFilter<?, ?> processFilter(final Object pSource) {
        /* If this is a DepositBucket */
        if (pSource instanceof MoneyWiseXAnalysisDepositBucket) {
            /* Create the new filter */
            return new MoneyWiseXAnalysisDepositFilter((MoneyWiseXAnalysisDepositBucket) pSource);
        }
        /* If this is a CashBucket */
        if (pSource instanceof MoneyWiseXAnalysisCashBucket) {
            /* Create the new filter */
            return new MoneyWiseXAnalysisCashFilter((MoneyWiseXAnalysisCashBucket) pSource);
        }
        /* If this is a LoanBucket */
        if (pSource instanceof MoneyWiseXAnalysisLoanBucket) {
            /* Create the new filter */
            return new MoneyWiseXAnalysisLoanFilter((MoneyWiseXAnalysisLoanBucket) pSource);
        }
        /* If this is a SecurityBucket */
        if (pSource instanceof MoneyWiseXAnalysisSecurityBucket) {
            /* Create the new filter */
            return new MoneyWiseXAnalysisSecurityFilter((MoneyWiseXAnalysisSecurityBucket) pSource);
        }
        /* If this is a PortfolioBucket */
        if (pSource instanceof MoneyWiseXAnalysisPortfolioBucket) {
            /* Create the new filter */
            return new MoneyWiseXAnalysisPortfolioCashFilter((MoneyWiseXAnalysisPortfolioBucket) pSource);
        }
        return null;
    }
}
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 965
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 973
myTable.getColumn(MoneyWiseTransInfoClass.RETURNEDCASH).setVisible(false);
     }


    /**
     * Analysis Header class.
     */
    private static class AnalysisHeader
            extends MoneyWiseTransaction {
        /**
         * Analysis Header Id.
         */
        static final int ID_VALUE = 1;

        /**
         * Constructor.
         * @param pList the Transaction list
         */
        protected AnalysisHeader(final MoneyWiseTransactionList pList) {
            super(pList);
            setHeader(true);
            setIndexedId(ID_VALUE);
        }
    }

    /**
     * Transaction DataIds.
     */
    private enum MoneyWiseTransDataId
            implements MetisDataFieldId {
        /**
         * Debit.
         */
        DEBIT(MoneyWiseUIResource.STATEMENT_COLUMN_DEBIT),

        /**
         * Credit.
         */
        CREDIT(MoneyWiseUIResource.STATEMENT_COLUMN_CREDIT),

        /**
         * Balance.
         */
        BALANCE(MoneyWiseUIResource.STATEMENT_COLUMN_BALANCE);

        /**
         * The Value.
         */
        private final String theValue;

        /**
         * Constructor.
         * @param pKeyName the key name
         */
        MoneyWiseTransDataId(final MetisDataFieldId pKeyName) {
            theValue = pKeyName.getId();
        }

        @Override
        public String getId() {
            return theValue;
        }

        @Override
        public String toString() {
            return getId();
        }
    }

    /**
     * Transaction Panel.
     */
    public static class MoneyWiseXStatementPanel
File Line
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableDeposit.java 77
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableLoan.java 77
net\sourceforge\joceanus\moneywise\database\MoneyWiseTablePortfolio.java 77
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableSecurity.java 77
final PrometheusDataValues myValues = getRowValues(MoneyWiseDeposit.OBJECT_NAME);
        myValues.addValue(PrometheusDataResource.DATAITEM_FIELD_NAME, myTableDef.getBinaryValue(PrometheusDataResource.DATAITEM_FIELD_NAME));
        myValues.addValue(PrometheusDataResource.DATAITEM_FIELD_DESC, myTableDef.getBinaryValue(PrometheusDataResource.DATAITEM_FIELD_DESC));
        myValues.addValue(MoneyWiseBasicResource.CATEGORY_NAME, myTableDef.getIntegerValue(MoneyWiseBasicResource.CATEGORY_NAME));
        myValues.addValue(MoneyWiseBasicResource.ASSET_PARENT, myTableDef.getIntegerValue(MoneyWiseBasicResource.ASSET_PARENT));
        myValues.addValue(MoneyWiseStaticDataType.CURRENCY, myTableDef.getIntegerValue(MoneyWiseStaticDataType.CURRENCY));
        myValues.addValue(MoneyWiseBasicResource.ASSET_CLOSED, myTableDef.getBooleanValue(MoneyWiseBasicResource.ASSET_CLOSED));

        /* Return the values */
        return myValues;
    }

    @Override
    protected void setFieldValue(final MoneyWiseDeposit pItem,
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportBalanceSheet.java 762
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportNetWorth.java 782
setFilterForId(myFullName, myBucket);
        }

        /* Return the table */
        return myTable;
    }

    @Override
    public MoneyWiseAnalysisFilter<?, ?> processFilter(final Object pSource) {
        /* If this is a DepositBucket */
        if (pSource instanceof MoneyWiseAnalysisDepositBucket) {
            /* Create the new filter */
            return new MoneyWiseAnalysisDepositFilter((MoneyWiseAnalysisDepositBucket) pSource);
        }
        /* If this is a CashBucket */
        if (pSource instanceof MoneyWiseAnalysisCashBucket) {
            /* Create the new filter */
            return new MoneyWiseAnalysisCashFilter((MoneyWiseAnalysisCashBucket) pSource);
        }
        /* If this is a LoanBucket */
        if (pSource instanceof MoneyWiseAnalysisLoanBucket) {
            /* Create the new filter */
            return new MoneyWiseAnalysisLoanFilter((MoneyWiseAnalysisLoanBucket) pSource);
        }
        /* If this is a SecurityBucket */
        if (pSource instanceof MoneyWiseAnalysisSecurityBucket) {
            /* Create the new filter */
            return new MoneyWiseAnalysisSecurityFilter((MoneyWiseAnalysisSecurityBucket) pSource);
        }
        /* If this is a PortfolioBucket */
        if (pSource instanceof MoneyWiseAnalysisPortfolioBucket) {
            /* Create the new filter */
            return new MoneyWiseAnalysisPortfolioCashFilter((MoneyWiseAnalysisPortfolioBucket) pSource);
        }
        return null;
    }
}
File Line
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetDeposit.java 144
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetLoan.java 141
protected static void processDeposit(final MoneyWiseArchiveLoader pLoader,
                                         final MoneyWiseDataSet pData,
                                         final PrometheusSheetView pView,
                                         final PrometheusSheetRow pRow) throws OceanusException {
        /* Access name and type */
        int iAdjust = -1;
        final String myName = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
        final String myType = pView.getRowCellByIndex(pRow, ++iAdjust).getString();

        /* Skip class */
        ++iAdjust;

        /* Handle closed which may be missing */
        PrometheusSheetCell myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
        Boolean isClosed = Boolean.FALSE;
        if (myCell != null) {
            isClosed = myCell.getBoolean();
        }

        /* Access Parent account */
        final String myParent = pView.getRowCellByIndex(pRow, ++iAdjust).getString();

        /* Skip alias and portfolio columns */
        ++iAdjust;
        ++iAdjust;
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseDepositDialog.java 151
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWisePortfolioDialog.java 123
myCategoryButton.setMenuConfigurator(c -> buildCategoryMenu(c, getItem()));
        myParentButton.setMenuConfigurator(c -> buildParentMenu(c, getItem()));
        myCurrencyButton.setMenuConfigurator(c -> buildCurrencyMenu(c, getItem()));
        final Map<Boolean, TethysUIIconMapSet<Boolean>> myMapSets = MoneyWiseIcon.configureLockedIconButton(pFactory);
        myClosedButton.setIconMapSet(() -> myMapSets.get(theClosedState));

        /* Configure validation checks */
        myName.setValidator(this::isValidName);
        myDesc.setValidator(this::isValidDesc);
     }

    /**
     * Build account subPanel.
     * @param pFactory the GUI factory
     */
    private void buildAccountPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_ACCOUNT);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUIDateButtonField myMaturity = myFields.newDateField();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXPortfolioAnalysisSelect.java 132
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWisePortfolioAnalysisSelect.java 132
public MoneyWiseXAnalysisPortfolioCashFilter getFilter() {
        return theState.getFilter();
    }

    @Override
    public boolean isAvailable() {
        return thePortfolios != null
                && !thePortfolios.isEmpty();
    }

    /**
     * Create SavePoint.
     */
    public void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWisePortfolioState(theState);
    }

    /**
     * Restore SavePoint.
     */
    public void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWisePortfolioState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* Determine whether there are any portfolios to select */
        final boolean portAvailable = bEnabled && isAvailable();

        /* Pass call on to buttons */
        thePortButton.setEnabled(portAvailable);
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Set analysis.
     * @param pAnalysis the analysis.
     */
    public void setAnalysis(final MoneyWiseXAnalysis pAnalysis) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXTransTagSelect.java 130
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseTransTagSelect.java 130
public MoneyWiseXAnalysisTagFilter getFilter() {
        return theState.getFilter();
    }

    @Override
    public boolean isAvailable() {
        return theTags != null
                && !theTags.isEmpty();
    }

    /**
     * Create SavePoint.
     */
    protected void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWiseTagState(theState);
    }

    /**
     * Restore SavePoint.
     */
    protected void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWiseTagState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* Determine whether there are any Accounts to select */
        final boolean csAvailable = bEnabled && isAvailable();

        /* Pass call on to buttons */
        theTagButton.setEnabled(csAvailable);
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Set analysis.
     * @param pAnalysis the analysis.
     */
    public void setAnalysis(final MoneyWiseXAnalysis pAnalysis) {
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseAccountPanel.java 182
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseCategoryPanel.java 174
MoneyWiseAccountPanel(final MoneyWiseView pView) {
        /* Store details */
        theView = pView;

        /* Access GUI Factory */
        final TethysUIFactory<?> myFactory = pView.getGuiFactory();
        final MetisViewerManager myViewer = pView.getViewerManager();

        /* Create the event manager */
        theEventManager = new OceanusEventManager<>();

        /* Build the Update set */
        theEditSet = new PrometheusEditSet(pView);

        /* Create the Panel */
        final TethysUIPaneFactory myPanes = myFactory.paneFactory();
        thePanel = myPanes.newBorderPane();

        /* Create the top level viewer entry for this view */
        final MetisViewerEntry mySection = pView.getViewerEntry(PrometheusViewerEntryId.MAINTENANCE);
        theViewerEntry = myViewer.newEntry(mySection, NLS_DATAENTRY);
        theViewerEntry.setTreeObject(theEditSet);

        /* Create the error panel */
        theError = pView.getToolkit().getToolkit().newErrorPanel(theViewerEntry);

        /* Create the action buttons panel */
        theActionButtons = new PrometheusActionButtons(myFactory, theEditSet);
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportPortfolioView.java 110
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportPortfolioView.java 110
final MoneyWiseXAnalysisPortfolioBucket myTotals = myPortfolios.getTotals();
        final OceanusDate myDate = pAnalysis.getDateRange().getEnd();

        /* Start the report */
        final Element myBody = theBuilder.startReport();
        theBuilder.makeTitle(myBody, TEXT_TITLE, theFormatter.formatObject(myDate));

        /* Initialise the table */
        final MetisHTMLTable myTable = theBuilder.startTable(myBody);
        theBuilder.startHdrRow(myTable);
        theBuilder.makeTitleCell(myTable);
        theBuilder.makeTitleCell(myTable, TEXT_VALUE);
        theBuilder.makeTitleCell(myTable, TEXT_COST);
        theBuilder.makeTitleCell(myTable, TEXT_GAINS);
        theBuilder.makeTitleCell(myTable, TEXT_DIVIDEND);
        theBuilder.makeTitleCell(myTable, TEXT_ADJUST);
        theBuilder.makeTitleCell(myTable, MoneyWiseXReportBuilder.TEXT_PROFIT);
File Line
net\sourceforge\joceanus\moneywise\tax\uk\MoneyWiseUKCapitalScheme.java 46
net\sourceforge\joceanus\moneywise\tax\uk\MoneyWiseUKRoomRentalScheme.java 36
OceanusMoney myRemaining = adjustForAllowance(pConfig.getCapitalAllowance(), pAmount);

        /* If we have any gains left */
        if (myRemaining.isNonZero()) {
            /* Adjust the basic allowance */
            myRemaining = super.adjustAllowances(pConfig, myRemaining);
        }

        /* Return unallocated income */
        return myRemaining;
    }

    @Override
    protected OceanusMoney getAmountInAllowance(final MoneyWiseUKTaxConfig pConfig,
                                                final OceanusMoney pAmount) {
        /* Obtain the amount covered by the capital allowance */
        OceanusMoney myAmount = getAmountInBand(pConfig.getCapitalAllowance(), pAmount);

        /* If we have income left over */
        if (myAmount.compareTo(pAmount) < 0) {
            /* Calculate remaining amount */
            final OceanusMoney myRemaining = new OceanusMoney(pAmount);
            myRemaining.subtractAmount(myAmount);

            /* Calculate the amount covered by basic allowance */
            final OceanusMoney myXtra = super.getAmountInAllowance(pConfig, myRemaining);

            /* Determine the total amount covered by the allowance */
            myAmount = new OceanusMoney(myAmount);
            myAmount.addAmount(myXtra);
        }

        /* return the amount */
        return myAmount;
    }
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXTaxBasisAnalysisSelect.java 441
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseTaxBasisAnalysisSelect.java 441
theFilter = new MoneyWiseXAnalysisTaxBasisFilter(theBasis);
                    theFilter.setDateRange(theDateRange);
                } else {
                    theFilter = null;
                }
            }
        }

        /**
         * Set the dateRange.
         * @param pRange the dateRange
         */
        private void setDateRange(final OceanusDateRange pRange) {
            /* Store the dateRange */
            theDateRange = pRange;
            if (theFilter != null) {
                theFilter.setDateRange(theDateRange);
            }
        }

        /**
         * Apply the State.
         */
        private void applyState() {
            /* Adjust the lock-down */
            setEnabled(true);
            theBasisButton.setValue(theBasis);
            if (theAccount == null) {
                theAccountButton.setValue(null, NLS_ALL);
            } else {
                theAccountButton.setValue(theAccount, theAccount.getSimpleName());
            }
            theAccountButton.setEnabled((theBasis != null) && theBasis.hasAccounts());
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableCashCategory.java 91
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableDepositCategory.java 91
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableLoanCategory.java 91
net\sourceforge\joceanus\moneywise\database\MoneyWiseTableTransCategory.java 91
if (MoneyWiseStaticDataType.CASHTYPE.equals(iField)) {
            myTableDef.setIntegerValue(iField, pItem.getCategoryTypeId());
        } else if (PrometheusDataResource.DATAGROUP_PARENT.equals(iField)) {
            myTableDef.setIntegerValue(iField, pItem.getParentCategoryId());
        } else if (PrometheusDataResource.DATAITEM_FIELD_NAME.equals(iField)) {
            myTableDef.setBinaryValue(iField, pItem.getNameBytes());
        } else if (PrometheusDataResource.DATAITEM_FIELD_DESC.equals(iField)) {
            myTableDef.setBinaryValue(iField, pItem.getDescBytes());
        } else {
            super.setFieldValue(pItem, iField);
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFLine.java 1005
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFLine.java 1438
if (!getLineType().equals(myLine.getLineType())) {
                return false;
            }

            /* Check account */
            if (!theAccount.equals(myLine.getAccount())) {
                return false;
            }

            /* Check classes */
            final List<MoneyWiseQIFClass> myClasses = myLine.getClassList();
            if (theClasses == null) {
                return myClasses == null;
            } else if (myClasses == null) {
                return true;
            }
            return theClasses.equals(myClasses);
        }

        @Override
        public int hashCode() {
            int myResult = MoneyWiseQIFFile.HASH_BASE * getLineType().hashCode();
            if (theClasses != null) {
                myResult += theClasses.hashCode();
                myResult *= MoneyWiseQIFFile.HASH_BASE;
            }
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseDepositDialog.java 123
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseLoanDialog.java 97
});
    }

    /**
     * Build Main subPanel.
     * @param pFactory the GUI factory
     */
    private void buildMainPanel(final TethysUIFactory<?> pFactory) {
        /* Create the text fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUIStringEditField myName = myFields.newStringField();
        final TethysUIStringEditField myDesc = myFields.newStringField();

        /* Create the buttons */
        final TethysUIScrollButtonField<MoneyWiseAssetCategory> myCategoryButton = myFields.newScrollField(MoneyWiseAssetCategory.class);
        final TethysUIScrollButtonField<MoneyWisePayee> myParentButton = myFields.newScrollField(MoneyWisePayee.class);
        final TethysUIScrollButtonField<MoneyWiseCurrency> myCurrencyButton = myFields.newScrollField(MoneyWiseCurrency.class);
        final TethysUIIconButtonField<Boolean> myClosedButton = myFields.newIconField(Boolean.class);

        /* Assign the fields to the panel */
        theFieldSet.addField(PrometheusDataResource.DATAITEM_FIELD_NAME, myName, MoneyWiseDeposit::getName);
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseLoanDialog.java 127
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWisePayeeDialog.java 116
myCurrencyButton.setMenuConfigurator(c -> buildCurrencyMenu(c, getItem()));
        final Map<Boolean, TethysUIIconMapSet<Boolean>> myMapSets = MoneyWiseIcon.configureLockedIconButton(pFactory);
        myClosedButton.setIconMapSet(() -> myMapSets.get(theClosedState));

        /* Configure validation checks */
        myName.setValidator(this::isValidName);
        myDesc.setValidator(this::isValidDesc);
    }

    /**
     * Build account subPanel.
     * @param pFactory the GUI factory
     */
    private void buildAccountPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_ACCOUNT);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUICharArrayEditField mySortCode = myFields.newCharArrayField();
        final TethysUICharArrayEditField myAccount = myFields.newCharArrayField();
        final TethysUICharArrayEditField myReference = myFields.newCharArrayField();
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWisePortfolioDialog.java 95
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseSecurityDialog.java 122
buildNotesPanel(pFactory);
    }

    /**
     * Build Main subPanel.
     * @param pFactory the GUI factory
     */
    private void buildMainPanel(final TethysUIFactory<?> pFactory) {
        /* Create the text fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUIStringEditField myName = myFields.newStringField();
        final TethysUIStringEditField myDesc = myFields.newStringField();

        /* Create the buttons */
        final TethysUIScrollButtonField<MoneyWiseAssetCategory> myTypeButton = myFields.newScrollField(MoneyWiseAssetCategory.class);
        final TethysUIScrollButtonField<MoneyWisePayee> myParentButton = myFields.newScrollField(MoneyWisePayee.class);
        final TethysUIScrollButtonField<MoneyWiseCurrency> myCurrencyButton = myFields.newScrollField(MoneyWiseCurrency.class);
        final TethysUIIconButtonField<Boolean> myClosedButton = myFields.newIconField(Boolean.class);

        /* Assign the fields to the panel */
        theFieldSet.addField(PrometheusDataResource.DATAITEM_FIELD_NAME, myName, MoneyWisePortfolio::getName);
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportNetWorth.java 313
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportNetWorth.java 403
final MoneyWiseDepositCategory myCurr = myBucket.getAccountCategory();
            if (!myBucket.isActive()
                    || !MetisDataDifference.isEqual(myCurr.getParentCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseXAnalysisAccountValues myValues = myBucket.getValues();

            /* Create the SubCategory row */
            theBuilder.startRow(myTable);
            theBuilder.makeDelayLinkCell(myTable, myName, myCurr.getSubCategory());
            theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisAccountAttr.VALUATION));

            /* Note the delayed subTable */
            setDelayedTable(myName, myTable, myBucket);
        }

        /* Embed the table correctly */
        theBuilder.embedTable(myTable, pCategory.getName());
    }

    /**
     * Build a category report.
     * @param pParent the table parent
     * @param pCategory the category bucket
     */
    private void makeCategoryReport(final MetisHTMLTable pParent,
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportNetWorth.java 313
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportNetWorth.java 403
final MoneyWiseDepositCategory myCurr = myBucket.getAccountCategory();
            if (!myBucket.isActive()
                    || !MetisDataDifference.isEqual(myCurr.getParentCategory(), myCategory)) {
                continue;
            }

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseAnalysisAccountValues myValues = myBucket.getValues();

            /* Create the SubCategory row */
            theBuilder.startRow(myTable);
            theBuilder.makeDelayLinkCell(myTable, myName, myCurr.getSubCategory());
            theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisAccountAttr.VALUATION));

            /* Note the delayed subTable */
            setDelayedTable(myName, myTable, myBucket);
        }

        /* Embed the table correctly */
        theBuilder.embedTable(myTable, pCategory.getName());
    }

    /**
     * Build a category report.
     * @param pParent the table parent
     * @param pCategory the category bucket
     */
    private void makeCategoryReport(final MetisHTMLTable pParent,
File Line
net\sourceforge\joceanus\moneywise\ui\base\MoneyWiseCategoryTable.java 145
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseStaticTable.java 144
.setOnCommit((r, v) -> updateField(MoneyWiseCategoryBase::setDescription, r, v));

        /* Create the Active column */
        final TethysUIIconMapSet<MetisAction> myActionMapSet = MetisIcon.configureStatusIconButton(myGuiFactory);
        myTable.declareIconColumn(PrometheusDataResource.DATAITEM_TOUCH, MetisAction.class)
                .setIconMapSet(r -> myActionMapSet)
                .setCellValueFactory(r -> r.isActive() ? MetisAction.ACTIVE : MetisAction.DELETE)
                .setName(MoneyWiseUIResource.STATICDATA_ACTIVE.getValue())
                .setEditable(true)
                .setCellEditable(r -> !r.isActive())
                .setColumnWidth(WIDTH_ICON)
                .setOnCommit((r, v) -> updateField(this::deleteRow, r, v));
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseCashCategoryTable.java 152
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseDepositCategoryTable.java 152
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseLoanCategoryTable.java 152
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseTransCategoryTable.java 152
MoneyWiseCashCategory myParent = pCategory.getParentCategory();
            if (!MetisDataDifference.isEqual(getParent(), myParent)) {
                if (myParent != null) {
                    myParent = theCategories.findItemById(myParent.getIndexedId());
                }
                selectParent(myParent);
            }

            /* Select the row and ensure that it is visible */
            getTable().selectRow(pCategory);
        }
    }

    @Override
    protected void handleRewind() {
        /* Only action if we are not editing */
        if (!theActiveCategory.isEditing()) {
            /* Handle the reWind */
            setEnabled(true);
            super.handleRewind();
        }

        /* Adjust for changes */
        notifyChanges();
    }

    /**
     * Handle panel state.
     */
    private void handlePanelState() {
        /* Only action if we are not editing */
        if (!theActiveCategory.isEditing()) {
            /* handle the edit transition */
            setEnabled(true);
            final MoneyWiseCashCategory myCategory = theActiveCategory.getSelectedItem();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXPayeeAnalysisSelect.java 132
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWisePayeeAnalysisSelect.java 132
public MoneyWiseXAnalysisPayeeFilter getFilter() {
        return theState.getFilter();
    }

    @Override
    public boolean isAvailable() {
        return thePayees != null
                && !thePayees.isEmpty();
    }

    /**
     * Create SavePoint.
     */
    public void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWisePayeeState(theState);
    }

    /**
     * Restore SavePoint.
     */
    public void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWisePayeeState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* Pass call on to button */
        theButton.setEnabled(bEnabled && isAvailable());
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Set analysis.
     * @param pAnalysis the analysis.
     */
    public void setAnalysis(final MoneyWiseXAnalysis pAnalysis) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXTaxBasisAnalysisSelect.java 167
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseTaxBasisAnalysisSelect.java 167
public MoneyWiseXAnalysisTaxBasisFilter getFilter() {
        return theState.getFilter();
    }

    @Override
    public boolean isAvailable() {
        return theTaxBases != null
                && !theTaxBases.isEmpty();
    }

    /**
     * Create SavePoint.
     */
    public void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWiseTaxBasisState(theState);
    }

    /**
     * Restore SavePoint.
     */
    public void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWiseTaxBasisState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* Pass call on to basis button */
        theBasisButton.setEnabled(bEnabled && isAvailable());
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Set analysis.
     * @param pAnalysis the analysis.
     */
    public void setAnalysis(final MoneyWiseXAnalysis pAnalysis) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXTransCategoryAnalysisSelect.java 137
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseTransCategoryAnalysisSelect.java 137
public MoneyWiseXAnalysisTransCategoryFilter getFilter() {
        return theState.getFilter();
    }

    @Override
    public boolean isAvailable() {
        return theCategories != null
                && !theCategories.isEmpty();
    }

    /**
     * Create SavePoint.
     */
    public void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWiseEventState(theState);
    }

    /**
     * Restore SavePoint.
     */
    public void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWiseEventState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* Pass call on to button */
        theButton.setEnabled(bEnabled && isAvailable());
    }

    @Override
    public void setVisible(final boolean pVisible) {
        thePanel.setVisible(pVisible);
    }

    /**
     * Set analysis.
     * @param pAnalysis the analysis.
     */
    public void setAnalysis(final MoneyWiseXAnalysis pAnalysis) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 821
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 826
theActiveTran.buildReturnedAccountMenu(pMenu, pEvent);
    }

    /**
     * New item.
     */
    private void addNewItem() {
        /* Make sure that we have finished editing */
        cancelEditing();

        /* Create a new profile */
        final OceanusProfile myTask = getView().getNewProfile("addNewItem");

        /* Create the new transaction */
        myTask.startTask("buildItem");
        final MoneyWiseValidateTransaction myBuilder = (MoneyWiseValidateTransaction) theTransactions.getValidator();
        final MoneyWiseTransaction myTrans = theFilter.buildNewTransaction(myBuilder);

        /* If we have one available */
        if (myTrans != null) {
            /* Add the new item */
            myTask.startTask("addToList");
            theTransactions.add(myTrans);
            myTrans.setNewVersion();

            /* Validate the new item and notify of the changes */
            myTask.startTask("incrementVersion");
            getEditSet().incrementVersion();

            /* validate the item */
            myTask.startTask("validate");
            myTrans.validate();

            /* Lock the table */
            myTask.startTask("setItem");
            theActiveTran.setNewItem(theAnalysisMgr.getAnalysis().getEvents().newTransaction(myTrans));
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseLoanInfoSet.java 171
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateLoanInfoSet.java 45
: isClassRequired(myClass);
    }

    @Override
    public MetisFieldRequired isClassRequired(final PrometheusDataInfoClass pClass) {
        /* Access details about the Loan */
        final MoneyWiseLoan myLoan = getOwner();
        final MoneyWiseLoanCategory myCategory = myLoan.getCategory();

        /* If we have no Category, no class is allowed */
        if (myCategory == null) {
            return MetisFieldRequired.NOTALLOWED;
        }

        /* Switch on class */
        switch ((MoneyWiseAccountInfoClass) pClass) {
            /* Allowed set */
            case NOTES:
            case SORTCODE:
            case ACCOUNT:
            case REFERENCE:
            case OPENINGBALANCE:
                return MetisFieldRequired.CANEXIST;

            /* Not allowd */
            case WEBSITE:
            case CUSTOMERNO:
            case USERID:
            case PASSWORD:
            case MATURITY:
            case AUTOEXPENSE:
            case AUTOPAYEE:
            case SYMBOL:
            case REGION:
            case UNDERLYINGSTOCK:
            case OPTIONPRICE:
            default:
                return MetisFieldRequired.NOTALLOWED;
        }
    }
File Line
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetAccountInfoType.java 95
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetTransInfoType.java 95
pReport.setNewStage(AREA_ACCOUNTINFOTYPES);

            /* Count the number of InfoTypes */
            final int myTotal = myView.getRowCount();

            /* Declare the number of steps */
            pReport.setNumSteps(myTotal);

            /* Loop through the rows of the single column range */
            for (int i = 0; i < myTotal; i++) {
                /* Access the cell by reference */
                final PrometheusSheetRow myRow = myView.getRowByIndex(i);
                final PrometheusSheetCell myCell = myView.getRowCellByIndex(myRow, 0);

                /* Add the value into the tables */
                myList.addBasicItem(myCell.getString());

                /* Report the progress */
                pReport.setNextStep();
            }

            /* PostProcess the list */
            myList.postProcessOnLoad();

            /* Handle Exceptions */
        } catch (TethysUIThreadCancelException e) {
            throw e;
        } catch (OceanusException e) {
            throw new MoneyWiseIOException("Failed to load " + myList.getItemType().getListName(), e);
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetCashCategoryType.java 95
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetDepositCategoryType.java 95
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetLoanCategoryType.java 95
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetPayeeType.java 95
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetPortfolioType.java 95
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetSecurityType.java 95
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetTaxBasis.java 95
net\sourceforge\joceanus\moneywise\sheets\MoneyWiseSheetTransCategoryType.java 96
pReport.setNewStage(AREA_CASHCATTYPES);

            /* Count the number of AccountCategoryTypes */
            final int myTotal = myView.getRowCount();

            /* Declare the number of steps */
            pReport.setNumSteps(myTotal);

            /* Loop through the rows of the single column range */
            for (int i = 0; i < myTotal; i++) {
                /* Access the cell by reference */
                final PrometheusSheetRow myRow = myView.getRowByIndex(i);
                final PrometheusSheetCell myCell = myView.getRowCellByIndex(myRow, 0);

                /* Add the value into the tables */
                myList.addBasicItem(myCell.getString());

                /* Report the progress */
                pReport.setNextStep();
            }

            /* PostProcess the list */
            myList.postProcessOnLoad();

            /* Handle exceptions */
        } catch (TethysUIThreadCancelException e) {
            throw e;
        } catch (OceanusException e) {
            throw new MoneyWiseIOException("Failed to Load " + myList.getItemType().getListName(), e);
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseCategoryBase.java 82
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseRegion.java 85
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransTag.java 85
protected MoneyWiseCategoryBase(final MoneyWiseCategoryBaseList<?> pList,
                                    final PrometheusDataValues pValues) throws OceanusException {
        /* Initialise the item */
        super(pList, pValues);

        /* Protect against exceptions */
        try {
            /* Store the Name */
            Object myValue = pValues.getValue(PrometheusDataResource.DATAITEM_FIELD_NAME);
            if (myValue instanceof String) {
                setValueName((String) myValue);
            } else if (myValue instanceof byte[]) {
                setValueName((byte[]) myValue);
            }

            /* Store the Description */
            myValue = pValues.getValue(PrometheusDataResource.DATAITEM_FIELD_DESC);
            if (myValue instanceof String) {
                setValueDesc((String) myValue);
            } else if (myValue instanceof byte[]) {
                setValueDesc((byte[]) myValue);
            }
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransInfoSet.java 839
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateTransInfoSet.java 589
getOwner().addError(MoneyWiseTransBase.ERROR_CURRENCY, getFieldForClass(pInfo.getInfoClass()));
        }
    }

    /**
     * Validate the deltaUnits.
     * @param pInfo the info
     */
    private void validateDeltaUnits(final MoneyWiseTransInfo pInfo) {
        final MoneyWiseTransaction myTrans = getOwner();
        final MoneyWiseAssetDirection myDir = myTrans.getDirection();
        final MoneyWiseTransCategoryClass myCatClass = myTrans.getCategoryClass();
        final MoneyWiseTransInfoClass myInfoClass = pInfo.getInfoClass();
        final MetisFieldRequired isRequired = myInfoClass == MoneyWiseTransInfoClass.ACCOUNTDELTAUNITS
                ? isAccountUnitsPositive(myDir, myCatClass)
                : isPartnerUnitsPositive(myDir, myCatClass);
        final OceanusUnits myUnits = pInfo.getValue(OceanusUnits.class);
        if (myUnits.isZero()) {
            getOwner().addError(PrometheusDataItem.ERROR_ZERO, getFieldForClass(myInfoClass));
File Line
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFPortfolioBuilder.java 204
net\sourceforge\joceanus\moneywise\quicken\file\MoneyWiseQIFPortfolioBuilder.java 278
protected void processIncomeToSecurity(final MoneyWisePayee pPayee,
                                           final MoneyWiseSecurityHolding pHolding,
                                           final MoneyWiseTransaction pTrans) {
        /* Access Portfolio Account */
        final MoneyWisePortfolio myPort = pHolding.getPortfolio();
        final MoneyWiseSecurity mySecurity = pHolding.getSecurity();
        final MoneyWiseQIFAccountEvents myPortfolio = theFile.registerAccount(myPort);

        /* Determine style */
        final boolean useHoldingAccount = theFileType.useInvestmentHolding4Category();

        /* Access Transaction details */
        final MoneyWiseQIFPayee myQPayee = theFile.registerPayee(pPayee);
        final MoneyWiseQIFSecurity myQSecurity = theFile.registerSecurity(mySecurity);
        final MoneyWiseQIFEventCategory myQCategory = theFile.registerCategory(pTrans.getCategory());

        /* Obtain classes */
        final List<MoneyWiseQIFClass> myList = theBuilder.getTransactionClasses(pTrans);

        /* Access details */
        final OceanusMoney myAmount = pTrans.getAmount();
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportAssetGains.java 105
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportPortfolioView.java 126
theBuilder.makeTitleCell(myTable, TEXT_GAINS);

        /* Loop through the Portfolio Buckets */
        final Iterator<MoneyWiseXAnalysisPortfolioBucket> myIterator = myPortfolios.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseXAnalysisPortfolioBucket myBucket = myIterator.next();

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseXAnalysisSecurityValues myValues = myBucket.getValues();

            /* Format the Asset */
            theBuilder.startRow(myTable);
            theBuilder.makeDelayLinkCell(myTable, myName);

            /* Handle values bucket value */
            theBuilder.makeValueCell(myTable, myBucket.getNonCashValue(false));
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisSecurityAttr.RESIDUALCOST));
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseXAnalysisSecurityAttr.REALISEDGAINS));
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXCashAnalysisSelect.java 492
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseCashAnalysisSelect.java 492
theFilter = new MoneyWiseXAnalysisCashFilter(theCash);
                theFilter.setDateRange(theDateRange);
            } else {
                theFilter = null;
            }
        }

        /**
         * Set new Category.
         * @param pCategory the Category
         * @return true/false did a change occur
         */
        private boolean setCategory(final MoneyWiseCashCategory pCategory) {
            /* Adjust the selected category */
            if (!MetisDataDifference.isEqual(pCategory, theCategory)) {
                setTheCash(pCategory, getDefaultCash(pCategory));
                return true;
            }
            return false;
        }

        /**
         * Set the dateRange.
         * @param pRange the dateRange
         */
        private void setDateRange(final OceanusDateRange pRange) {
            /* Store the dateRange */
            theDateRange = pRange;
            if (theFilter != null) {
                theFilter.setDateRange(theDateRange);
            }
        }

        /**
         * Apply the State.
         */
        private void applyState() {
            /* Adjust the lock-down */
            setEnabled(true);
            theCashButton.setValue(theCash);
            theCatButton.setValue(theCategory);
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXDepositAnalysisSelect.java 487
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseDepositAnalysisSelect.java 487
theFilter = new MoneyWiseXAnalysisDepositFilter(theDeposit);
                theFilter.setDateRange(theDateRange);
            } else {
                theFilter = null;
            }
        }

        /**
         * Set new Category.
         * @param pCategory the Category
         * @return true/false did a change occur
         */
        private boolean setCategory(final MoneyWiseDepositCategory pCategory) {
            /* Adjust the selected category */
            if (!MetisDataDifference.isEqual(pCategory, theCategory)) {
                setTheDeposit(pCategory, getDefaultDeposit(pCategory));
                return true;
            }
            return false;
        }

        /**
         * Set the dateRange.
         * @param pRange the dateRange
         */
        private void setDateRange(final OceanusDateRange pRange) {
            /* Store the dateRange */
            theDateRange = pRange;
            if (theFilter != null) {
                theFilter.setDateRange(theDateRange);
            }
        }

        /**
         * Apply the State.
         */
        private void applyState() {
            /* Adjust the lock-down */
            setEnabled(true);
            theDepositButton.setValue(theDeposit);
            theCatButton.setValue(theCategory);
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXLoanAnalysisSelect.java 494
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseLoanAnalysisSelect.java 494
theFilter = new MoneyWiseXAnalysisLoanFilter(theLoan);
                theFilter.setDateRange(theDateRange);
            } else {
                theFilter = null;
            }
        }

        /**
         * Set new Category.
         * @param pCategory the Category
         * @return true/false did a change occur
         */
        private boolean setCategory(final MoneyWiseLoanCategory pCategory) {
            /* Adjust the selected category */
            if (!MetisDataDifference.isEqual(pCategory, theCategory)) {
                setTheLoan(pCategory, getDefaultLoan(pCategory));
                return true;
            }
            return false;
        }

        /**
         * Set the dateRange.
         * @param pRange the dateRange
         */
        private void setDateRange(final OceanusDateRange pRange) {
            /* Store the dateRange */
            theDateRange = pRange;
            if (theFilter != null) {
                theFilter.setDateRange(theDateRange);
            }
        }

        /**
         * Apply the State.
         */
        private void applyState() {
            /* Adjust the lock-down */
            setEnabled(true);
            theLoanButton.setValue(theLoan);
            theCatButton.setValue(theCategory);
        }
    }
}
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseLoanInfoSet.java 105
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseSecurityInfoSet.java 122
return myValue != null
                ? myValue
                : MetisDataFieldValue.SKIP;
    }

    /**
     * Obtain the class of the field if it is an infoSet field.
     * @param pField the field
     * @return the class
     */
    public static MoneyWiseAccountInfoClass getClassForField(final MetisDataFieldId pField) {
        /* Look up field in map */
        return FIELDSET_MAP.get(pField);
    }

    /**
     * Obtain the field for the infoSet class.
     * @param pClass the class
     * @return the field
     */
    public static MetisDataFieldId getFieldForClass(final MoneyWiseAccountInfoClass pClass) {
        /* Look up field in map */
        return REVERSE_FIELDMAP.get(pClass);
    }

    @Override
    public MetisDataFieldId getFieldForClass(final PrometheusDataInfoClass pClass) {
        return getFieldForClass((MoneyWiseAccountInfoClass) pClass);
    }

    @Override
    public Iterator<PrometheusDataInfoClass> classIterator() {
        final PrometheusDataInfoClass[] myValues = MoneyWiseAccountInfoClass.values();
        return Arrays.stream(myValues).iterator();
    }

    /**
     * Clone the dataInfoSet.
     * @param pSource the InfoSet to clone
     */
    protected void cloneDataInfoSet(final MoneyWiseLoanInfoSet pSource) {
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePayeeInfoSet.java 104
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseSecurityInfoSet.java 122
return myValue != null
                ? myValue
                : MetisDataFieldValue.SKIP;
    }

    /**
     * Obtain the class of the field if it is an infoSet field.
     * @param pField the field
     * @return the class
     */
    public static MoneyWiseAccountInfoClass getClassForField(final MetisDataFieldId pField) {
        /* Look up field in map */
        return FIELDSET_MAP.get(pField);
    }

    /**
     * Obtain the field for the infoSet class.
     * @param pClass the class
     * @return the field
     */
    public static MetisDataFieldId getFieldForClass(final MoneyWiseAccountInfoClass pClass) {
        /* Look up field in map */
        return REVERSE_FIELDMAP.get(pClass);
    }

    @Override
    public MetisDataFieldId getFieldForClass(final PrometheusDataInfoClass pClass) {
        return getFieldForClass((MoneyWiseAccountInfoClass) pClass);
    }

    @Override
    public Iterator<PrometheusDataInfoClass> classIterator() {
        final PrometheusDataInfoClass[] myValues = MoneyWiseAccountInfoClass.values();
        return Arrays.stream(myValues).iterator();
    }

    /**
     * Clone the dataInfoSet.
     * @param pSource the InfoSet to clone
     */
    protected void cloneDataInfoSet(final MoneyWisePayeeInfoSet pSource) {
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWisePortfolioInfoSet.java 104
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseSecurityInfoSet.java 122
return myValue != null
                ? myValue
                : MetisDataFieldValue.SKIP;
    }

    /**
     * Obtain the class of the field if it is an infoSet field.
     * @param pField the field
     * @return the class
     */
    public static MoneyWiseAccountInfoClass getClassForField(final MetisDataFieldId pField) {
        /* Look up field in map */
        return FIELDSET_MAP.get(pField);
    }

    /**
     * Obtain the field for the infoSet class.
     * @param pClass the class
     * @return the field
     */
    public static MetisDataFieldId getFieldForClass(final MoneyWiseAccountInfoClass pClass) {
        /* Look up field in map */
        return REVERSE_FIELDMAP.get(pClass);
    }

    @Override
    public MetisDataFieldId getFieldForClass(final PrometheusDataInfoClass pClass) {
        return getFieldForClass((MoneyWiseAccountInfoClass) pClass);
    }

    @Override
    public Iterator<PrometheusDataInfoClass> classIterator() {
        final PrometheusDataInfoClass[] myValues = MoneyWiseAccountInfoClass.values();
        return Arrays.stream(myValues).iterator();
    }

    /**
     * Clone the dataInfoSet.
     * @param pSource the InfoSet to clone
     */
    protected void cloneDataInfoSet(final MoneyWisePortfolioInfoSet pSource) {
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportAssetGains.java 105
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportPortfolioView.java 126
theBuilder.makeTitleCell(myTable, TEXT_GAINS);

        /* Loop through the Portfolio Buckets */
        final Iterator<MoneyWiseAnalysisPortfolioBucket> myIterator = myPortfolios.iterator();
        while (myIterator.hasNext()) {
            final MoneyWiseAnalysisPortfolioBucket myBucket = myIterator.next();

            /* Access bucket name */
            final String myName = myBucket.getName();

            /* Access values */
            final MoneyWiseAnalysisSecurityValues myValues = myBucket.getValues();

            /* Format the Asset */
            theBuilder.startRow(myTable);
            theBuilder.makeDelayLinkCell(myTable, myName);

            /* Handle values bucket value */
            theBuilder.makeValueCell(myTable, myBucket.getNonCashValue(false));
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.RESIDUALCOST));
            theBuilder.makeValueCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.REALISEDGAINS));
File Line
net\sourceforge\joceanus\moneywise\ui\base\MoneyWiseCategoryTable.java 148
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseRegionTable.java 113
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseTransTagTable.java 113
final TethysUIIconMapSet<MetisAction> myActionMapSet = MetisIcon.configureStatusIconButton(myGuiFactory);
        myTable.declareIconColumn(PrometheusDataResource.DATAITEM_TOUCH, MetisAction.class)
                .setIconMapSet(r -> myActionMapSet)
                .setCellValueFactory(r -> r.isActive() ? MetisAction.ACTIVE : MetisAction.DELETE)
                .setName(MoneyWiseUIResource.STATICDATA_ACTIVE.getValue())
                .setEditable(true)
                .setCellEditable(r -> !r.isActive())
                .setColumnWidth(WIDTH_ICON)
                .setOnCommit((r, v) -> updateField(this::deleteRow, r, v));

        /* Add listeners */
        myNewButton.getEventRegistrar().addEventListener(e -> addNewItem());
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseAccountPanel.java 554
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseCategoryPanel.java 535
showPanel(PanelName.PAYEES);
        }
    }

    /**
     * Show panel.
     * @param pName the panel name
     */
    private void showPanel(final PanelName pName) {
        /* Obtain name of panel */
        final String myName = pName.toString();

        /* Move correct card to front */
        theCardPanel.selectCard(myName);
        theFilterCardPanel.selectCard(myName);

        /* Note the active panel */
        theActive = pName;
        theSelectButton.setFixedText(myName);

        /* Determine the focus */
        determineFocus();
    }

    /**
     * Set Visibility.
     */
    protected void setVisibility() {
        /* Determine whether we have updates */
        final boolean hasUpdates = hasUpdates();
        final boolean isItemEditing = isItemEditing();

        /* Update the action buttons */
        theActionButtons.setEnabled(true);
        theActionButtons.setVisible(hasUpdates && !isItemEditing);

        /* Update the selection */
        theSelectButton.setEnabled(!isItemEditing);
        theFilterCardPanel.setEnabled(!isItemEditing);

        /* Alert listeners that there has been a change */
        theEventManager.fireEvent(PrometheusDataEvent.ADJUSTVISIBILITY);
    }

    /**
     * handleErrorPane.
     */
    private void handleErrorPane() {
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseMarketPricesTable.java 391
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseMarketRatesTable.java 385
}

        @Override
        public OceanusEventRegistrar<PrometheusDataEvent> getEventRegistrar() {
            return theEventManager.getEventRegistrar();
        }

        /**
         * handleErrorPane.
         */
        private void handleErrorPane() {
            /* Determine whether we have an error */
            final boolean isError = theError.hasError();

            /* Hide selection panel on error */
            theTable.getSelect().setVisible(!isError);

            /* Lock scroll area */
            theTable.setEnabled(!isError);

            /* Lock Action Buttons */
            theActionButtons.setEnabled(!isError);
        }

        /**
         * handle Action Buttons.
         * @param pEvent the event
         */
        private void handleActionButtons(final OceanusEvent<PrometheusUIEvent> pEvent) {
            /* Cancel editing */
            theTable.cancelEditing();

            /* Perform the command */
            theEditSet.processCommand(pEvent.getEventId(), theError);

            /* Adjust for changes */
            theTable.notifyChanges();
        }

        /**
         * Determine Focus.
         */
        public void determineFocus() {
            /* Request the focus */
            theTable.determineFocus();
File Line
net\sourceforge\joceanus\moneywise\atlas\reports\MoneyWiseXReportCapitalGains.java 121
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportCapitalGains.java 121
theEndDate = pAnalysis.getDateRange().getEnd();

        /* Start the report */
        final Element myBody = theBuilder.startReport();
        theBuilder.makeTitle(myBody, TEXT_TITLE, theFormatter.formatObject(theEndDate));
        theBuilder.makeSubTitle(myBody, theSecurity.getDecoratedName());

        /* Initialise the table */
        theTable = theBuilder.startTable(myBody);
        theBuilder.startHdrRow(theTable);
        theBuilder.makeTitleCell(theTable, MoneyWiseBasicResource.MONEYWISEDATA_FIELD_DATE.getValue());
        theBuilder.makeTitleCell(theTable, MoneyWiseBasicDataType.TRANSACTION.getItemName());

        /* Format the history */
        formatHistory();

        /* Return the document */
        return theBuilder.getDocument();
    }

    /**
     * format the cost history.
     */
    private void formatHistory() {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXAnalysisSelect.java 941
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseAnalysisSelect.java 961
theAnalysis = theAnalysisMgr.getRangedAnalysis(getRange());
            setAnalysis();

            /* Validate state and apply */
            checkType();
            theState.applyState();

            /* Remove refreshing flag and notify listeners */
            isRefreshing = false;
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Set RangeSelect visibility.
     * @param pVisible the visibility setting
     */
    private void setRangeVisibility(final boolean pVisible) {
        theRangeButton.setIcon(pVisible
                ? TethysUIArrowIconId.UP
                : TethysUIArrowIconId.DOWN);
        theRangeSelect.setVisible(pVisible);
        isRangeVisible = pVisible;
    }

    /**
     * Set FilterSelect visibility.
     * @param pVisible the visibility setting
     */
    private void setFilterVisibility(final boolean pVisible) {
        theFilterButton.setIcon(pVisible
                ? TethysUIArrowIconId.UP
                : TethysUIArrowIconId.DOWN);
        theFilterSelect.setVisible(pVisible);
        isFilterVisible = pVisible;
    }

    /**
     * Handle New Bucket.
     */
    private void handleNewBucket() {
        /* Ignore if we are refreshing */
        if (isRefreshing) {
            return;
        }

        final MoneyWiseXAnalysisAttribute myBucket = theBucketButton.getValue();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXReportTab.java 270
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseReportTab.java 264
: theAnalysisMgr.getRangedAnalysis(myRange);

        /* Record analysis and build report */
        theSelect.setAnalysis(myAnalysis);
        final Document myDoc = theBuilder.createReport(myAnalysis, myReportType, mySecurity);

        /* Declare to debugger */
        theSpotEntry.setObject(myAnalysis);
        theSpotEntry.setVisible(true);

        /* Declare the document */
        theManager.setDocument(myDoc);

        /* Create initial display version */
        final String myText = theManager.formatXML();
        theHTMLPane.setHTMLContent(myText, "");
    }

    /**
     * handleErrorPane.
     */
    private void handleErrorPane() {
        /* Determine whether we have an error */
        final boolean isError = theError.hasError();

        /* Hide selection panel on error */
        theSelect.setVisible(!isError);

        /* Lock HTML area */
        theHTMLPane.setEnabled(!isError);
    }

    /**
     * handleGoToRequest.
     * @param pEvent the event
     */
    private void handleGoToRequest(final OceanusEvent<MetisReportEvent> pEvent) {
        /* Access the filter */
        final MoneyWiseXAnalysisFilter<?, ?> myFilter = pEvent.getDetails(MoneyWiseXAnalysisFilter.class);
File Line
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportMarketGrowth.java 170
net\sourceforge\joceanus\moneywise\lethe\reports\MoneyWiseReportMarketGrowth.java 193
theBuilder.makeTotalCell(myTable, myBucket.getNonCashValue(true));
                theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.INVESTED));
                theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.GROWTHADJUST));
                theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.REALISEDGAINS));
                theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.MARKETGROWTH));
                if (hasForeign) {
                    theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.CURRENCYFLUCT));
                }
                theBuilder.makeTotalCell(myTable, myValues.getMoneyValue(MoneyWiseAnalysisSecurityAttr.MARKETPROFIT));
                checkPortfolioGrowth(myBucket);
File Line
net\sourceforge\joceanus\moneywise\ui\controls\MoneyWiseSpotPricesSelect.java 319
net\sourceforge\joceanus\moneywise\ui\controls\MoneyWiseSpotRatesSelect.java 236
public final void setRange(final OceanusDateRange pRange) {
        final OceanusDate myStart = (pRange == null)
                ? null
                : pRange.getStart();
        final OceanusDate myEnd = (pRange == null)
                ? null
                : pRange.getEnd();

        /* Set up range */
        theDateButton.setEarliestDate(myStart);
        theDateButton.setLatestDate(myEnd);
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        theNext.setEnabled(bEnabled && (theState.getNextDate() != null));
        thePrev.setEnabled(bEnabled && (theState.getPrevDate() != null));
        theDateButton.setEnabled(bEnabled);
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\panel\MoneyWiseXEventTable.java 562
net\sourceforge\joceanus\moneywise\lethe\ui\panel\MoneyWiseTransactionTable.java 567
void selectStatement(final MoneyWiseXStatementSelect pSelect) {
        /* Update selection */
        theSelect.selectStatement(pSelect);

        /* Set the filter */
        theFilter = theSelect.getFilter();

        /* Ensure that columns are correct */
        adjustColumns(theSelect.showColumns()
                ? theSelect.getColumns()
                : MoneyWiseAnalysisColumnSet.BALANCE);

        /* Update the lists */
        updateList();
    }

    /**
     * handleErrorPane.
     */
    private void handleErrorPane() {
        /* Determine whether we have an error */
        final boolean isError = theError.hasError();

        /* Hide selection panel on error */
        theSelect.setVisible(!isError);

        /* Lock scroll area */
        getTable().setEnabled(!isError);

        /* Lock Action Buttons */
        theActionButtons.setEnabled(!isError);
    }

    @Override
    protected void refreshData() {
        /* Obtain the active profile */
        OceanusProfile myTask = getView().getActiveTask();
        myTask = myTask.startTask("refreshData");
File Line
net\sourceforge\joceanus\moneywise\lethe\data\analysis\analyse\MoneyWiseAnalysisTransAnalyser.java 1462
net\sourceforge\joceanus\moneywise\lethe\data\analysis\analyse\MoneyWiseAnalysisTransAnalyser.java 1627
final OceanusMoney myForeign = myInvested.convertCurrency(myCreditAsset.getCurrency().getCurrency(), myCreditRate);
            myCreditAsset.adjustCounter(MoneyWiseAnalysisSecurityAttr.FOREIGNINVESTED, myForeign);
        }

        /* Determine final value of the credit stock after the takeOver */
        myCreditUnits = myCreditAsset.getValues().getUnitsValue(MoneyWiseAnalysisSecurityAttr.UNITS);
        OceanusMoney myCreditValue = myCreditUnits.valueAtPrice(myCreditPrice);
        if (isForeignCredit) {
            myCreditValue = myCreditValue.convertCurrency(myCurrency, myCreditRate);
        }

        /* Register the transaction */
        final MoneyWiseAnalysisSecurityValues myCreditValues = myCreditAsset.registerTransaction(theHelper);
        myCreditValues.setValue(MoneyWiseAnalysisSecurityAttr.PRICE, myCreditPrice);
        myCreditValues.setValue(MoneyWiseAnalysisSecurityAttr.XFERREDVALUE, myCreditXferValue);
        myCreditValues.setValue(MoneyWiseAnalysisSecurityAttr.XFERREDCOST, myDebitCost);
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXAnalysisSelect.java 989
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseAnalysisSelect.java 1009
final MoneyWiseXAnalysisFilter<?, ?> myFilter = theState.getFilter();
            if (myBucket != null) {
                myFilter.setCurrentAttribute(myBucket);
            }
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Handle New Columns.
     */
    private void handleNewColumns() {
        /* Ignore if we are refreshing */
        if (isRefreshing) {
            return;
        }

        /* Record the columns */
        final MoneyWiseAnalysisColumnSet mySet = theColumnButton.getValue();
        if (theState.setColumns(mySet)) {
            theState.applyState();
            theEventManager.fireEvent(PrometheusDataEvent.SELECTIONCHANGED);
        }
    }

    /**
     * Handle FilterType.
     */
    private void handleFilterType() {
        /* Ignore if we are refreshing */
        if (isRefreshing) {
            return;
        }

        /* If the type has changed */
        final MoneyWiseXAnalysisType myType = theFilterTypeButton.getValue();
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXDepositAnalysisSelect.java 174
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseDepositAnalysisSelect.java 174
public MoneyWiseXAnalysisDepositFilter getFilter() {
        return theState.getFilter();
    }

    @Override
    public boolean isAvailable() {
        return theDeposits != null
                && !theDeposits.isEmpty();
    }

    /**
     * Create SavePoint.
     */
    protected void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWiseDepositState(theState);
    }

    /**
     * Restore SavePoint.
     */
    protected void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWiseDepositState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* Determine whether there are any Deposits to select */
        final boolean dpAvailable = bEnabled && isAvailable();

        /* Pass call on to buttons */
        theDepositButton.setEnabled(dpAvailable);
        theCatButton.setEnabled(dpAvailable);
    }

    /**
     * Set analysis.
     * @param pAnalysis the analysis.
     */
    public void setAnalysis(final MoneyWiseXAnalysis pAnalysis) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\controls\MoneyWiseXLoanAnalysisSelect.java 174
net\sourceforge\joceanus\moneywise\lethe\ui\controls\MoneyWiseLoanAnalysisSelect.java 174
public MoneyWiseXAnalysisLoanFilter getFilter() {
        return theState.getFilter();
    }

    @Override
    public boolean isAvailable() {
        return theLoans != null
                && !theLoans.isEmpty();
    }

    /**
     * Create SavePoint.
     */
    protected void createSavePoint() {
        /* Create the savePoint */
        theSavePoint = new MoneyWiseLoanState(theState);
    }

    /**
     * Restore SavePoint.
     */
    protected void restoreSavePoint() {
        /* Restore the savePoint */
        theState = new MoneyWiseLoanState(theSavePoint);

        /* Apply the state */
        theState.applyState();
    }

    @Override
    public void setEnabled(final boolean bEnabled) {
        /* Determine whether there are any Loans to select */
        final boolean lnAvailable = bEnabled && isAvailable();

        /* Pass call on to buttons */
        theLoanButton.setEnabled(lnAvailable);
        theCatButton.setEnabled(lnAvailable);
    }

    /**
     * Set analysis.
     * @param pAnalysis the analysis.
     */
    public void setAnalysis(final MoneyWiseXAnalysis pAnalysis) {
File Line
net\sourceforge\joceanus\moneywise\atlas\ui\dialog\MoneyWiseXTransactionDialog.java 335
net\sourceforge\joceanus\moneywise\lethe\ui\dialog\MoneyWiseTransactionDialog.java 341
setEditable(false);
    }

    /**
     * Update editors.
     * @param pRange the date range.
     */
    public void updateEditors(final OceanusDateRange pRange) {
        /* Update the range */
        theRange = pRange;
    }

    /**
     * Handle dateConfig.
     * @param pConfig the dateConfig
     */
    private void handleDateConfig(final OceanusDateConfig pConfig) {
        /* Update Date button */
        pConfig.setEarliestDate(theRange != null
                ? theRange.getStart()
                : null);
        pConfig.setLatestDate(theRange != null
                ? theRange.getEnd()
                : null);
    }

    @Override
    public boolean isDeletable() {
        return getItem() != null && !getItem().isReconciled();
    }

    @Override
    protected void adjustFields(final boolean isEditable) {
        /* Access the item */
        final MoneyWiseTransaction myTrans = getItem().getTransaction();
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseMarketPricesTable.java 145
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseMarketRatesTable.java 146
.setCellEditable(r -> r.getPrice() != null && !r.isDisabled())
                .setColumnWidth(WIDTH_ICON)
                .setOnCommit((r, v) -> updateField(this::deleteRow, r, v));

        /* Add listeners */
        theSelect.getEventRegistrar().addEventListener(PrometheusDataEvent.SELECTIONCHANGED, e -> handleNewSelection());
        theSelect.getEventRegistrar().addEventListener(PrometheusDataEvent.DOWNLOAD, e -> downloadPrices());
        pView.getEventRegistrar().addEventListener(e -> refreshData());
        pEditSet.getEventRegistrar().addEventListener(e -> updateTableData());
    }
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseTransInfoSet.java 626
net\sourceforge\joceanus\moneywise\data\validate\MoneyWiseValidateTransInfoSet.java 451
switch (pClass) {
            case QUALIFYYEARS:
                validateQualifyYears(pInfo);
                break;
            case TAXCREDIT:
                validateTaxCredit(pInfo);
                break;
            case EMPLOYEENATINS:
            case EMPLOYERNATINS:
            case DEEMEDBENEFIT:
            case WITHHELD:
                validateOptionalTaxCredit(pInfo);
                break;
            case PARTNERAMOUNT:
                validatePartnerAmount(pInfo);
                break;
            case RETURNEDCASHACCOUNT:
                validateReturnedCashAccount(pInfo);
                break;
            case RETURNEDCASH:
                validateReturnedCash(pInfo);
                break;
            case ACCOUNTDELTAUNITS:
            case PARTNERDELTAUNITS:
                validateDeltaUnits(pInfo);
                break;
            case REFERENCE:
            case COMMENTS:
                validateInfoLength(pInfo);
                break;
            case PRICE:
                validatePrice(pInfo);
                break;
            case TRANSTAG:
            case DILUTION:
            default:
                break;
        }
    }
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWisePayeeDialog.java 142
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWisePortfolioDialog.java 151
theFieldSet.addField(MoneyWiseAccountInfoClass.REFERENCE, myReference, MoneyWisePayee::getReference);

        /* Configure validation checks */
        mySortCode.setValidator(this::isValidSortCode);
        myAccount.setValidator(this::isValidAccount);
        myReference.setValidator(this::isValidReference);
    }

    /**
     * Build web subPanel.
     * @param pFactory the GUI factory
     */
    private void buildWebPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_WEB);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUICharArrayEditField myWebSite = myFields.newCharArrayField();
        final TethysUICharArrayEditField myCustNo = myFields.newCharArrayField();
        final TethysUICharArrayEditField myUserId = myFields.newCharArrayField();
        final TethysUICharArrayEditField myPassWord = myFields.newCharArrayField();

        /* Assign the fields to the panel */
        theFieldSet.addField(MoneyWiseAccountInfoClass.WEBSITE, myWebSite, MoneyWisePayee::getWebSite);
File Line
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseCashCategoryTable.java 220
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseDepositCategoryTable.java 220
net\sourceforge\joceanus\moneywise\ui\panel\MoneyWiseLoanCategoryTable.java 220
final MoneyWiseCashCategory myCategory = theCategories.addNewItem();
            myCategory.setDefaults(getParent());

            /* Set as new and adjust map */
            myTask.startTask("incrementVersion");
            myCategory.setNewVersion();
            myCategory.adjustMapForItem();
            getEditSet().incrementVersion();

            /* Validate the new item */
            myTask.startTask("validate");
            myCategory.validate();

            /* update panel */
            myTask.startTask("setItem");
            theActiveCategory.setNewItem(myCategory);

            /* Lock the table */
            setTableEnabled(false);
            myTask.end();

            /* Handle Exceptions */
        } catch (OceanusException e) {
            /* Build the error */
            final OceanusException myError = new MoneyWiseDataException("Failed to create new category", e);

            /* Show the error */
            setError(myError);
        }
    }

    @Override
    protected boolean isFiltered(final MoneyWiseCashCategory pRow) {
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseAssetBase.java 133
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseCategoryBase.java 85
final OceanusDataFormatter myFormatter = getDataSet().getDataFormatter();

        /* Protect against exceptions */
        try {
            /* Store the name */
            Object myValue = pValues.getValue(PrometheusDataResource.DATAITEM_FIELD_NAME);
            if (myValue instanceof String) {
                setValueName((String) myValue);
            } else if (myValue instanceof byte[]) {
                setValueName((byte[]) myValue);
            }

            /* Store the Description */
            myValue = pValues.getValue(PrometheusDataResource.DATAITEM_FIELD_DESC);
            if (myValue instanceof String) {
                setValueDesc((String) myValue);
            } else if (myValue instanceof byte[]) {
                setValueDesc((byte[]) myValue);
            }

            /* Store the Category */
            myValue = pValues.getValue(MoneyWiseBasicResource.CATEGORY_NAME);
File Line
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseDeposit.java 156
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseLoan.java 152
net\sourceforge\joceanus\moneywise\data\basic\MoneyWiseSecurity.java 159
theInfoSet = new MoneyWiseDepositInfoSet(this, pList.getActInfoTypes(), pList.getDepositInfo());
        hasInfoSet = true;
        useInfoSet = true;
    }

    @Override
    public MetisFieldSetDef getDataFieldSet() {
        return FIELD_DEFS;
    }

    @Override
    public boolean includeXmlField(final MetisDataFieldId pField) {
        /* Determine whether fields should be included */
        if (MoneyWiseBasicResource.CATEGORY_NAME.equals(pField)) {
            return true;
        }
        if (MoneyWiseStaticDataType.CURRENCY.equals(pField)) {
            return true;
        }
        if (MoneyWiseBasicResource.ASSET_PARENT.equals(pField)) {
            return true;
        }

        /* Pass call on */
        return super.includeXmlField(pField);
    }

    @Override
    public Long getExternalId() {
        return MoneyWiseAssetType.createExternalId(MoneyWiseAssetType.DEPOSIT, getIndexedId());
File Line
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseCashDialog.java 125
net\sourceforge\joceanus\moneywise\ui\dialog\MoneyWiseSecurityDialog.java 151
myCategoryButton.setMenuConfigurator(c -> buildCategoryMenu(c, getItem()));
        myCurrencyButton.setMenuConfigurator(c -> buildCurrencyMenu(c, getItem()));
        final Map<Boolean, TethysUIIconMapSet<Boolean>> myMapSets = MoneyWiseIcon.configureLockedIconButton(pFactory);
        myClosedButton.setIconMapSet(() -> myMapSets.get(theClosedState));

        /* Configure validation checks */
        myName.setValidator(this::isValidName);
        myDesc.setValidator(this::isValidDesc);
    }

    /**
     * Build account subPanel.
     * @param pFactory the GUI factory
     */
    private void buildDetailsPanel(final TethysUIFactory<?> pFactory) {
        /* Create a new panel */
        theFieldSet.newPanel(TAB_DETAILS);

        /* Allocate fields */
        final TethysUIFieldFactory myFields = pFactory.fieldFactory();
        final TethysUIMoneyEditField myOpening = myFields.newMoneyField();