Skip to main content

Blocked by an Eclipse Wizard?

There is a small but very useful patch in Eclipse 4.12 for people that do not want the UI to be blocked by wizards. There are many cases where it is desired that the underlying window can be reached WHILE the user is finishing the wizard. That's why it's strange that the Eclipse Wizard demands from us to always have full and utter attention.
Image by <a href="https://pixabay.com/users/KlausHausmann-1332067/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=921290">Klaus Hausmann</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=921290">Pixabay</a>

TL;DR;

If you want the free yourself today from blocking wizards, you may start Eclipse with the following setting:

      -Djface.allWizardsNonModal=true

This will hint Eclipse Wizards to not block. Most current wizards will obey.

You can stick this setting in the eclipse.ini file or provide it as part of your Eclipse launcher shortcut after -vmargs.
 

 

 

New API to the Rescue

 The technical term for a blocking UI is a "modal window" (wikipedia article). Sure, a dedicated programmer would override WizardDialog and do some hacking magic but there was never a formal way of making wizards not block the UI.

The following API methods are added to the JFace WizardDialog.

  • public WizardDialog setModal(boolean modal)
  • public boolean isModal()

In addition, the following methods have been made public to allow full control over the shell style of the WizardDialog.

  • public void setShellStyle(int newShellStyle)
  • public int getShellStyle()

You can now use the following code:

       WizardDialog d = new WizardDialog(shell, wizard);
       d.setModal(false);
      d.open()
;

or fluent

        new WizardDialog(shell, wizard).setModal(false).open();
 

Image by <b>Wim Jongman</b> from <a href="https://remainsoftware.com">Remain Software</a>

Cheers,

Wim Jongman