private void updateButtonStates() {
    Platform.runLater(
        () -> {
          final Account account = selectedAccountProperty.get();

          if (account != null) {
            final int count = account.getTransactionCount();

            deleteButton.setDisable(count > 0 || account.getChildCount() > 0);
            reconcileButton.setDisable(count <= 0);
            zoomButton.setDisable(account.isPlaceHolder());
          } else {
            deleteButton.setDisable(true);
            reconcileButton.setDisable(true);
            zoomButton.setDisable(true);
          }
        });
  }
Esempio n. 2
0
  void getBalances(final Account a, final Date[] dates1, final AccountType type) {

    for (Account child : a.getChildren()) {
      int len = child.getTransactionCount();
      if ((SHOW_EMPTY_ACCOUNT || len > 0) && type == child.getAccountType()) {
        String acctName = child.getName();

        BigDecimal acctBal =
            AccountBalanceDisplayManager.convertToSelectedBalanceMode(
                child.getAccountType(), child.getBalance(dates1[0], dates1[1], baseCommodity));

        // output account name and balance
        pl.add(formatAcctNameOut(acctName) + " " + formatDecimalOut(acctBal));

        balance.add(acctBal);
      }
      if (child.isParent()) {
        getBalances(child, dates1, type);
      }
    }
  }