more cleaning; me head hurts

This commit is contained in:
Ben Fry
2022-05-07 12:59:34 -04:00
parent 33b0a0b061
commit 2b60357202
4 changed files with 7 additions and 11 deletions

View File

@@ -343,9 +343,7 @@ public class ContributionTab extends JPanel {
protected void updateAll() {
Collection<StatusDetail> collection =
listPanel.detailForContrib.values();
for (StatusDetail detail : collection) {
for (StatusDetail detail : listPanel.detailForContrib.values()) {
detail.update();
}
listPanel.model.fireTableDataChanged();

View File

@@ -701,14 +701,14 @@ public class ListPanel extends JPanel implements Scrollable {
// System.out.println(contributionTab.contribType + " tab: " +
// "changed " + oldContrib + " -> " + newContrib);
// new Exception().printStackTrace(System.out);
StatusDetail panel = detailForContrib.get(oldContrib);
StatusDetail detail = detailForContrib.get(oldContrib);
// if (panel == null) {
//// System.out.println("panel null for " + newContrib);
// contributionAdded(newContrib);
// } else {
detailForContrib.remove(oldContrib);
panel.setContrib(newContrib);
detailForContrib.put(newContrib, panel);
detail.setContrib(newContrib);
detailForContrib.put(newContrib, detail);
model.fireTableDataChanged();
// }
}

View File

@@ -33,8 +33,9 @@ import processing.app.laf.PdeProgressBarUI;
/**
* Vestigial class that was formerly a detail panel, but since 3.x
* has only been used to track install/remove state information.
* An unfortunate mix of state information about the installation
* status of a Contribution, *as well as* the methods to handle
* installation and update of that Contribution.
*/
class StatusDetail {
private final Base base;

View File

@@ -33,15 +33,12 @@ public class UpdateStatusPanel extends StatusPanel {
public UpdateStatusPanel(UpdateContributionTab tab) {
super(tab);
//updateButton = Toolkit.createIconButton("Update All", updateIcon);
updateButton = new JButton("Update All");
// updateButton.setFont(ManagerFrame.NORMAL_PLAIN);
updateButton.setHorizontalAlignment(SwingConstants.LEFT);
updateButton.setVisible(true);
updateButton.setEnabled(false);
updateButton.addActionListener(e -> contributionTab.updateAll());
setBackground(new Color(0xebebeb));
layout = new GroupLayout(this);
setLayout(layout);