eclipse plugin: add centering for new wizard dialogs

This commit is contained in:
Timotei Dolean 2010-07-20 22:04:52 +00:00
parent b869102949
commit 4b49bf900f

View File

@ -36,8 +36,10 @@ public class WizardUtils
WizardDialog wizardDialog = new WizardDialog(shell, wizard);
wizardDialog.create();
//TODO: center wizard?
wizardDialog.getShell().setLocation(shell.getBounds().x, shell.getBounds().y);
int x = shell.getBounds().x, y = shell.getBounds().y;
x += ((shell.getBounds().width - wizardDialog.getShell().getBounds().width)/2);
y += ((shell.getBounds().height - wizardDialog.getShell().getBounds().height)/2);
wizardDialog.getShell().setLocation(x, y);
Activator.getDefault().getWorkbench().getHelpSystem().setHelp(wizardDialog.getShell(),
"org.eclipse.ui.new_wizard_context");