Added filtering in the history table#94
Conversation
5b26de1 to
49d6553
Compare
| private void initSearchItemDropdown() { | ||
| searchItem.setItems(FXCollections.observableArrayList( | ||
| "Type", | ||
| "Date", |
| completeTransactionList = new ArrayList<>(transactions); | ||
| txTable.setItems(FXCollections.observableList(transactions)); | ||
| }, | ||
| getEmptyEvent(), null |
There was a problem hiding this comment.
why null? this will throw NPE if task is cancelled, no?
| event -> txTable.setItems(FXCollections.observableList(getTransactionsTask.getValue())), | ||
| getErrorEvent(t -> {}, getTransactionsTask), | ||
| getEmptyEvent() | ||
| event -> { |
There was a problem hiding this comment.
it would be nice to have a method that returns an event here
| }); | ||
| } | ||
|
|
||
| private boolean anyFieldHasString(TxRow s, String newValue) { |
There was a problem hiding this comment.
final params?
since you're matching strings only with selected searchItem maybe this could have a better name
| txTable.setContextMenu(menu); | ||
|
|
||
|
|
||
| searchField.textProperty().addListener((observable, oldValue, newValue) -> { |
There was a problem hiding this comment.
we should add this listener to the drop-down field as well, albeit it will probably have a different filtering predicate
|
|
||
|
|
||
| searchField.textProperty().addListener((observable, oldValue, newValue) -> { | ||
| FilteredList<TxRow> filteredData = new FilteredList(FXCollections.observableList(completeTransactionList), s -> true); |
There was a problem hiding this comment.
this row can be final FilteredList<TxRow> filteredData = new FilteredList<> (FXCollections.observableList(completeTransactionList));
since you add the filer predicate in the conditional block below anyway
No description provided.