change up StatusPanelDetail constructor to clean up accessors

This commit is contained in:
Ben Fry
2022-03-12 21:33:56 -05:00
parent 92550dbc94
commit d4a3db7a90
3 changed files with 17 additions and 6 deletions
@@ -574,7 +574,9 @@ implements Scrollable, ContributionListing.ChangeListener {
if (!detailForContrib.containsKey(contribution)) {
// new Exception().printStackTrace(System.out);
// long t1 = System.currentTimeMillis();
StatusPanelDetail newPanel = new StatusPanelDetail(this);
//StatusPanelDetail newPanel = new StatusPanelDetail(this);
StatusPanelDetail newPanel =
new StatusPanelDetail(contributionTab.base, contributionTab.statusPanel);
detailForContrib.put(contribution, newPanel);
newPanel.setContrib(contribution);
// add(newPanel);
@@ -39,7 +39,9 @@ import processing.app.ui.Toolkit;
* has only been used to track install/remove state information.
*/
class StatusPanelDetail {
private final ListPanel listPanel;
//private final ListPanel listPanel;
Base base;
StatusPanel statusPanel;
static private final int BUTTON_WIDTH = Toolkit.zoom(100);
@@ -52,10 +54,14 @@ class StatusPanelDetail {
boolean removeInProgress;
StatusPanelDetail(ListPanel contributionListPanel) {
//StatusPanelDetail(ContributionTab contributionTab) {
StatusPanelDetail(Base base, StatusPanel statusPanel) {
// System.out.println("DetailPanel.<init>");
// new Exception().printStackTrace(System.out);
listPanel = contributionListPanel;
// listPanel = contributionListPanel;
this.base = base;
this.statusPanel = statusPanel;
}
@@ -316,12 +322,14 @@ class StatusPanelDetail {
// though, is that the functions being called in Base are somewhat suspect
// since they're contribution-related, and should perhaps live closer.
private Base getBase() {
return listPanel.contributionTab.base; // TODO this is gross [fry]
//return listPanel.contributionTab.base; // TODO this is gross [fry]
return base;
}
private StatusPanel getStatusPanel() {
return listPanel.contributionTab.statusPanel; // TODO this is also gross
//return listPanel.contributionTab.statusPanel; // TODO this is also gross
return statusPanel;
}
+1
View File
@@ -52,6 +52,7 @@ X all that was left was maintenance of when that's been set, so...
X allow update of the current Mode
X if doing an update (not just delete), close sketches and re-open
X if doing a delete, require sketches to be closed
X change up StatusPanelDetail constructor to clean up accessors
_ after failed update of Mode, the button is no longer available