});
}
public static void installContentAssistProcessor(IWorkbenchPart part) {
if (part instanceof CompilationUnitEditor) {
final CompilationUnitEditor ed = (CompilationUnitEditor)part;
IContentAssistProcessor processor = null;
//eclipse 3.2 class
try {
Class.forName("org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext"); //$NON-NLS-1$
processor = getWojJavaCompletionProcessor32(ed);
} catch (ClassNotFoundException e) {
try {
Class.forName("org.eclipse.jdt.ui.text.java.CompletionProposalCollector"); //$NON-NLS-1$
processor = getWojJavaCompletionProcessor31(ed);
} catch (ClassNotFoundException e2) {
processor = getWojJavaCompletionProcessor30(ed);
}
}
if(processor != null) {
try {
ContentAssistant assistant = (ContentAssistant) HookUtil.getPrivateAttributeValue(SourceViewer.class, "fContentAssistant", ed.getViewer()); //$NON-NLS-1$
//HookUtil.callPrivateMethod("org.eclipse.jdt.internal.ui.javaeditor.JavaEditor","initializeEditor", null, ed, null);
//assistant.install(ed.getViewer());
assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
SourceViewerConfiguration conf = (SourceViewerConfiguration) HookUtil.getPrivateAttributeValue(AbstractTextEditor.class, "fConfiguration", ed); //$NON-NLS-1$
ContentAssistPreference.configure(assistant, (IPreferenceStore) HookUtil.getPrivateAttributeValue(Class.forName("org.eclipse.ui.editors.text.TextSourceViewerConfiguration"),"fPreferenceStore", conf));