editor.init(new EclimEditorSite(), input);
editor.setInput(input);
CTextTools textTools = CUIPlugin.getDefault().getTextTools();
IPreferenceStore store = CUIPlugin.getDefault().getCombinedPreferenceStore();
CSourceViewerConfiguration config =
new CSourceViewerConfiguration(
textTools.getColorManager(),
store,
editor,
textTools.getDocumentPartitioning());
CSourceViewer viewer = new CSourceViewer(
EclimPlugin.getShell(), null, null, false,
SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION,
CUIPlugin.getDefault().getPreferenceStore());
viewer.setDocument(ProjectUtils.getDocument(project, file));
ContentAssistant ca = (ContentAssistant)config.getContentAssistant(viewer);
Method computeCompletionProposals =
ContentAssistant.class.getDeclaredMethod(
"computeCompletionProposals", ITextViewer.class, Integer.TYPE);
computeCompletionProposals.setAccessible(true);