Bug 313697 [Forms] Wrong code in org.eclipse.ui.forms.widgets.SizeCache
Build Identifier: 20100218-1602 package org.eclipse.ui.forms.widgets; import java.util.List; // should be org.eclipse.swt.widgets.List ............ static boolean independentLengthAndWidth(Control control) { if (control == null || control.isDisposed()) { return true; } if (control instanceof Button || control instanceof ProgressBar || control instanceof Sash || control instanceof Scale || control instanceof Slider || control instanceof List /*** here used List ***/ || control instanceof Combo || control instanceof Tree) { return true; } if (control instanceof Label || control instanceof Text) { return (control.getStyle() & SWT.WRAP) == 0; } // Unless we're certain that the control has this property, we should // return false. return false; } Reproducible: Always Steps to Reproduce: ...
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/SizeCache.java
if (control instanceof Scrollable) {
            
            Scrollable scrollable = (Scrollable) control;
            Rectangle trim = scrollable.computeTrim(0, 0, 0, 0);
            widthAdjustment = trim.width;
            heightAdjustment = trim.height;
        } else {
            
            widthAdjustment = control.getBorderWidth() * 2;
            heightAdjustment = widthAdjustment;
        }
    }
    private Point controlComputeSize(int widthHint, int heightHint) {
        Point result = control.computeSize(widthHint, heightHint, flushChildren);
        flushChildren = false;
        
        return result;
    }
    /**
     * Returns true only if the control will return a constant height for any
     * width hint larger than the preferred width. Returns false if there is
     * any situation in which the control does not have this property.
     * 
     * <p>
     * Note: this method is only important for wrapping controls, and it can
     * safely return false for anything else. AFAIK, all SWT controls have this
     * property, but to be safe they will only be added to the list once the
     * property has been confirmed.
     * </p> 
     *