1 11 12 package org.eclipse.ui.internal.layout; 13 14 import org.eclipse.swt.graphics.Rectangle; 15 import org.eclipse.swt.widgets.Composite; 16 import org.eclipse.swt.widgets.Control; 17 import org.eclipse.swt.widgets.Layout; 18 import org.eclipse.swt.widgets.Shell; 19 20 25 public class LayoutUtil { 26 27 33 public static void resize(Control changedControl) { 34 Composite parent = changedControl.getParent(); 35 36 Layout parentLayout = parent.getLayout(); 37 38 if (parentLayout instanceof ICachingLayout) { 39 ((ICachingLayout) parentLayout).flush(changedControl); 40 } 41 42 if (parent instanceof Shell) { 43 parent.layout(true); 44 } else { 45 Rectangle currentBounds = parent.getBounds(); 46 47 resize(parent); 48 49 if (currentBounds.equals(parent.getBounds())) { 52 parent.layout(true); 53 } 54 } 55 } 56 } 57 | Popular Tags |