/*******************************************************************************
 * Copyright (c) 2015, 2017 Pivotal, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Pivotal, Inc. - initial API and implementation
 *******************************************************************************/
package org.springsource.ide.eclipse.commons.livexp.ui;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.widgets.SharedScrolledComposite;
import org.eclipse.ui.progress.UIJob;
import org.springsource.ide.eclipse.commons.livexp.ui.Reflowable;

public class Scroller extends SharedScrolledComposite implements Reflowable {

	private UIJob reflowJob;

	public Scroller(Composite parent) {
		this(parent, SWT.V_SCROLL | SWT.H_SCROLL);
	}

	public Scroller(Composite parent, int style) {
		super(parent, style);

		setFont(parent.getFont());

//		fToolkit= JavaPlugin.getDefault().getDialogsFormToolkit();

		setExpandHorizontal(true);
		setExpandVertical(true);

		Composite body= new Composite(this, SWT.NONE);
		body.setFont(parent.getFont());
		setContent(body);
	}

	public Composite getBody() {
		return (Composite) getContent();
	}

	@Override
	public boolean reflow() {
		return reflowAsync();
	}
	
	public boolean reflowAsync() {
		if (reflowJob==null) {
			reflowJob = new UIJob(Display.getDefault(), "Reflow Wizard Contents") {
				@Override
				public IStatus runInUIThread(IProgressMonitor monitor) {
					reflow(true);
					return Status.OK_STATUS;
				}
			};
			reflowJob.setSystem(true);
		}
		reflowJob.schedule();
		return true;
	}

}

@@ -918,74 +918,8 @@
 Job;
-%0Aimport org.springsource.ide.eclipse.commons.livexp.ui.Reflowable;
 %0A%0Apu
@@ -1778,24 +1778,247 @@
  monitor) %7B%0A
+%09%09%09%09%09// Must guard against widget disposed, as%0A%09%09%09%09%09// this is an asynch operation, and it is possible that%0A%09%09%09        // the widget may get disposed after scheduling a job, but before it can run%0A%09%09%09%09%09if (!isDisposed()) %7B%0A%09
 %09%09%09%09%09reflow(
@@ -2024,16 +2024,23 @@
 (true);%0A
+%09%09%09%09%09%7D%0A
 %09%09%09%09%09ret

Add guard on widget isDisposed when reflowing.