javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java
changeset 26 dc7c549001d5
parent 23 98ccebc37403
child 35 85266cc22c7f
child 59 e5618cc85d74
equal deleted inserted replaced
23:98ccebc37403 26:dc7c549001d5
   448     protected void addHeader(
   448     protected void addHeader(
   449         String aTitle, InstallInfo aInstallInfo, UninstallInfo aUninstallInfo,
   449         String aTitle, InstallInfo aInstallInfo, UninstallInfo aUninstallInfo,
   450         boolean aSecurityButton)
   450         boolean aSecurityButton)
   451     {
   451     {
   452         // Add title.
   452         // Add title.
   453         String title = "Install?";
   453         String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY);
   454         if (aInstallInfo != null)
   454         if (aInstallInfo != null)
   455         {
   455         {
   456             if (aInstallInfo.getOldVersion() != null)
   456             if (aInstallInfo.getOldVersion() != null)
   457             {
   457             {
   458                 title = "Update?";
   458                 title = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY);
   459             }
   459             }
   460             iCertificates = aInstallInfo.getCertificates();
   460             iCertificates = aInstallInfo.getCertificates();
   461         }
   461         }
   462         if (aUninstallInfo != null)
   462         if (aUninstallInfo != null)
   463         {
   463         {
   525         {
   525         {
   526             // Nothing to add.
   526             // Nothing to add.
   527             return;
   527             return;
   528         }
   528         }
   529 
   529 
   530         // Add suite name.
   530         // Add suite name and version.
   531         createAppInfoLabel(
   531         createAppInfoLabel(
   532             aInstallInfo.getName() + " " + aInstallInfo.getVersion());
   532             InstallerUiTexts.get(
   533         // Add size.
   533                 InstallerUiTexts.SUITE_NAME,
   534         long size = 0;
   534                 new String[] { aInstallInfo.getName(),
   535         if (aInstallInfo.getJarSize() > 0)
   535                                aInstallInfo.getVersion() }));
   536         {
       
   537             size += aInstallInfo.getJarSize();
       
   538         }
       
   539         if (aInstallInfo.getDataSize() > 0)
       
   540         {
       
   541             size += aInstallInfo.getDataSize();
       
   542         }
       
   543         if (size > 0)
       
   544         {
       
   545             createAppInfoLabel(
       
   546                 InstallerUiTexts.get(
       
   547                     InstallerUiTexts.SIZE,
       
   548                     new String[] { Long.toString(1 + size/1024) }));
       
   549         }
       
   550         if (aFull)
   536         if (aFull)
   551         {
   537         {
   552             // Add vendor.
   538             // Add vendor.
   553             if (aInstallInfo.getCertificates() != null)
   539             if (aInstallInfo.getCertificates() != null)
   554             {
   540             {
   555                 // Vendor information must be displayed only for
   541                 // Vendor information must be displayed only for
   556                 // identified applications.
   542                 // identified applications.
   557                 createAppInfoLabel(
   543                 createAppInfoLabel(
   558                     InstallerUiTexts.get(
   544                     InstallerUiTexts.get(
   559                         InstallerUiTexts.VENDOR,
   545                         InstallerUiTexts.SUITE_VENDOR,
   560                         new String[] { aInstallInfo.getVendor() }));
   546                         new String[] { aInstallInfo.getVendor() }));
   561             }
   547             }
       
   548         }
       
   549         // Add size.
       
   550         long size = 0;
       
   551         if (aInstallInfo.getJarSize() > 0)
       
   552         {
       
   553             size += aInstallInfo.getJarSize();
       
   554         }
       
   555         if (aInstallInfo.getDataSize() > 0)
       
   556         {
       
   557             size += aInstallInfo.getDataSize();
       
   558         }
       
   559         if (size > 0)
       
   560         {
       
   561             createAppInfoLabel(
       
   562                 InstallerUiTexts.get(
       
   563                     InstallerUiTexts.SIZE_KB,
       
   564                     new String[] { Long.toString(1 + size/1024) }));
       
   565         }
       
   566         if (aFull)
       
   567         {
   562             // Add application names.
   568             // Add application names.
   563             ApplicationInfo[] apps = aInstallInfo.getApplications();
   569             ApplicationInfo[] apps = aInstallInfo.getApplications();
   564             if (apps != null && apps.length > 0)
   570             if (apps != null && apps.length > 0)
   565             {
   571             {
   566                 if (apps.length > 1 ||
   572                 if (apps.length > 1 ||
   567                         !aInstallInfo.getName().equals(apps[0].getName()))
   573                         !aInstallInfo.getName().equals(apps[0].getName()))
   568                 {
   574                 {
   569                     for (int i = 0; i < apps.length; i++)
   575                     for (int i = 0; i < apps.length; i++)
   570                     {
   576                     {
   571                         createAppInfoLabel(apps[i].getName());
   577                         createAppInfoLabel(
       
   578                             InstallerUiTexts.get(
       
   579                                 InstallerUiTexts.APP_NAME,
       
   580                                 new String[] { apps[i].getName() }));
   572                     }
   581                     }
   573                 }
   582                 }
   574             }
   583             }
   575         }
   584         }
   576     }
   585     }