| |
| package org.eclipse.jdt.internal.debug.ui.snippeteditor; |
| |
| /* |
| * (c) Copyright IBM Corp. 2000, 2001. |
| * All Rights Reserved. |
| */ |
| |
| import org.eclipse.jdt.internal.debug.ui.JDIContentAssistPreference; |
| import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; |
| import org.eclipse.jdt.ui.text.JavaTextTools; |
| import org.eclipse.jface.text.IDocument; |
| import org.eclipse.jface.text.contentassist.ContentAssistant; |
| import org.eclipse.jface.text.contentassist.IContentAssistProcessor; |
| import org.eclipse.jface.text.contentassist.IContentAssistant; |
| import org.eclipse.jface.text.source.ISourceViewer; |
| |
| /** |
| * The source viewer configuration for the Java snippet editor. |
| */ |
| public class JavaSnippetViewerConfiguration extends JavaSourceViewerConfiguration { |
| |
| public JavaSnippetViewerConfiguration(JavaTextTools tools, JavaSnippetEditor editor) { |
| super(tools, editor); |
| } |
| |
| /** |
| * @see JDIViewerConfiguration#getContentAssistantProcessor() |
| */ |
| public IContentAssistProcessor getContentAssistantProcessor() { |
| return new JavaSnippetCompletionProcessor((JavaSnippetEditor)getEditor()); |
| } |
| |
| /** |
| * @see SourceViewerConfiguration#getContentAssistant(ISourceViewer) |
| */ |
| public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { |
| |
| ContentAssistant assistant = new ContentAssistant(); |
| assistant.setContentAssistProcessor( |
| getContentAssistantProcessor(), |
| IDocument.DEFAULT_CONTENT_TYPE); |
| |
| JDIContentAssistPreference.configure(assistant, getColorManager()); |
| |
| assistant.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_ABOVE); |
| assistant.setInformationControlCreator( |
| getInformationControlCreator(sourceViewer)); |
| |
| return assistant; |
| } |
| } |