View | Details | Raw Unified | Return to bug 22621 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jface/dialogs/Dialog.java (+31 lines)
Lines 479-484 Link Here
479
	newShell.setFont(JFaceResources.getDialogFont());
479
	newShell.setFont(JFaceResources.getDialogFont());
480
}
480
}
481
481
482
/*
483
 * @see Window.initializeBounds()
484
 */
485
protected void initializeBounds() {
486
	String platform= SWT.getPlatform();
487
	if ("carbon".equals(platform)) {	//$NON-NLS-1$
488
		// On Mac OS X the default button must be the right-most button
489
		Shell shell= getShell();
490
		if (shell != null) {
491
			Button defaultButton= shell.getDefaultButton();
492
			if (defaultButton != null && isContained(buttonBar, defaultButton))
493
				defaultButton.moveBelow(null);
494
		}
495
	}
496
	super.initializeBounds();
497
}
498
499
/**
500
 * Returns true if the given Control c is a direct or indirect child of
501
 * container.
502
 */
503
private boolean isContained(Control container, Control c) {
504
	Composite parent;
505
	while ((parent= c.getParent()) != null) {
506
		if (parent == container)
507
			return true;
508
		c= parent;
509
	}
510
	return false;
511
}
512
482
/**
513
/**
483
 * The <code>Dialog</code> implementation of this <code>Window</code> method 
514
 * The <code>Dialog</code> implementation of this <code>Window</code> method 
484
 * creates and lays out the top level composite for the dialog, and
515
 * creates and lays out the top level composite for the dialog, and

Return to bug 22621