@@ -0,0 +1,1334 @@
+/*******************************************************************************%0A * Copyright (c) 2015-2017 Pivotal, Inc.%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A *%0A * Contributors:%0A *     Pivotal, Inc. - initial API and implementation%0A *******************************************************************************/%0Apackage org.springsource.ide.eclipse.commons.livexp.ui.util;%0A%0Aimport org.eclipse.swt.widgets.Control;%0Aimport org.springsource.ide.eclipse.commons.livexp.ui.IPageWithSections;%0Aimport org.springsource.ide.eclipse.commons.livexp.ui.Reflowable;%0A%0A/**%0A * @author Kris De Volder%0A */%0Apublic class ReflowUtil %7B%0A%0A%09public static void reflow(IPageWithSections owner, Control changed) %7B%0A%09%09boolean reflowed = findAndReflowControl(changed);%0A%09%09if (!reflowed && owner instanceof Reflowable) %7B%0A%09%09%09((Reflowable) owner).reflow();%0A%09%09%7D%0A%09%7D%0A%0A%09public static boolean findAndReflowControl(Control control) %7B%0A%09%09while (control!=null) %7B%0A%09%09%09if (control instanceof Reflowable) %7B%0A%09%09%09%09if (((Reflowable)control).reflow()) %7B%0A%09%09%09%09%09return true;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09control = control.getParent();%0A%09%09%7D%0A%09%09//No Reflowable found. Sorry!%0A%09%09return false;%0A%09%7D%0A%0A%7D%0A

Move ReflowUtil to commons for broader reuse.