Search in sources :

Example 1 with SortedInvestmentTableModel

use of jgnash.ui.register.table.SortedInvestmentTableModel in project jgnash by ccavanaugh.

the class RegisterFactory method getTableModel.

private static AbstractRegisterTableModel getTableModel(final boolean sort, final Account account, final boolean detailSplits) {
    AbstractRegisterTableModel model;
    if (account.memberOf(AccountGroup.INVEST) && (account.getAccountType() != AccountType.SIMPLEINVEST)) {
        if (sort) {
            return new SortedInvestmentTableModel(account);
        }
        return new InvestmentRegisterTableModel(account);
    }
    // reference to the correct column names
    String[] names = getColumnNames(account);
    if (sort) {
        model = new SortedTableModel(account, names);
    } else {
        model = new RegisterTableWithSplitEntriesModel(account, names, detailSplits);
    }
    return model;
}
Also used : InvestmentRegisterTableModel(jgnash.ui.register.table.InvestmentRegisterTableModel) AbstractRegisterTableModel(jgnash.ui.register.table.AbstractRegisterTableModel) SortedInvestmentTableModel(jgnash.ui.register.table.SortedInvestmentTableModel) SortedTableModel(jgnash.ui.register.table.SortedTableModel) RegisterTableWithSplitEntriesModel(jgnash.ui.register.table.RegisterTableWithSplitEntriesModel)

Aggregations

AbstractRegisterTableModel (jgnash.ui.register.table.AbstractRegisterTableModel)1 InvestmentRegisterTableModel (jgnash.ui.register.table.InvestmentRegisterTableModel)1 RegisterTableWithSplitEntriesModel (jgnash.ui.register.table.RegisterTableWithSplitEntriesModel)1 SortedInvestmentTableModel (jgnash.ui.register.table.SortedInvestmentTableModel)1 SortedTableModel (jgnash.ui.register.table.SortedTableModel)1