1 11 12 package org.eclipse.jdt.internal.debug.ui.snippeteditor; 13 14 15 import org.eclipse.jdt.internal.debug.ui.JDIContentAssistPreference; 16 import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; 17 import org.eclipse.jdt.ui.text.JavaTextTools; 18 import org.eclipse.jface.preference.IPreferenceStore; 19 import org.eclipse.jface.text.IDocument; 20 import org.eclipse.jface.text.contentassist.ContentAssistant; 21 import org.eclipse.jface.text.contentassist.IContentAssistProcessor; 22 import org.eclipse.jface.text.contentassist.IContentAssistant; 23 import org.eclipse.jface.text.reconciler.IReconciler; 24 import org.eclipse.jface.text.source.ISourceViewer; 25 26 29 public class JavaSnippetViewerConfiguration extends JavaSourceViewerConfiguration { 30 31 public JavaSnippetViewerConfiguration(JavaTextTools tools, IPreferenceStore preferenceStore, JavaSnippetEditor editor) { 32 super(tools.getColorManager(), preferenceStore, editor, null); 33 } 34 35 38 public IContentAssistProcessor getContentAssistantProcessor() { 39 return new JavaSnippetCompletionProcessor((JavaSnippetEditor)getEditor()); 40 } 41 42 45 public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { 46 47 ContentAssistant assistant = new ContentAssistant(); 48 assistant.setContentAssistProcessor( 49 getContentAssistantProcessor(), 50 IDocument.DEFAULT_CONTENT_TYPE); 51 52 JDIContentAssistPreference.configure(assistant, getColorManager()); 53 54 assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); 55 assistant.setInformationControlCreator( 56 getInformationControlCreator(sourceViewer)); 57 58 return assistant; 59 } 60 61 64 public IReconciler getReconciler(ISourceViewer sourceViewer) { 65 return null; 66 } 67 } 68 | Popular Tags |