Community
Participate
Working Groups
*/
public Point computeSize(int widthHint, int heightHint) {
if (childControl != null) {
// Fix for bug 85899 [Perspectives] [RCP]Standalone view does not divide space in
// proper ratio with reference when added to IPageLayout with showTitle parameter false
// If the childControl is a content proxy (a Composite with no children -- see PresentablePartFolder constructor),
// then computeSize returns 64x64, which is inappropriate.
// Note that this happens even if the Composite has a Layout that returns 0@0.
// Instead, use the sizes of the margins. This is equivalent to calling control.computeSize(...)
// if the childControl returned 0@0 for its preferred size.
if (childControl instanceof Composite) {
Composite composite = (Composite) childControl;
if (composite.getChildren().length == 0) {
EnhancedFillLayout layout = (EnhancedFillLayout) control.getLayout();
int w = widthHint == SWT.DEFAULT ? layout.xmargin * 2 : widthHint;
int h = heightHint == SWT.DEFAULT ? layout.ymargin * 2 : heightHint;
return new Point(w, h);
}
return childControl.computeSize(widthHint, heightHint);
return new Point(0,0);
//toolbarProxy = new ProxyControl(folder.getToolbarParent());
// NOTE: if the shape of contentProxy changes, the fix for bug 85899 in EmptyTabFolder.computeSize may need adjustment.
contentProxy = new Composite(folder.getContentParent(), SWT.NONE);
contentProxy.setVisible(false);
for (Control current = contentProxy; current != folder.getControl().getParent(); current = current.getParent()) {