javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ProgressView.java
branchRCL_3
changeset 60 6c158198356e
parent 25 9ac0a0a7da70
child 67 63b81d807542
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
    84         }
    84         }
    85         else
    85         else
    86         {
    86         {
    87             setTitle(iMsg);
    87             setTitle(iMsg);
    88             iLabel = createLabel(iMsg, SWT.WRAP);
    88             iLabel = createLabel(iMsg, SWT.WRAP);
       
    89             setCssId(iLabel, "heading");
    89         }
    90         }
    90 
    91 
    91         iIndeterminate = aIndeterminate;
    92         iIndeterminate = aIndeterminate;
    92         if (iIndeterminate)
    93         if (iIndeterminate)
    93         {
    94         {
   100             (getComposite(), SWT.SMOOTH | SWT.HORIZONTAL);
   101             (getComposite(), SWT.SMOOTH | SWT.HORIZONTAL);
   101             iProgressBar.setMinimum(0);
   102             iProgressBar.setMinimum(0);
   102             iProgressBar.setMaximum(100);
   103             iProgressBar.setMaximum(100);
   103             iProgressBar.setSelection(iValue);
   104             iProgressBar.setSelection(iValue);
   104         }
   105         }
       
   106         setCssId(iProgressBar, "progressBar");
   105         GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
   107         GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
   106         gridData.horizontalSpan = getColumns();
   108         gridData.horizontalSpan = getColumns();
   107         iProgressBar.setLayoutData(gridData);
   109         iProgressBar.setLayoutData(gridData);
   108 
   110 
   109         // After other widgets have been added, add content to
   111         // After other widgets have been added, add content to
   113             addAppInfo(iInstallerUi.getInstallInfo(), false);
   115             addAppInfo(iInstallerUi.getInstallInfo(), false);
   114         }
   116         }
   115 
   117 
   116         // By default add cancel command to all progress bars.
   118         // By default add cancel command to all progress bars.
   117         addCancelCommand();
   119         addCancelCommand();
       
   120 
       
   121         iInstallerUi.loadCss();
   118     }
   122     }
   119 
   123 
   120     /** Update text for this progress bar. */
   124     /** Update text for this progress bar. */
   121     public void setText(String aText)
   125     public void setText(String aText)
   122     {
   126     {
   167         // UI updates must be executed in UI thread.
   171         // UI updates must be executed in UI thread.
   168         getDisplay().syncExec(new Runnable()
   172         getDisplay().syncExec(new Runnable()
   169         {
   173         {
   170             public void run()
   174             public void run()
   171             {
   175             {
       
   176                 // Set horizontalSpan to 2 for one button,
       
   177                 // and to 1 for one two buttons.
       
   178                 int horizontalSpan = 2;
       
   179                 GridData gridData = null;
       
   180                 /*
   172                 iHideCommand = new Button(getCommandComposite(), SWT.PUSH);
   181                 iHideCommand = new Button(getCommandComposite(), SWT.PUSH);
   173                 GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
   182                 setCssId(iHideCommand, "softKeyButton");
   174                 gridData.horizontalSpan = 1;
   183                 gridData = new GridData(GridData.FILL_HORIZONTAL);
       
   184                 gridData.horizontalSpan = horizontalSpan;
   175                 iHideCommand.setLayoutData(gridData);
   185                 iHideCommand.setLayoutData(gridData);
   176                 iHideCommand.setText(InstallerUiTexts.get(InstallerUiTexts.HIDE));
   186                 iHideCommand.setText(InstallerUiTexts.get(InstallerUiTexts.HIDE));
   177                 iHideCommand.addSelectionListener
   187                 iHideCommand.addSelectionListener(new SelectionListener()
   178                 (new SelectionListener()
       
   179                 {
   188                 {
   180                     public void widgetDefaultSelected(SelectionEvent aEvent)
   189                     public void widgetDefaultSelected(SelectionEvent aEvent)
   181                     {
   190                     {
   182                         widgetSelected(aEvent);
   191                         widgetSelected(aEvent);
   183                     }
   192                     }
   185                     {
   194                     {
   186                         confirmHide();
   195                         confirmHide();
   187                     }
   196                     }
   188                 });
   197                 });
   189                 addSoftKeyListenerFor(iHideCommand);
   198                 addSoftKeyListenerFor(iHideCommand);
       
   199                 */
   190 
   200 
   191                 iCancelCommand = new Button(getCommandComposite(), SWT.PUSH);
   201                 iCancelCommand = new Button(getCommandComposite(), SWT.PUSH);
       
   202                 setCssId(iCancelCommand, "softKeyButtonWide");
   192                 gridData = new GridData(GridData.FILL_HORIZONTAL);
   203                 gridData = new GridData(GridData.FILL_HORIZONTAL);
   193                 gridData.horizontalSpan = 1;
   204                 gridData.horizontalSpan = horizontalSpan;
   194                 iCancelCommand.setLayoutData(gridData);
   205                 iCancelCommand.setLayoutData(gridData);
   195                 iCancelCommand.setText(
   206                 iCancelCommand.setText(
   196                     InstallerUiTexts.get(InstallerUiTexts.CANCEL));
   207                     InstallerUiTexts.get(InstallerUiTexts.CANCEL));
   197                 iCancelCommand.addSelectionListener
   208                 iCancelCommand.addSelectionListener(new SelectionListener()
   198                 (new SelectionListener()
       
   199                 {
   209                 {
   200                     public void widgetDefaultSelected(SelectionEvent aEvent)
   210                     public void widgetDefaultSelected(SelectionEvent aEvent)
   201                     {
   211                     {
   202                         widgetSelected(aEvent);
   212                         widgetSelected(aEvent);
   203                     }
   213                     }
   232         (new Runnable()
   242         (new Runnable()
   233         {
   243         {
   234             public void run()
   244             public void run()
   235             {
   245             {
   236                 getShell().setDefaultButton(null);
   246                 getShell().setDefaultButton(null);
   237                 iHideCommand.dispose();
   247                 if (iHideCommand != null)
   238                 iHideCommand = null;
   248                 {
       
   249                     iHideCommand.dispose();
       
   250                     iHideCommand = null;
       
   251                 }
   239                 iCancelCommand.dispose();
   252                 iCancelCommand.dispose();
   240                 iCancelCommand = null;
   253                 iCancelCommand = null;
   241             }
   254             }
   242         });
   255         });
   243     }
   256     }