home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 January / PCO0198.ISO / browser / net_linx / java40.jar / netscape / softupdate / ProgressMediator.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-03  |  3.1 KB  |  129 lines

  1. package netscape.softupdate;
  2.  
  3. import java.awt.Event;
  4. import java.util.Enumeration;
  5.  
  6. class ProgressMediator {
  7.    private ProgressWindow progress;
  8.    private ProgressDetails details;
  9.    // $FF: renamed from: su netscape.softupdate.SoftwareUpdate
  10.    private SoftwareUpdate field_0;
  11.  
  12.    ProgressMediator(SoftwareUpdate var1) {
  13.       this.field_0 = var1;
  14.       this.progress = null;
  15.       this.details = null;
  16.    }
  17.  
  18.    protected void finalize() throws Throwable {
  19.       this.CleanUp();
  20.    }
  21.  
  22.    private void CleanUp() {
  23.       if (this.progress != null) {
  24.          this.progress.hide();
  25.          this.progress.dispose();
  26.       }
  27.  
  28.       if (this.details != null) {
  29.          this.details.btnCancel_Clicked((Event)null);
  30.       }
  31.  
  32.       this.progress = null;
  33.       this.details = null;
  34.       this.field_0 = null;
  35.    }
  36.  
  37.    private void ShowProgress() {
  38.       if (!this.field_0.GetSilent()) {
  39.          if (this.progress == null) {
  40.             this.progress = new ProgressWindow(this);
  41.          }
  42.  
  43.          this.progress.toFront();
  44.          this.progress.show();
  45.          this.progress.toFront();
  46.       }
  47.    }
  48.  
  49.    private void ShowDetails() {
  50.       if (!this.field_0.GetSilent()) {
  51.          if (this.details == null) {
  52.             this.details = new ProgressDetails(this);
  53.             this.details.setTitle(Strings.details_WinTitle() + this.field_0.GetUserPackageName());
  54.             this.details.label1.setText(Strings.details_Explain(this.field_0.GetUserPackageName()));
  55.             Enumeration var1 = this.field_0.GetInstallQueue();
  56.  
  57.             while(var1.hasMoreElements()) {
  58.                InstallObject var2 = (InstallObject)var1.nextElement();
  59.                this.details.detailArea.appendText(var2.toString() + "\n");
  60.             }
  61.  
  62.             this.details.show();
  63.          }
  64.  
  65.          this.details.toFront();
  66.       }
  67.    }
  68.  
  69.    protected void DetailsHidden() {
  70.       this.details = null;
  71.    }
  72.  
  73.    protected void UserCancelled() {
  74.       if (this.field_0 != null) {
  75.          this.field_0.UserCancelled();
  76.       }
  77.  
  78.    }
  79.  
  80.    protected void UserApproved() {
  81.       if (this.field_0 != null) {
  82.          this.field_0.UserApproved();
  83.       }
  84.  
  85.    }
  86.  
  87.    protected void MoreInfo() {
  88.       this.ShowDetails();
  89.    }
  90.  
  91.    protected void StartInstall() {
  92.       this.ShowProgress();
  93.       if (this.progress != null) {
  94.          this.progress.setTitle(Strings.progress_Title() + this.field_0.GetUserPackageName());
  95.          this.progress.status.setText(Strings.progress_GettingReady() + this.field_0.GetUserPackageName());
  96.          this.progress.progress.setText("");
  97.          this.progress.install.disable();
  98.       }
  99.  
  100.    }
  101.  
  102.    protected void ConfirmWithUser() {
  103.       this.ShowProgress();
  104.       if (this.progress != null) {
  105.          this.progress.progress.setText("");
  106.          this.progress.status.setText(Strings.progress_ReadyToInstall1() + this.field_0.GetUserPackageName());
  107.          this.progress.install.enable();
  108.       } else {
  109.          this.UserApproved();
  110.       }
  111.    }
  112.  
  113.    protected void ScheduleForInstall(InstallObject var1) {
  114.       String var2 = var1.toString();
  115.       if (this.progress != null) {
  116.          this.progress.progress.setText(var2);
  117.       }
  118.  
  119.       if (this.details != null) {
  120.          this.details.detailArea.appendText(var2 + "\n");
  121.       }
  122.  
  123.    }
  124.  
  125.    void Complete() {
  126.       this.CleanUp();
  127.    }
  128. }
  129.