Skip to content

Commit

Permalink
Merge pull request #288 from DropSnorz/fix/table-column-sort
Browse files Browse the repository at this point in the history
Sort plugin table using column headers
  • Loading branch information
DropSnorz authored Jan 17, 2025
2 parents ed70388 + ce75fb2 commit 1cae863
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
import javafx.collections.transformation.SortedList;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.MenuItem;
import javafx.scene.control.SeparatorMenuItem;
Expand Down Expand Up @@ -94,7 +95,9 @@ public PluginTableController() {
search.getValue().toLowerCase()));
}, search));

tableView.setItems(filteredPluginList);
SortedList<Plugin> sortedPluginList = new SortedList<>(filteredPluginList);
tableView.setItems(sortedPluginList);
sortedPluginList.comparatorProperty().bind(tableView.comparatorProperty());

}

Expand Down

0 comments on commit 1cae863

Please sign in to comment.