Search in sources :

Example 1 with GroovyASTCompletionProcessor

use of eu.esdihumboldt.hale.ui.util.groovy.internal.contentassist.GroovyASTCompletionProcessor in project hale by halestudio.

the class SimpleGroovySourceViewerConfiguration method getContentAssistant.

/*
	 * @see SourceViewerConfiguration#getContentAssistant(ISourceViewer)
	 */
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    // if (getEditor() != null) {
    // 
    ContentAssistant assistant = new ContentAssistant();
    assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    assistant.enableColoredLabels(true);
    IContentAssistProcessor testProcessor = new GroovyASTCompletionProcessor(fCustomCompletions);
    assistant.setContentAssistProcessor(testProcessor, IDocument.DEFAULT_CONTENT_TYPE);
    // assistant.setRestoreCompletionProposalSize(getSettings("completion_proposal_size")); //$NON-NLS-1$
    // 
    // IContentAssistProcessor javaProcessor= new JavaCompletionProcessor(getEditor(), assistant, IDocument.DEFAULT_CONTENT_TYPE);
    // assistant.setContentAssistProcessor(javaProcessor, IDocument.DEFAULT_CONTENT_TYPE);
    // 
    // ContentAssistProcessor singleLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
    // assistant.setContentAssistProcessor(singleLineProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
    // 
    // ContentAssistProcessor stringProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_STRING);
    // assistant.setContentAssistProcessor(stringProcessor, IJavaPartitions.JAVA_STRING);
    // 
    // ContentAssistProcessor multiLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
    // assistant.setContentAssistProcessor(multiLineProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
    // 
    // ContentAssistProcessor javadocProcessor= new JavadocCompletionProcessor(getEditor(), assistant);
    // assistant.setContentAssistProcessor(javadocProcessor, IJavaPartitions.JAVA_DOC);
    // 
    // ContentAssistPreference.configure(assistant, fPreferenceStore);
    // 
    // assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
    // set how to show "additional information" in a completion proposal
    assistant.setInformationControlCreator(new IInformationControlCreator() {

        @Override
        public IInformationControl createInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, true);
        }
    });
    return assistant;
// }
// return null;
}
Also used : GroovyASTCompletionProcessor(eu.esdihumboldt.hale.ui.util.groovy.internal.contentassist.GroovyASTCompletionProcessor) IInformationControlCreator(org.eclipse.jface.text.IInformationControlCreator) Shell(org.eclipse.swt.widgets.Shell) IInformationControl(org.eclipse.jface.text.IInformationControl) DefaultInformationControl(org.eclipse.jface.text.DefaultInformationControl) IContentAssistProcessor(org.eclipse.jface.text.contentassist.IContentAssistProcessor) IContentAssistant(org.eclipse.jface.text.contentassist.IContentAssistant) ContentAssistant(org.eclipse.jface.text.contentassist.ContentAssistant)

Aggregations

GroovyASTCompletionProcessor (eu.esdihumboldt.hale.ui.util.groovy.internal.contentassist.GroovyASTCompletionProcessor)1 DefaultInformationControl (org.eclipse.jface.text.DefaultInformationControl)1 IInformationControl (org.eclipse.jface.text.IInformationControl)1 IInformationControlCreator (org.eclipse.jface.text.IInformationControlCreator)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 Shell (org.eclipse.swt.widgets.Shell)1