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 ?

(apologies for too much off-topic)

In addition, users are often irritated by the modality of the wizard (blocking the underlying window). They are not able to navigate around for additional info whilst in the middle of a complex wizard. What I do is override the WizardDialog class to disable modality which is set in the constructor of WizardDialog. Something like:

   WizardDialog wd = new WizardDialog(composite.getShell(), myWizard){
      @Override
      protected void configureShell(Shell newShell) {
        // TODO Auto-generated method stub
        super.configureShell(newShell);
        setShellStyle(SWT.CLOSE | SWT.MAX | SWT.MIN | SWT.TITLE | SWT.BORDER | SWT.RESIZE | getDefaultOrientation());
      }
    };

I'm not sure if there is a pressing reason for making wizards modal. It would be nice if we could control this from the outside instead of creating an anonymous class like I did above.

.

On Mon, Sep 12, 2016 at 4:25 PM, Mickael Istria <mistria@xxxxxxxxxx> wrote:
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

_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev


Back to the top