Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Make WizardDialog.run(...) a bad practice as it block all UI ?

On 09/12/2016 03:39 PM, Stefan Oehme wrote:

Thanks for starting this Mickael!

In Buildship we have a project preview in the wizard using WizardDialog.run() and it blocks the 'Finish' button, which is not what we want. We do like the progress bar though. I'd be happy to hear the better alternatives.

I'm currently investing dirty hacks. Here is my best proposal ATM:

getContainer().run(false, true, monitor -> {
  if (monitor instanceof ProgressMonitorPart) {
    wizardProgressMonitor = (ProgressMonitorPart) monitor;
  }
});
wizardProgressMonitor.setVisible(true);
// using a wrapper is useful to manage multiple operations and cancel some of them, may be useless for a single one
currentProgressMonitor = new DelegateProgressMonitorExceptCancel(wizardProgressMonitor);
ModalContext.run(refreshProposalsRunnable, true, currentProgressMonitor, getShell().getDisplay());

Hope this helps.
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat
My blog - My Tweets

Back to the top