}
	public void apply(IDocument document, char trigger, int offset) {		try {			ImportsStructure impStructure= null;						if (fCompilationUnit != null && allowAddingImports()) {				IJavaProject project= fCompilationUnit.getJavaProject();				String[] prefOrder= JavaPreferencesSettings.getImportOrderPreference(project);				int threshold= JavaPreferencesSettings.getImportNumberThreshold(project);									impStructure= new ImportsStructure(fCompilationUnit, prefOrder, threshold, true);			}						boolean importAdded= updateReplacementString(document, trigger, offset, impStructure);			if (importAdded) {				setCursorPosition(getReplacementString().length());			}						super.apply(document, trigger, offset);						if (importAdded) {				int oldLen= document.getLength();				impStructure.getResultingEdits(document, new NullProgressMonitor()).apply(document, TextEdit.UPDATE_REGIONS);				setReplacementOffset(getReplacementOffset() + document.getLength() - oldLen);			}		} catch (CoreException e) {			JavaPlugin.log(e);		} catch (BadLocationException e) {			JavaPlugin.log(e);		}	}