Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added filtering in the history table#94

Merged
centrys-cristian-ilca merged 4 commits into
devfrom
AW-38
Jun 14, 2018
Merged

Added filtering in the history table#94
centrys-cristian-ilca merged 4 commits into
devfrom
AW-38

Conversation

@centrys-cristian-ilca
Copy link
Copy Markdown
Contributor

No description provided.

private void initSearchItemDropdown() {
searchItem.setItems(FXCollections.observableArrayList(
"Type",
"Date",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missalignment

completeTransactionList = new ArrayList<>(transactions);
txTable.setItems(FXCollections.observableList(transactions));
},
getEmptyEvent(), null
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why null? this will throw NPE if task is cancelled, no?

event -> txTable.setItems(FXCollections.observableList(getTransactionsTask.getValue())),
getErrorEvent(t -> {}, getTransactionsTask),
getEmptyEvent()
event -> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be nice to have a method that returns an event here

});
}

private boolean anyFieldHasString(TxRow s, String newValue) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) -> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@centrys-cristian-ilca centrys-cristian-ilca merged commit 6f71dad into dev Jun 14, 2018
@theotniel theotniel deleted the AW-38 branch June 15, 2018 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants