Search in sources :

Example 1 with ContentAssistProcessor

use of org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor in project tdi-studio-se by Talend.

the class TalendJavaViewerConfiguration method getContentAssistant.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer
     * )
     */
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    ContentAssistant assistant = new ContentAssistant();
    assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    //$NON-NLS-1$
    assistant.setRestoreCompletionProposalSize(getSettings("completion_proposal_size"));
    IContentAssistProcessor javaProcessor = new TalendJavaCompletionProcessor(assistant, IDocument.DEFAULT_CONTENT_TYPE);
    assistant.setContentAssistProcessor(javaProcessor, IDocument.DEFAULT_CONTENT_TYPE);
    ContentAssistProcessor singleLineProcessor = new TalendJavaCompletionProcessor(assistant, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
    assistant.setContentAssistProcessor(singleLineProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
    ContentAssistProcessor stringProcessor = new TalendJavaCompletionProcessor(assistant, IJavaPartitions.JAVA_STRING);
    assistant.setContentAssistProcessor(stringProcessor, IJavaPartitions.JAVA_STRING);
    ContentAssistProcessor multiLineProcessor = new TalendJavaCompletionProcessor(assistant, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
    assistant.setContentAssistProcessor(multiLineProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
    // ContentAssistProcessor javadocProcessor = new TalendJavaCompletionProcessor(assistant,
    // IJavaPartitions.JAVA_DOC);
    // assistant.setContentAssistProcessor(javadocProcessor, IJavaPartitions.JAVA_DOC);
    // ContentAssistProcessor javadocProcessor = new JavadocCompletionProcessor(getInternalEditor(), assistant);
    // assistant.setContentAssistProcessor(javadocProcessor, IJavaPartitions.JAVA_DOC);
    //
    ContentAssistPreference.configure(assistant, fPreferenceStore);
    assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
    assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
    return assistant;
}
Also used : IContentAssistProcessor(org.eclipse.jface.text.contentassist.IContentAssistProcessor) ContentAssistProcessor(org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor) IContentAssistProcessor(org.eclipse.jface.text.contentassist.IContentAssistProcessor) IContentAssistant(org.eclipse.jface.text.contentassist.IContentAssistant) ContentAssistant(org.eclipse.jface.text.contentassist.ContentAssistant)

Aggregations

ContentAssistProcessor (org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor)1 ContentAssistant (org.eclipse.jface.text.contentassist.ContentAssistant)1 IContentAssistProcessor (org.eclipse.jface.text.contentassist.IContentAssistProcessor)1 IContentAssistant (org.eclipse.jface.text.contentassist.IContentAssistant)1