MCPcopy Index your code
hub / github.com/benfry/processing4 / applyDetail

Method applyDetail

app/src/processing/app/contrib/StatusPanel.java:395–461  ·  view source on GitHub ↗
(StatusDetail detail)

Source from the content-addressed store, hash-verified

393
394
395 protected void applyDetail(StatusDetail detail) {
396// System.out.println("rebuilding status detail for " + detail.getContrib().name);
397// new Exception("rebuilding status detail for " + detail.getContrib().name).printStackTrace(System.out);
398 Contribution contrib = detail.getContrib();
399
400 iconLabel.setIcon(contrib.isFoundation() ? foundationIcon : null);
401 label.setText(updateDescription(contrib));
402 ((HTMLDocument) label.getDocument()).getStyleSheet().addRule(detailStyle);
403
404 ContributionListing listing = ContributionListing.getInstance();
405
406 updateButton.setEnabled((listing.hasUpdates(contrib) &&
407 !contrib.isUpdateFlagged()) &&
408 !detail.updateInProgress);
409
410 String latestVersion = listing.getLatestPrettyVersion(contrib);
411 String currentVersion = contrib.getPrettyVersion();
412
413 installButton.setEnabled(!contrib.isInstalled() &&
414 contrib.isCompatible() &&
415 !detail.installInProgress);
416
417 if (contrib.isCompatible()) {
418 if (installButton.isEnabled()) {
419 if (latestVersion != null) {
420 updateLabel.setText(latestVersion + " available");
421 } else {
422 updateLabel.setText("Available");
423 }
424 } else { // install disabled
425 if (currentVersion != null) {
426 updateLabel.setText(currentVersion + " installed");
427 } else {
428 updateLabel.setText("Installed");
429 }
430 }
431 } else { // contrib not compatible
432 if (currentVersion != null) {
433 updateLabel.setText(currentVersion + " not compatible");
434 } else {
435 updateLabel.setText("Not compatible");
436 }
437 }
438
439 if (updateButton.isEnabled() && latestVersion != null) {
440 updateButton.setText("Update to " + latestVersion);
441 } else {
442 updateButton.setText("Update");
443 }
444
445 removeButton.setEnabled(contrib.isInstalled() && !detail.removeInProgress);
446
447 if (detail.updateInProgress || detail.installInProgress || detail.removeInProgress) {
448// progressBar.setUI(new PdeProgressBarUI("manager.progress"));
449// System.out.println(progressBar.getUI());
450// ((PdeProgressBarUI) progressBar.getUI()).updateTheme();
451 progressBar.setVisible(true);
452// System.out.println(progressBar.getUI());

Callers 3

buildLayoutMethod · 0.95
updateThemeMethod · 0.95
setSelectedDetailMethod · 0.45

Calls 15

isFoundationMethod · 0.95
updateDescriptionMethod · 0.95
getInstanceMethod · 0.95
hasUpdatesMethod · 0.95
isUpdateFlaggedMethod · 0.95
getPrettyVersionMethod · 0.95
isInstalledMethod · 0.95
isCompatibleMethod · 0.95
getContribMethod · 0.80
getStyleSheetMethod · 0.80
setProgressBarMethod · 0.80

Tested by

no test coverage detected