|
Lines 218-233
Link Here
|
| 218 |
} |
218 |
} |
| 219 |
|
219 |
|
| 220 |
layout.marginHeight = 0; |
220 |
layout.marginHeight = 0; |
| 221 |
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); |
221 |
layout.marginLeft = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); |
|
|
222 |
layout.marginWidth = 0; |
| 222 |
composite.setLayout(layout); |
223 |
composite.setLayout(layout); |
| 223 |
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
224 |
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 224 |
|
225 |
|
|
|
226 |
if (!fStatusLineAboveButtons && (isHelpAvailable() || TrayDialog.isDialogHelpAvailable())) { |
| 227 |
createHelpControl(composite); |
| 228 |
} |
| 225 |
fStatusLine = new MessageLine(composite); |
229 |
fStatusLine = new MessageLine(composite); |
| 226 |
fStatusLine.setAlignment(SWT.LEFT); |
230 |
fStatusLine.setAlignment(SWT.LEFT); |
| 227 |
fStatusLine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
231 |
GridData statusData = new GridData(GridData.FILL_HORIZONTAL); |
| 228 |
fStatusLine.setErrorStatus(null); |
232 |
fStatusLine.setErrorStatus(null); |
|
|
233 |
if (fStatusLineAboveButtons && (isHelpAvailable() || TrayDialog.isDialogHelpAvailable())) { |
| 234 |
statusData.horizontalSpan = 2; |
| 235 |
createHelpControl(composite); |
| 236 |
} |
| 237 |
fStatusLine.setLayoutData(statusData); |
| 229 |
applyDialogFont(composite); |
238 |
applyDialogFont(composite); |
| 230 |
super.createButtonBar(composite); |
239 |
|
|
|
240 |
/* |
| 241 |
* This code is duplicated from Dialog#createButtonBar. We do not want |
| 242 |
* to call the TrayDialog implementation because it adds a help control. |
| 243 |
* Since this is a custom button bar, we explicitly added the help control |
| 244 |
* in an appropriate place above, and we use the Dialog implementation of |
| 245 |
* createButtonBar, which does not add a help control. |
| 246 |
*/ |
| 247 |
Composite buttonComposite = new Composite(composite, SWT.NONE); |
| 248 |
// create a layout with spacing and margins appropriate for the font |
| 249 |
// size. |
| 250 |
layout = new GridLayout(); |
| 251 |
layout.numColumns = 0; // this is incremented by createButton |
| 252 |
layout.makeColumnsEqualWidth = true; |
| 253 |
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); |
| 254 |
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); |
| 255 |
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); |
| 256 |
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); |
| 257 |
buttonComposite.setLayout(layout); |
| 258 |
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END |
| 259 |
| GridData.VERTICAL_ALIGN_CENTER); |
| 260 |
buttonComposite.setLayoutData(data); |
| 261 |
buttonComposite.setFont(composite.getFont()); |
| 262 |
|
| 263 |
// Add the buttons to the button bar. |
| 264 |
createButtonsForButtonBar(buttonComposite); |
| 231 |
return composite; |
265 |
return composite; |
| 232 |
} |
266 |
} |
| 233 |
|
267 |
|