78 |
78 |
79 // Add header. |
79 // Add header. |
80 if (iInstallerUi != null && iInstallerUi.getInstallInfo() != null) |
80 if (iInstallerUi != null && iInstallerUi.getInstallInfo() != null) |
81 { |
81 { |
82 // Add header. |
82 // Add header. |
83 addHeader(aMsg, iInstallerUi.getInstallInfo(), null); |
83 addHeader(aMsg, iInstallerUi.getInstallInfo(), null, false); |
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"); |
|
90 } |
89 } |
91 |
90 |
92 iIndeterminate = aIndeterminate; |
91 iIndeterminate = aIndeterminate; |
93 if (iIndeterminate) |
92 if (iIndeterminate) |
94 { |
93 { |
101 (getComposite(), SWT.SMOOTH | SWT.HORIZONTAL); |
100 (getComposite(), SWT.SMOOTH | SWT.HORIZONTAL); |
102 iProgressBar.setMinimum(0); |
101 iProgressBar.setMinimum(0); |
103 iProgressBar.setMaximum(100); |
102 iProgressBar.setMaximum(100); |
104 iProgressBar.setSelection(iValue); |
103 iProgressBar.setSelection(iValue); |
105 } |
104 } |
106 setCssId(iProgressBar, "progressBar"); |
|
107 GridData gridData = new GridData(GridData.FILL_HORIZONTAL); |
105 GridData gridData = new GridData(GridData.FILL_HORIZONTAL); |
108 gridData.horizontalSpan = getColumns(); |
106 gridData.horizontalSpan = getColumns(); |
109 iProgressBar.setLayoutData(gridData); |
107 iProgressBar.setLayoutData(gridData); |
110 |
108 |
111 // After other widgets have been added, add content to |
109 // After other widgets have been added, add content to |
115 addAppInfo(iInstallerUi.getInstallInfo(), false); |
113 addAppInfo(iInstallerUi.getInstallInfo(), false); |
116 } |
114 } |
117 |
115 |
118 // By default add cancel command to all progress bars. |
116 // By default add cancel command to all progress bars. |
119 addCancelCommand(); |
117 addCancelCommand(); |
120 |
|
121 iInstallerUi.loadCss(); |
|
122 } |
118 } |
123 |
119 |
124 /** Update text for this progress bar. */ |
120 /** Update text for this progress bar. */ |
125 public void setText(String aText) |
121 public void setText(String aText) |
126 { |
122 { |
171 // UI updates must be executed in UI thread. |
167 // UI updates must be executed in UI thread. |
172 getDisplay().syncExec(new Runnable() |
168 getDisplay().syncExec(new Runnable() |
173 { |
169 { |
174 public void run() |
170 public void run() |
175 { |
171 { |
176 // Set horizontalSpan to 2 for one button, |
|
177 // and to 1 for two buttons. |
|
178 int horizontalSpan = 1; |
|
179 GridData gridData = null; |
|
180 iHideCommand = new Button(getCommandComposite(), SWT.PUSH); |
172 iHideCommand = new Button(getCommandComposite(), SWT.PUSH); |
181 setCssId(iHideCommand, "softKeyButton"); |
173 GridData gridData = new GridData(GridData.FILL_HORIZONTAL); |
182 gridData = new GridData(GridData.FILL_HORIZONTAL); |
174 gridData.horizontalSpan = 1; |
183 gridData.horizontalSpan = horizontalSpan; |
|
184 iHideCommand.setLayoutData(gridData); |
175 iHideCommand.setLayoutData(gridData); |
185 iHideCommand.setText(InstallerUiTexts.get(InstallerUiTexts.HIDE)); |
176 iHideCommand.setText(InstallerUiTexts.get(InstallerUiTexts.HIDE)); |
186 iHideCommand.addSelectionListener(new SelectionListener() |
177 iHideCommand.addSelectionListener |
|
178 (new SelectionListener() |
187 { |
179 { |
188 public void widgetDefaultSelected(SelectionEvent aEvent) |
180 public void widgetDefaultSelected(SelectionEvent aEvent) |
189 { |
181 { |
190 widgetSelected(aEvent); |
182 widgetSelected(aEvent); |
191 } |
183 } |
195 } |
187 } |
196 }); |
188 }); |
197 addSoftKeyListenerFor(iHideCommand); |
189 addSoftKeyListenerFor(iHideCommand); |
198 |
190 |
199 iCancelCommand = new Button(getCommandComposite(), SWT.PUSH); |
191 iCancelCommand = new Button(getCommandComposite(), SWT.PUSH); |
200 setCssId(iCancelCommand, "softKeyButton"); |
|
201 //setCssId(iCancelCommand, "softKeyButtonWide"); |
|
202 gridData = new GridData(GridData.FILL_HORIZONTAL); |
192 gridData = new GridData(GridData.FILL_HORIZONTAL); |
203 gridData.horizontalSpan = horizontalSpan; |
193 gridData.horizontalSpan = 1; |
204 iCancelCommand.setLayoutData(gridData); |
194 iCancelCommand.setLayoutData(gridData); |
205 iCancelCommand.setText( |
195 iCancelCommand.setText( |
206 InstallerUiTexts.get(InstallerUiTexts.CANCEL)); |
196 InstallerUiTexts.get(InstallerUiTexts.CANCEL)); |
207 iCancelCommand.addSelectionListener(new SelectionListener() |
197 iCancelCommand.addSelectionListener |
|
198 (new SelectionListener() |
208 { |
199 { |
209 public void widgetDefaultSelected(SelectionEvent aEvent) |
200 public void widgetDefaultSelected(SelectionEvent aEvent) |
210 { |
201 { |
211 widgetSelected(aEvent); |
202 widgetSelected(aEvent); |
212 } |
203 } |