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
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.internal.forms.widgets.FormUtil;
/**
 * Caches the preferred size of an SWT control
 * 
 * @since 3.0
 */
public class SizeCache {
    private Control control;
    private Point preferredSize;
    private int cachedWidthQuery;
    private int cachedWidthResult;
    private int cachedHeightQuery;
    private int cachedHeightResult;
    
    private int minimumWidth;
    private int heightAtMinimumWidth = -1;
    private int maximumWidth;
    
    /**
     * True iff we should recursively flush all children on the next layout
     */
    private boolean flushChildren;
    /**
     * True iff changing the height hint does not affect the preferred width and changing
     * the width hint does not change the preferred height
     */
    private boolean independentDimensions = false;
    /**
     * True iff the preferred height for any hint larger than the preferred width will not