IWizardDescriptor wizardDesc = workbench.getExportWizardRegistry().findWizard(id);
if (wizardDesc == null) {
wizardDesc = workbench.getNewWizardRegistry().findWizard(id);
}
if (wizardDesc != null) {
IWorkbenchWizard wizard = wizardDesc.createWizard();
IEditorPart editorPart = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editorPart != null && editorPart.getEditorInput() instanceof FileEditorInput) {
FileEditorInput input = (FileEditorInput) editorPart.getEditorInput();
wizard.init(workbench, new SingleStructuredSelection(input.getFile().getParent()));
WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
dialog.open();
return wizard;
} else {
return null;