33/*
44 Part of the Processing project - http://processing.org
55
6- Copyright (c) 2013-22 The Processing Foundation
6+ Copyright (c) 2013-23 The Processing Foundation
77 Copyright (c) 2011-12 Ben Fry and Casey Reas
88
99 This program is free software; you can redistribute it and/or modify
4444
4545public class ListPanel extends JPanel implements Scrollable {
4646 ContributionTab contributionTab ;
47- // static public Comparator<Contribution> COMPARATOR =
48- // Comparator.comparing(o -> o.getName().toLowerCase());
49- // TreeMap<Contribution, StatusPanelDetail> detailForContrib =
50- // new TreeMap<>(ContributionListing.COMPARATOR);
51- // TreeMap<Contribution, StatusPanelDetail> detailForContrib =
52- // new TreeMap<>(Comparator.comparing(o -> o.getName().toLowerCase()));
5347 Map <Contribution , StatusDetail > detailForContrib =
5448 new ConcurrentHashMap <>();
5549
@@ -97,17 +91,6 @@ public ListPanel(final ContributionTab contributionTab,
9791 this .contributionTab = contributionTab ;
9892 this .filter = filter ;
9993
100- this .rowFilter = new ContributionRowFilter (filter );
101-
102- // if (upToDateIcon == null) {
103- // upToDateIcon = Toolkit.getLibIconX("manager/up-to-date");
104- // updateAvailableIcon = Toolkit.getLibIconX("manager/update-available");
105- // incompatibleIcon = Toolkit.getLibIconX("manager/incompatible");
106- // foundationIcon = Toolkit.getLibIconX("icons/foundation", 16);
107- // downloadingIcon = Toolkit.getLibIconX("manager/downloading");
108- // }
109-
110- setOpaque (true );
11194 model = new ContributionTableModel (columns );
11295 model .enableSections (enableSections );
11396 table = new JTable (model ) {
@@ -181,7 +164,8 @@ public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boole
181164
182165 sorter = new TableRowSorter <>(model );
183166 table .setRowSorter (sorter );
184- sorter .setRowFilter (this .rowFilter );
167+ rowFilter = new ContributionRowFilter (filter );
168+ sorter .setRowFilter (rowFilter );
185169 for (int i = 0 ; i < model .getColumnCount (); i ++) {
186170 if (model .columns [i ] == ContributionColumn .NAME ) {
187171 sorter .setSortKeys (Collections .singletonList (new SortKey (i , SortOrder .ASCENDING )));
@@ -193,6 +177,7 @@ public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boole
193177 table .getTableHeader ().setResizingAllowed (true );
194178 table .setVisible (true );
195179
180+ setOpaque (true );
196181 setLayout (new BorderLayout ());
197182 add (scrollPane , BorderLayout .CENTER );
198183 }
@@ -362,12 +347,16 @@ public Component getTableCellRendererComponent(JTable table, Object value,
362347 Contribution contribution = (Contribution ) value ;
363348 JLabel label = new JLabel ();
364349 ContributionColumn col = model .columns [column ];
350+ /*
351+ // Removing this workaround for 4.1.2; likely fixed by change
352+ // for the concurrent Set used with allContributions list.
365353 if (value == null) {
366354 // Working on https://github.com/processing/processing/issues/3667
367355 //System.err.println("null value seen in getTableCellRendererComponent()");
368356 // TODO this is now working, but the underlying issue is not fixed
369357 return label;
370358 }
359+ */
371360
372361 label .setOpaque (true );
373362
0 commit comments