if (createdType != null) { IJavaElement container= createdType.getParent(); if (container instanceof ICompilationUnit) { container= container.getParent(); } if (!container.equals(fTypeContainer)) {  IJavaProject project= fCompilationUnit.getJavaProject(); try { ImportsStructure imp= new ImportsStructure(fCompilationUnit, JavaPreferencesSettings.getImportOrderPreference(project), JavaPreferencesSettings.getImportNumberThreshold(project), true); imp.addImport(createdType.getFullyQualifiedName('.')); imp.create(false, null); } catch (CoreException e) { } } }
	public void apply(IDocument document) {		NewElementWizard wizard= createWizard();		wizard.init(JavaPlugin.getDefault().getWorkbench(), new StructuredSelection(fCompilationUnit));		if (fShowDialog) {			Shell shell= JavaPlugin.getActiveWorkbenchShell();			WizardDialog dialog= new WizardDialog(shell, wizard);			PixelConverter converter= new PixelConverter(shell);			dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20));			dialog.create();			dialog.getShell().setText(CorrectionMessages.NewCUCompletionUsingWizardProposal_dialogtitle);			configureWizardPage(wizard);			dialog.open();		} else {			wizard.addPages();			try {				NewTypeWizardPage page= configureWizardPage(wizard);				page.createType(null);			} catch (CoreException e) {				JavaPlugin.log(e);			} catch (InterruptedException e) {			}		}	}