private void selectTLogMatchingSequence(TransactionTableModel transactionTableModel, int sequenceNumber, JTable table) {
int startIndex = table.getSelectedRow() + 1;
Number sequence = sequenceNumber;
for (int i = startIndex; i < transactionTableModel.getRowCount(); i++) {
JournalRecord tlog = transactionTableModel.getRow(i);
if (sequence.equals(tlog.getRecordProperties().get("sequenceNumber"))) {
selectTableRow(table, i);
return;
}
}
// if it is not found, search starting back at the beginning of the list up to where we previously started
if (startIndex > 0) {
for (int i = 0; i < startIndex; i++) {
JournalRecord tlog = transactionTableModel.getRow(i);
if (sequence.equals(tlog.getRecordProperties().get("sequenceNumber"))) {
selectTableRow(table, i);
return;
}
}
}