Mercurial > projects > dwt2
diff org.eclipse.jface.snippets/EclipseJfaceSnippets/org/eclipse/jface/snippets/wizard/Snippet047WizardWithLongRunningOperation.d @ 34:a8a838017920
All JFace snippets build on windows
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 23 Mar 2009 15:06:06 +0100 |
parents | c4b36186a9bc |
children |
line wrap: on
line diff
--- a/org.eclipse.jface.snippets/EclipseJfaceSnippets/org/eclipse/jface/snippets/wizard/Snippet047WizardWithLongRunningOperation.d Mon Mar 23 12:16:13 2009 +0100 +++ b/org.eclipse.jface.snippets/EclipseJfaceSnippets/org/eclipse/jface/snippets/wizard/Snippet047WizardWithLongRunningOperation.d Mon Mar 23 15:06:06 2009 +0100 @@ -32,9 +32,9 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.ProgressBar; import org.eclipse.swt.widgets.Shell; - +import org.eclipse.jface.operation.IRunnableWithProgress; import java.lang.all; -import java.utils.ArrayList; +import java.util.ArrayList; import java.lang.Thread; import tango.text.convert.Format; @@ -147,12 +147,7 @@ } setControl(mt.comp); - - ModalContext.run( dgRunnable(&mt.threadWork), true, getProgressMonitor(), getShell().getDisplay() ); - - //Thread t = new Thread(&mt.threadWork); - - // t.start(); + dialog.run( true, true, dgIRunnableWithProgress(&mt.threadWork)); } class MyThread { private Composite parent; @@ -240,6 +235,7 @@ } static Shell shell; + static WizardDialog dialog; public static void main(String[] args) { Display display = new Display(); @@ -251,7 +247,7 @@ b.addSelectionListener(new class SelectionAdapter { public void widgetSelected(SelectionEvent e) { - WizardDialog dialog = new WizardDialog(shell, new MyWizard(1)); + dialog = new WizardDialog(shell, new MyWizard(1)); dialog.open(); } @@ -262,7 +258,7 @@ b.addSelectionListener(new class SelectionAdapter { public void widgetSelected(SelectionEvent e) { - WizardDialog dialog = new WizardDialog(shell, new MyWizard(2)); + dialog = new WizardDialog(shell, new MyWizard(2)); dialog.open(); }