Reputation: 951
I am creating a WizardDialog
as follows in a command line application
final Shell shell = new Shell(display);
Wizard wiz = new ImportWizard();
WizardDialog dialog = new WizardDialog(shell, wiz);
dialog.create();
dialog.open();
The wizard dialog does show. But it does not show up in Taskbar. I also tried
shell.setVisible(true);
dialog.open();
This got the Shell to show up in the taskbar, but the shell window was visible behind the wizard.
How I can resolve this?
Upvotes: 0
Views: 896
Reputation: 951
I was able to solve this using the following snippet
Wizard wiz = new ImportWizard();
WizardDialog dialog = new WizardDialog(null, wiz);
dialog.create();
dialog.open();
By passing null
as Shell
in the WizardDialog
constructor.
Upvotes: 2
Reputation: 3304
I might assume, that the reason for such behavior is that WizardDialog
class has only constructor to provide Shell
, which in the end (in Dialog
class) uses SameShellProvider
as a shell provider. You need to inherit from something, where you can pass your own IShellProvider
, for instance TrayDialog
(or some other suitable class).
Upvotes: 0