@Override public Object getCellValue(Object element) { ITransaction transaction = (ITransaction) element; Transaction t = transaction.getNative(); if (accountId.equals(t.getSenderId())) { return Convert.toUnsignedLong(t.getRecipientId()); } return Convert.toUnsignedLong(t.getSenderId()); }
@Override public void activate(Object element) { ITransaction transaction = (ITransaction) element; Transaction t = transaction.getNative(); Long id = t.getId(); if (id != null) { InspectTransactionDialog.show( id, nxt, engine, userService, sync, contactsService); } }
@Override public void activate(Object element) { ITransaction transaction = (ITransaction) element; Transaction t = transaction.getNative(); Long id = null; if (accountId.equals(t.getSenderId())) { id = t.getRecipientId(); } else { id = t.getSenderId(); } if (id != null) { InspectAccountDialog.show(id, nxt, engine, userService, sync, contactsService); } }
@Override public Object getCellValue(Object element) { // OK ITransaction transaction = (ITransaction) element; Transaction t = transaction.getNative(); if (accountId.equals(t.getSenderId())) { if (accountId.equals(t.getRecipientId())) { return MONEY; } return MONEY_SEND; } else if (accountId.equals(t.getRecipientId())) { return MONEY_RECEIVED; } return null; }
@Override public Object getCellValue(Object element) { ITransaction transaction = (ITransaction) element; Transaction t = transaction.getNative(); IContact contact; if (t.getSenderId().equals(accountId)) contact = getContactsService().getContact(Convert.toUnsignedLong(t.getRecipientId())); else contact = getContactsService().getContact(Convert.toUnsignedLong(t.getSenderId())); if (contact != null) return contact.getName(); return EMPTY_STRING; }
@Override public Object[] getElements(Object inputElement) { if (accountId == null || list == null) { return new Object[0]; } logger.info("getElements page=" + currentPage + " size=" + pageSize); list.ensureCapacity(currentPage * pageSize + 1); Pageable<ITransaction> pageable = new Pageable<ITransaction>(list.getList(), pageSize); pageable.setPage(currentPage); List<ITransaction> transactions = pageable.getListForPage(); /* Add all pending transactions for this account */ if (currentPage == 1) { List<Transaction> pending = new ArrayList<Transaction>(); for (Transaction t : nxt.getPendingTransactions()) { if (accountId.equals(t.getSenderId()) || accountId.equals(t.getRecipientId())) { pending.add(t); } } if (pending.size() > 0) { List<Transaction> remove = new ArrayList<Transaction>(); for (Transaction t : pending) { for (ITransaction it : transactions) { if (t.getId().equals(it.getNative().getId())) { remove.add(t); break; } } } for (Transaction t : remove) { nxt.getPendingTransactions().remove(t); pending.remove(t); } for (Transaction t : pending) { transactions.add(0, new TransactionHelper(nxt, t)); } } } logger.info("getElements returns ELEMENTS.size=" + transactions.size()); return transactions.toArray(new Object[transactions.size()]); }
@Override public Object getCellValue(Object element) { ITransaction transaction = (ITransaction) element; Transaction t = transaction.getNative(); return TransactionTypes.getTransactionType(t); }