Skip to content

Commit

Permalink
Minimal code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Sep 2, 2018
1 parent 2d5908a commit b39ed7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/maintable/MainTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public MainTable(MainTableDataModel model, JabRefFrame frame,
this.setItems(model.getEntriesFilteredAndSorted());

// Enable sorting
model.bindComparator(this.comparatorProperty());
model.getEntriesFilteredAndSorted().comparatorProperty().bind(this.comparatorProperty());

this.panel = panel;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package org.jabref.gui.maintable;

import java.util.Comparator;
import java.util.List;
import java.util.Optional;

import javafx.beans.binding.Bindings;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
import javafx.collections.transformation.SortedList;
Expand Down Expand Up @@ -68,11 +66,7 @@ private Optional<MatcherSet> createGroupMatcher(List<GroupTreeNode> selectedGrou
return Optional.of(searchRules);
}

public ObservableList<BibEntryTableViewModel> getEntriesFilteredAndSorted() {
public SortedList<BibEntryTableViewModel> getEntriesFilteredAndSorted() {
return entriesSorted;
}

public void bindComparator(ReadOnlyObjectProperty<Comparator<BibEntryTableViewModel>> comparator) {
entriesSorted.comparatorProperty().bind(comparator);
}
}

0 comments on commit b39ed7b

Please sign in to comment.