use of jgnash.engine.TransactionEntryReinvestDivX in project jgnash by ccavanaugh.
the class ReinvestDividendPanel method modifyTransaction.
@Override
public void modifyTransaction(final Transaction tran) {
if (!(tran instanceof InvestmentTransaction)) {
throw new IllegalArgumentException("bad tranType");
}
clearForm();
datePanel.setDate(tran.getLocalDate());
List<TransactionEntry> entries = tran.getTransactionEntries();
feePanel.setTransactionEntries(((InvestmentTransaction) tran).getInvestmentFeeEntries());
gainsPanel.setTransactionEntries(((InvestmentTransaction) tran).getInvestmentGainLossEntries());
entries.stream().filter(e -> e instanceof TransactionEntryReinvestDivX).forEach(e -> {
AbstractInvestmentTransactionEntry entry = (AbstractInvestmentTransactionEntry) e;
memoField.setText(e.getMemo());
priceField.setDecimal(entry.getPrice());
quantityField.setDecimal(entry.getQuantity());
securityCombo.setSelectedNode(entry.getSecurityNode());
});
updateTotalField();
modTrans = tran;
setReconciledState(tran.getReconciled(getAccount()));
}
Aggregations