Skip to content

Commit

Permalink
- sort entries by title
Browse files Browse the repository at this point in the history
  • Loading branch information
derreisende77 committed Oct 26, 2024
1 parent 0c5a444 commit d1e0f88
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeSelectionModel;
import java.awt.*;
import java.util.Comparator;
import java.util.List;

/**
Expand All @@ -32,7 +33,7 @@ public FilmDuplicateOverviewDialog(Window owner) {
initComponents();
EscapeKeyHandler.installHandler(this, this::dispose);

okButton.addActionListener(e -> dispose());
okButton.addActionListener(_ -> dispose());
//must be called for tooltips working
ToolTipManager.sharedInstance().registerComponent(tree);

Expand All @@ -54,7 +55,7 @@ public FilmDuplicateOverviewDialog(Window owner) {
var selectionModel = tree.getSelectionModel();
selectionModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setCellRenderer(new CustomTreeCellRenderer());
selectionModel.addTreeSelectionListener(e -> {
selectionModel.addTreeSelectionListener(_ -> {
var node = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
if (node == null)
return;
Expand Down Expand Up @@ -121,6 +122,7 @@ private DefaultMutableTreeNode getDuplicatesForSender(String sender)
var list = Daten.getInstance().getListeFilme().parallelStream()
.filter(DatenFilm::isDuplicate)
.filter(f -> f.getSender().equals(sender))
.sorted(Comparator.comparing(DatenFilm::getTitle))
.toList();
//System.out.println("List size: " + list.size() + " for sender: " + sender);
for (var f : list) {
Expand Down

0 comments on commit d1e0f88

Please sign in to comment.