(StatusDetail detail)
| 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()); |
no test coverage detected